Subversion Repositories DevTools

Rev

Rev 2173 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2173 Rev 2175
Line 101... Line 101...
101
      /// </summary>
101
      /// </summary>
102
      /// <param name="ea_repository"></param>
102
      /// <param name="ea_repository"></param>
103
      /// <param name="changeLog"></param>
103
      /// <param name="changeLog"></param>
104
      public void displayChangeLog(EA.Element changeLog)
104
      public void displayChangeLog(EA.Element changeLog)
105
      {
105
      {
-
 
106
         int numberOfChangesForDeletedElements = 0;
-
 
107
 
106
         Main.WriteOutput("Displaying Import Change Log", -1);
108
         Main.WriteOutput("Displaying Import Change Log", -1);
107
 
109
 
108
         if (changeLog.Notes == null || changeLog.Notes.Length == 0 || changeLog.Notes.Trim().Length == 0)
110
         if (changeLog.Notes == null || changeLog.Notes.Length == 0 || changeLog.Notes.Trim().Length == 0)
109
         {
111
         {
110
            Main.WriteOutput("  No changes", -1);
112
            Main.WriteOutput("  No changes", -1);
Line 150... Line 152...
150
 
152
 
151
                     // Now discriminate actions based on the second parameter
153
                     // Now discriminate actions based on the second parameter
152
 
154
 
153
                     if (parameters[1].StartsWith("Created"))
155
                     if (parameters[1].StartsWith("Created"))
154
                     {
156
                     {
-
 
157
                        // user may have deleted old orphaned requirements so we would not be able to get the EA
-
 
158
                        // element so we cannot use it for display purposes at all.
-
 
159
                        if (ea_req == null)
-
 
160
                        {
-
 
161
                           Main.WriteOutput("  Created : " + parameters[2], -1 );
-
 
162
                        }
-
 
163
                        else
-
 
164
                        {
155
                        Main.WriteOutput("  Created : " + ea_req.Name, ea_req.ElementID );
165
                           Main.WriteOutput("  Created : " + ea_req.Name, ea_req.ElementID );
-
 
166
                        }
156
                     }
167
                     }
157
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
168
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
158
                     else if (parameters[1].StartsWith("Orphaned"))
169
                     else if (parameters[1].StartsWith("Orphaned"))
159
                     {
170
                     {
160
                        Main.WriteOutput("  Orphaned : " + ea_req.Name, ea_req.ElementID );
171
                        // user may have deleted old orphaned requirements so we would not be able to get the EA
161
 
-
 
162
                        foreach (EA.Connector theConnector in ea_req.Connectors)
172
                        // element so we cannot use it for display purposes at all.
-
 
173
                        if (ea_req == null)
163
                        {
174
                        {
164
                           int destId = -1;
-
 
165
 
-
 
166
                           // we dont care about direction of relationship, so test for both
-
 
167
                           if (theConnector.ClientID == ea_req.ElementID)
175
                           Main.WriteOutput("  Orphaned : " + parameters[2], -1 );
168
                              destId = theConnector.SupplierID;
176
                        }
169
                           else if (theConnector.SupplierID == ea_req.ElementID)
-
 
170
                              destId = theConnector.ClientID;
177
                        else
171
                           else
178
                        {
172
                              destId = theConnector.SupplierID;
179
                           // We have the EA element so do a full display of the orphaned item
-
 
180
                           Main.WriteOutput("  Orphaned : " + ea_req.Name, ea_req.ElementID );
173
 
181
 
174
                           // and make sure we filter out self-referential connectors
182
                           foreach (EA.Connector theConnector in ea_req.Connectors)
175
                           if (destId != ea_req.ElementID)
-
 
176
                           {
183
                           {
-
 
184
                              int destId = -1;
-
 
185
 
177
                              EA.Package tgt_pkg = (EA.Package)Main.EA_Repository.GetPackageByID( destId );
186
                              // we dont care about direction of relationship, so test for both
178
                              if (tgt_pkg != null)
187
                              if (theConnector.ClientID == ea_req.ElementID)
179
                              {
188
                                 destId = theConnector.SupplierID;
180
                                 Main.WriteOutput("     --> " + tgt_pkg.Name, tgt_pkg.PackageID);
189
                              else if (theConnector.SupplierID == ea_req.ElementID)
181
                              }
190
                                 destId = theConnector.ClientID;
182
                              else
191
                              else
-
 
192
                                 destId = theConnector.SupplierID;
-
 
193
 
-
 
194
                              // and make sure we filter out self-referential connectors
-
 
195
                              if (destId != ea_req.ElementID)
183
                              {
196
                              {
184
                                 EA.Element tgt_ele = (EA.Element)Main.EA_Repository.GetElementByID( destId );
197
                                 EA.Package tgt_pkg = (EA.Package)Main.EA_Repository.GetPackageByID( destId );
185
                                 if (tgt_ele != null)
198
                                 if (tgt_pkg != null)
-
 
199
                                 {
-
 
200
                                    Main.WriteOutput("     --> " + tgt_pkg.Name, tgt_pkg.PackageID);
-
 
201
                                 }
-
 
202
                                 else
186
                                 {
203
                                 {
-
 
204
                                    EA.Element tgt_ele = (EA.Element)Main.EA_Repository.GetElementByID( destId );
-
 
205
                                    if (tgt_ele != null)
-
 
206
                                    {
187
                                    //if (!tgt_ele.Type.StartsWith("Requirement"))
207
                                       //if (!tgt_ele.Type.StartsWith("Requirement"))
188
                                    Main.WriteOutput("     --> " + tgt_ele.Name, tgt_ele.ElementID);
208
                                       Main.WriteOutput("     --> " + tgt_ele.Name, tgt_ele.ElementID);
-
 
209
                                    }
189
                                 }
210
                                 }
190
                              }
211
                              }
191
                           }
212
                           }
192
                        }
213
                        }
193
                     }
214
                     }
194
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
195
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_NAME))
-
 
196
                     {
-
 
197
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_NAME, ea_req.Name), ea_req.ElementID );
-
 
198
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
199
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
200
                     }
