Subversion Repositories DevTools

Rev

Rev 2116 | Rev 2120 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2116 Rev 2118
Line 22... Line 22...
22
      private static string fromColumnTitle = null;
22
      private static string fromColumnTitle = null;
23
      private static ArrayList fromElementTypes = null;
23
      private static ArrayList fromElementTypes = null;
24
      private static bool fromPackageRecursion = true;
24
      private static bool fromPackageRecursion = true;
25
      private static EA.Package fromPackage = null;
25
      private static EA.Package fromPackage = null;
26
      private static bool fromPackageTrimming = false;
26
      private static bool fromPackageTrimming = false;
-
 
27
      private static bool fromElementNotes = false;
27
 
28
 
28
      private static string toIntroText = null;       // This one is optional
29
      private static string toIntroText = null;       // This one is optional
29
      private static string toPackageGUID = null;
30
      private static string toPackageGUID = null;
30
      private static string toFromTableTitle = null;  // This one is optional
31
      private static string toFromTableTitle = null;  // This one is optional
31
      private static string toColumnTitle = null;
32
      private static string toColumnTitle = null;
32
      private static ArrayList toElementTypes = null;
33
      private static ArrayList toElementTypes = null;
33
      private static bool toPackageRecursion = true;
34
      private static bool toPackageRecursion = true;
34
      private static EA.Package toPackage = null;
35
      private static EA.Package toPackage = null;
35
      private static bool toPackageTrimming = false;
36
      private static bool toPackageTrimming = false;
-
 
37
      private static bool toElementNotes = false;
36
 
38
 
37
      
39
      
38
 
40
 
39
      private static string [] options_string = null;
41
      private static string [] options_string = null;
40
 
42
 
-
 
43
      private enum DictionaryValueType
41
 
44
      {
-
 
45
         DVT_EA_ELEMENT,
-
 
46
         DVT_STRING
-
 
47
      };
42
 
48
 
43
		public static void initialise(ArrayList processedElementsRef)
49
		public static void initialise(ArrayList processedElementsRef)
44
		{
50
		{
45
         processedElements = processedElementsRef;
51
         processedElements = processedElementsRef;
46
 
52
 
Line 58... Line 64...
58
         fromColumnTitle = null;
64
         fromColumnTitle = null;
59
         fromElementTypes.Clear();
65
         fromElementTypes.Clear();
60
         fromPackageRecursion = true;
66
         fromPackageRecursion = true;
61
         fromPackageTrimming = false;
67
         fromPackageTrimming = false;
62
         fromPackage = null;
68
         fromPackage = null;
-
 
69
         fromElementNotes = false;
63
         toIntroText = null;
70
         toIntroText = null;
64
         toPackageGUID = null;
71
         toPackageGUID = null;
65
         toFromTableTitle = null;
72
         toFromTableTitle = null;
66
         toColumnTitle = null;
73
         toColumnTitle = null;
67
         toElementTypes.Clear();
74
         toElementTypes.Clear();
68
         toPackageRecursion = true;
75
         toPackageRecursion = true;
69
         toPackageTrimming = false;
76
         toPackageTrimming = false;
70
         toPackage = null;
77
         toPackage = null;
-
 
78
         toElementNotes = false;
71
      }
79
      }
72
 
80
 
73
 
81
 
74
      public static bool processRelationshipMatrixOptions(EA.Element theElement)
82
      public static bool processRelationshipMatrixOptions(EA.Element theElement)