-
 
201
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
202
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_NOTES)) // aka Description of the requirement
-
 
203
                     {
-
 
204
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", "Description", ea_req.Name), ea_req.ElementID );
-
 
205
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
206
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
207
                     }
-
 
208
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
209
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_DIFFICULTY))
-
 
210
                     {
-
 
211
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_DIFFICULTY, ea_req.Name), ea_req.ElementID );
-
 
212
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
213
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
214
                     }
-
 
215
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
216
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_PRIORITY))
-
 
217
                     {
-
 
218
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_PRIORITY, ea_req.Name), ea_req.ElementID );
-
 
219
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
220
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
221
                     }
-
 
222
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
223
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_VERSION))
-
 
224
                     {
-
 
225
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_VERSION, ea_req.Name), ea_req.ElementID );
-
 
226
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
227
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
228
                     }
-
 
229
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
230
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_STATUS))
-
 
231
                     {
-
 
232
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_STATUS, ea_req.Name), ea_req.ElementID );
-
 
233
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
234
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
235
                     }
-
 
236
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
237
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_SUBSYSTEM_TYPE))
-
 
238
                     {
-
 
239
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SUBSYSTEM_TYPE, ea_req.Name), ea_req.ElementID );
-
 
240
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
241
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
242
                     }
-
 
243
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
244
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_STABILITY))
-
 
245
                     {
-
 
246
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_STABILITY, ea_req.Name), ea_req.ElementID );
-
 
247
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
248
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
249
                     }
215
                     else
250
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
251
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_REQ_TYPE))
-
 
252
                     {
216
                     {
-
 
217
                        if (ea_req != null)
-
 
218
                        {
-
 
219
                           /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
220
                           if (parameters[1].StartsWith(Constants.CHG_LOG_NAME))
-
 
221
                           {
-
 
222
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_NAME, ea_req.Name), ea_req.ElementID );
-
 
223
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
224
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
225
                           }
-
 
226
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
227
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_NOTES)) // aka Description of the requirement
-
 
228
                           {
-
 
229
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", "Description", ea_req.Name), ea_req.ElementID );
-
 
230
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
231
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
232
                           }
-
 
233
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
234
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_DIFFICULTY))
-
 
235
                           {
-
 
236
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_DIFFICULTY, ea_req.Name), ea_req.ElementID );
-
 
237
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
238
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
239
                           }
-
 
240
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
241
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_PRIORITY))
-
 
242
                           {
-
 
243
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_PRIORITY, ea_req.Name), ea_req.ElementID );
-
 
244
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
245
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
246
                           }
-
 
247
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
248
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_VERSION))
-
 
249
                           {
-
 
250
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_VERSION, ea_req.Name), ea_req.ElementID );
-
 
251
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
252
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
253
                           }
-
 
254
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
255
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_STATUS))
-
 
256
                           {
-
 
257
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_STATUS, ea_req.Name), ea_req.ElementID );
-
 
258
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
259
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
260
                           }
-
 
261
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
262
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_SUBSYSTEM_TYPE))
-
 
263
                           {
-
 
264
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SUBSYSTEM_TYPE, ea_req.Name), ea_req.ElementID );
-
 
265
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
266
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
267
                           }
-
 
268
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
269
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_STABILITY))
-
 
270
                           {
-
 
271
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_STABILITY, ea_req.Name), ea_req.ElementID );
-
 
272
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
-
 
273
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
274
                           }
-
 
275
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 
276
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_REQ_TYPE))
-
 
277
                           {
253
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_REQ_TYPE, ea_req.Name), ea_req.ElementID );
278
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_REQ_TYPE, ea_req.Name), ea_req.ElementID );
254
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
279
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
255
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
280
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
256
                     }
281
                           }
257
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
282
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
258
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE_VERSION))
283
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE_VERSION))
259
                     {
284
                           {
260
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE_VERSION, ea_req.Name), ea_req.ElementID );
285
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE_VERSION, ea_req.Name), ea_req.ElementID );
261
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
286
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
262
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
287
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
263
                     }
288
                           }
264
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
289
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
265
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE_SECTION))
290
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE_SECTION))
266
                     {
291
                           {
267
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE_SECTION, ea_req.Name), ea_req.ElementID );
292
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE_SECTION, ea_req.Name), ea_req.ElementID );
268
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
293
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
269
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
294
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
270
                     }
295
                           }
271
                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
296
                              /////////////////////////////////////////////////////////////////////////////////////////////////////////////
272
                     else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE))
297
                           else if (parameters[1].StartsWith(Constants.CHG_LOG_SOURCE))
273
                     {
298
                           {
274
                        Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE, ea_req.Name), ea_req.ElementID );
299
                              Main.WriteOutput(string.Format("  Modified {0}: {1}", Constants.CHG_LOG_SOURCE, ea_req.Name), ea_req.ElementID );
275
                        Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
300
                              Main.WriteOutput("     <<< " + parameters[2], ea_req.ElementID);
276
                        Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
301
                              Main.WriteOutput("     >>> " + parameters[3], ea_req.ElementID);
-
 
302
                           }
-
 
303
                        }
-
 
304
                        else
-
 
305
                        {
-
 
306
                           numberOfChangesForDeletedElements++;
-
 
307
                        }
277
                     }
308
                     }
278
                  }
309
                  }
279
               }
310
               }
280
               catch
311
               catch
281
               {
312
               {
282
               }
313
               }
283
            }
314
            }
284
         }
315
         }
-
 
316
         if (numberOfChangesForDeletedElements > 0)
-
 
317
         {
-
 
318
            Main.WriteOutput("NOTE: Some propert changes were not shown because the requirement elements have since been deleted", -1);
-
 
319
            Main.WriteOutput("and it is impossible to use the change log recorded GUIDs to determine what they were.", -1);
-
 
320
         }
285
      }
321
      }
286
 
322
 
287
 
323
 
288
      /// <summary>
324
      /// <summary>
289
      /// Rid a string of any : char because we use that as a delimiter in the change log and so we
325
      /// Rid a string of any : char because we use that as a delimiter in the change log and so we