75
      {
83
      {
Line 94... Line 102...
94
            {
102
            {
95
               if (s.StartsWith("style="))
103
               if (s.StartsWith("style="))
96
               {
104
               {
97
                  style = EA_DocGenOptions.getOptionValue(s, style);
105
                  style = EA_DocGenOptions.getOptionValue(s, style);
98
               }
106
               }
99
               // FROM items
107
                  // FROM items
100
               else if (s.StartsWith("fromIntroText="))
108
               else if (s.StartsWith("fromIntroText="))
101
               {
109
               {
102
                  fromIntroText = EA_DocGenOptions.getOptionValue(s, null);
110
                  fromIntroText = EA_DocGenOptions.getOptionValue(s, null);
103
               }
111
               }
104
               else if (s.StartsWith("fromToTableTitle=")) 
112
               else if (s.StartsWith("fromToTableTitle=")) 
Line 119... Line 127...
119
               }
127
               }
120
               else if (s.StartsWith("fromPackage=")) 
128
               else if (s.StartsWith("fromPackage=")) 
121
               {
129
               {
122
                  fromPackageGUID = EA_DocGenOptions.getOptionValue(s, fromPackageGUID);
130
                  fromPackageGUID = EA_DocGenOptions.getOptionValue(s, fromPackageGUID);
123
               }
131
               }
-
 
132
               else if (s.StartsWith("fromElementNotes="))
-
 
133
               {
-
 
134
                  fromElementNotes = EA_DocGenOptions.getOptionValue(s, fromElementNotes);
-
 
135
               }
124
               else if (s.StartsWith("fromElementType=")) 
136
               else if (s.StartsWith("fromElementType=")) 
125
               {
137
               {
126
                  string et = EA_DocGenOptions.getOptionValue(s,null);
138
                  string et = EA_DocGenOptions.getOptionValue(s,null);
127
                  if (et != null) 
139
                  if (et != null) 
128
                  {
140
                  {
Line 153... Line 165...
153
               }               
165
               }               
154
               else if (s.StartsWith("toPackage=")) 
166
               else if (s.StartsWith("toPackage=")) 
155
               {
167
               {
156
                  toPackageGUID = EA_DocGenOptions.getOptionValue(s, toPackageGUID);
168
                  toPackageGUID = EA_DocGenOptions.getOptionValue(s, toPackageGUID);
157
               }
169
               }
-
 
170
               else if (s.StartsWith("toElementNotes="))
-
 
171
               {
-
 
172
                  toElementNotes = EA_DocGenOptions.getOptionValue(s, toElementNotes);
-
 
173
               }
158
               else if (s.StartsWith("toElementType=")) 
174
               else if (s.StartsWith("toElementType=")) 
159
               {
175
               {
160
                  string et = EA_DocGenOptions.getOptionValue(s,null);
176
                  string et = EA_DocGenOptions.getOptionValue(s,null);
161
                  if (et != null) 
177
                  if (et != null) 
162
                  {
178
                  {
Line 248... Line 264...
248
               + "fromPackage=\r\n"
264
               + "fromPackage=\r\n"
249
               + "fromElementType=\r\n"
265
               + "fromElementType=\r\n"
250
               + "fromElementType=\r\n"
266
               + "fromElementType=\r\n"
251
               + "fromPackageRecursion=true\r\n"
267
               + "fromPackageRecursion=true\r\n"
252
               + "fromPackageTrimming=false\r\n"
268
               + "fromPackageTrimming=false\r\n"
-
 
269
               + "fromElementNotes=false\r\n"
253
 
270
 
254
               + "toFromTableTitle=\r\n"
271
               + "toFromTableTitle=\r\n"
255
               + "toIntroText=\r\n"
272
               + "toIntroText=\r\n"
256
               + "toColumnTitle=\r\n"
273
               + "toColumnTitle=\r\n"
257
               + "toPackage=\r\n"
274
               + "toPackage=\r\n"
258
               + "toElementType=\r\n"
275
               + "toElementType=\r\n"
259
               + "toPackageRecursion=true\r\n"
276
               + "toPackageRecursion=true\r\n"
260
               + "toPackageTrimming=false\r\n";
277
               + "toPackageTrimming=false\r\n"
-
 
278
               + "toElementNotes=false\r\n";
261
            case 2:
279
            case 2:
262
               return
280
               return
263
               "style=2\r\n"
281
               "style=2\r\n"
264
               + "fromToTableTitle=Requirement Dependencies\r\n"
282
               + "fromToTableTitle=Requirement Dependencies\r\n"
265
               + "fromIntroText=The following table identifies the source requirements (if any) for each requirement stated in this document.\r\n"
283
               + "fromIntroText=The following table identifies the source requirements (if any) for each requirement stated in this document.\r\n"
266
               + "fromColumnTitle=Requirement\r\n"
284
               + "fromColumnTitle=Requirement\r\n"
267
               + "fromPackage=\r\n"
285
               + "fromPackage=\r\n"
268
               + "fromElementType=Requirement\r\n"
286
               + "fromElementType=Requirement\r\n"
269
               + "fromPackageRecursion=true\r\n"
287
               + "fromPackageRecursion=true\r\n"
270
               + "fromPackageTrimming=false\r\n"
288
               + "fromPackageTrimming=false\r\n"
-
 
289
               + "fromElementNotes=false\r\n"
271
 
290
 
272
               + "toPackageRecursion=true\r\n"
291
               + "toPackageRecursion=true\r\n"
273
               + "toPackage=\r\n"
292
               + "toPackage=\r\n"
274
               + "toColumnTitle=Source Requirements\r\n"
293
               + "toColumnTitle=Source Requirements\r\n"
275
               + "toElementType=Requirement\r\n";
294
               + "toElementType=Requirement\r\n";
Line 422... Line 441...
422
            table = createWordDoc.WordDocument.Tables[tableNum];
441
            table = createWordDoc.WordDocument.Tables[tableNum];
423
            
442
            
424
            TabularContent.Table_SetTableColumnTitle(table, fromColumnTitle, 1);
443
            TabularContent.Table_SetTableColumnTitle(table, fromColumnTitle, 1);
425
            TabularContent.Table_SetTableColumnTitle(table, toColumnTitle, 2);
444
            TabularContent.Table_SetTableColumnTitle(table, toColumnTitle, 2);
426
 
445
 
427
            fillInTable(fromToDictionary, table);
446
            fillInTable(fromToDictionary, table, DictionaryValueType.DVT_EA_ELEMENT);
428
         }
447
         }
429
 
448
 
430
         if (createWordDoc.abortCreationThread)
449
         if (createWordDoc.abortCreationThread)
431
            return;
450
            return;
432
 
451
 
433
         // Does user want a to-from table ?
452
         // Does user want a to-from table ?
434
         if (needToFromTable)
453
         if (needToFromTable)
435
         {
454
         {
-
 
455
            // update fromElementNotes with toElementNotes setting
-
 
456
            fromElementNotes = toElementNotes;
-
 
457
 
436
            // re-use the fromToDictionary to prepare the to-from table content 
458
            // re-use the fromToDictionary to prepare the to-from table content 
437
            fromToDictionary.Clear();
459
            fromToDictionary.Clear();
438
 
460
 
439
            // find all elements for the left hand column of the to-from table.
461
            // find all elements for the left hand column of the to-from table.
440
            ElementAccumulator toLister = new ElementAccumulator(toElementTypes);
462
            ElementAccumulator toLister = new ElementAccumulator(toElementTypes);
Line 506... Line 528...
506
            table = createWordDoc.WordDocument.Tables[tableNum];
528
            table = createWordDoc.WordDocument.Tables[tableNum];
507
            
529
            
508
            TabularContent.Table_SetTableColumnTitle(table, toColumnTitle, 1);
530
            TabularContent.Table_SetTableColumnTitle(table, toColumnTitle, 1);
509
            TabularContent.Table_SetTableColumnTitle(table, fromColumnTitle, 2);
531
            TabularContent.Table_SetTableColumnTitle(table, fromColumnTitle, 2);
510
 
532
 
511
            fillInTable(fromToDictionary, table);
533
            fillInTable(fromToDictionary, table, DictionaryValueType.DVT_STRING);
512
         }
534
         }
513
      }
535
      }
514
 
536
 
515
      private static void fillInTable(ArrayList fromToDictionary, Word.Table table )
537
      private static void fillInTable(ArrayList fromToDictionary, Word.Table table, DictionaryValueType valueType )
516
      {
538
      {
517
         int lastFromElementId = -1;
539
         int lastFromElementId = -1;
518
         bool firstToFromCon = true;
540
         bool firstCellContent = true;
519
         int row = 1;
541
         int row = 1;
520
         foreach (DictionaryEntry de in fromToDictionary)
542
         foreach (DictionaryEntry de in fromToDictionary)
521
         {
543
         {
522
            if (createWordDoc.abortCreationThread)
544
            if (createWordDoc.abortCreationThread)
523
               return;
545
               return;
Line 525... Line 547...
525
            if ( ((EA.Element)de.Key).ElementID != lastFromElementId )
547
            if ( ((EA.Element)de.Key).ElementID != lastFromElementId )
526
            {
548
            {
527
               lastFromElementId = ((EA.Element)de.Key).ElementID;
549
               lastFromElementId = ((EA.Element)de.Key).ElementID;
528
               row++;
550
               row++;
529
               table.Cell(row,1).Range.Text = ((EA.Element)de.Key).Name;
551
               table.Cell(row,1).Range.Text = ((EA.Element)de.Key).Name;
530
               firstToFromCon = true;
552
               firstCellContent = true;
-
 
553
 
-
 
554
               if (fromElementNotes && ((EA.Element)de.Key).Notes != null && ((EA.Element)de.Key).Notes.Length > 0)
-
 
555
               {
-
 
556
                  table.Cell(row,1).Range.Text += ((EA.Element)de.Key).Notes;
-
 
557
               }
531
            }
558
            }
532
               
-
 
533
            if (((string)de.Value).Length > 0)
559
            if ((valueType == DictionaryValueType.DVT_EA_ELEMENT) && (((EA.Element)de.Value) != null))
534
            {
560
            {
535
               if (firstToFromCon)
561
               if (firstCellContent)
536
               {
562
               {
537
                  firstToFromCon = false;
563
                  firstCellContent = false;
-
 
564
                  table.Cell(row,2).Range.Text = ((EA.Element)de.Value).Name;
-
 
565
               }
-
 
566
               else
-
 
567
               {
-
 
568
                  table.Cell(row,2).Range.Text += ((EA.Element)de.Value).Name;
-
 
569
               }
-
 
570
            }
-
 
571
            else if ((valueType == DictionaryValueType.DVT_STRING) && (((string)de.Value).Length > 0))
-
 
572
            {
-
 
573
               if (firstCellContent)
-
 
574
               {
-
 
575
                  firstCellContent = false;
538
                  table.Cell(row,2).Range.Text = (string)de.Value;
576
                  table.Cell(row,2).Range.Text = (string)de.Value;
539
               }
577
               }
540
               else
578
               else
541
               {
579
               {
542
                  table.Cell(row,2).Range.Text += (string)de.Value;
580
                  table.Cell(row,2).Range.Text += (string)de.Value;
Line 639... Line 677...
639
            if (createWordDoc.abortCreationThread)
677
            if (createWordDoc.abortCreationThread)
640
               return;
678
               return;
641
 
679
 
642
            table.Cell(row,1).Range.Text = ele.Name;
680
            table.Cell(row,1).Range.Text = ele.Name;
643
 
681
 
-
 
682
            if (fromElementNotes && ele.Notes != null && ele.Notes.Length > 0)
-
 
683
            {
-
 
684
               table.Cell(row,1).Range.Text += ele.Notes;
-
 
685
            }
-
 
686
 
644
            StringBuilder sb = new StringBuilder();
687
            StringBuilder sb = new StringBuilder();
645
 
688
 
646
            ArrayList parentsDiscovered = new ArrayList();
689
            ArrayList parentsDiscovered = new ArrayList();
647
 
690
 
648
            // Find this requirement's parent (source) requirements
691
            // Find this requirement's parent (source) requirements