Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-20 12:28:50 -0400
committerRyan D. Brooks2010-09-20 12:28:50 -0400
commitd799b025b9bf629923a0bae85e5a8b47b4fa4952 (patch)
treed586292104de4e81c059577f630bfb6248b5674b /plugins
parentfc19091da28ea99a661148e8ba677d6bb01dba10 (diff)
downloadorg.eclipse.osee-d799b025b9bf629923a0bae85e5a8b47b4fa4952.tar.gz
org.eclipse.osee-d799b025b9bf629923a0bae85e5a8b47b4fa4952.tar.xz
org.eclipse.osee-d799b025b9bf629923a0bae85e5a8b47b4fa4952.zip
feature[ats_UYPM6]: Partial - coverage tool needs ability to link ATS to coverage methods
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java42
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateGuid.java6
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java24
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java6
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemPersistTest.java24
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CoverageTestNavigateViews.java4
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CreateWorkProductAction.java102
-rw-r--r--plugins/org.eclipse.osee.coverage/jaxb/messages.xsd22
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java125
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java132
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageSave.java235
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java68
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java46
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoverUnitAction.java12
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoveragePackageAction.java13
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java8
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenCoveragePackageAction.java5
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java19
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewerFactory.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java53
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java114
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventType.java40
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageMessages.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java62
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java17
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageTestUnit.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java16
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/ICoverage.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java5
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/MessageCoverageItem.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java5
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java47
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageStore.java17
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java39
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java1
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/WorkProductActionLabelProvider.java50
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java9
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeDialog.java94
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java67
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/accessProviders/ArtifactTypeAccessProvder.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java29
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java7
53 files changed, 1260 insertions, 352 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
index 47c7b6cd87..cae2709ab9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
@@ -13,14 +13,20 @@ package org.eclipse.osee.ats.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.List;
+import java.util.Set;
import java.util.logging.Level;
import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.actions.wizard.NewActionJob;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
import org.eclipse.osee.ats.artifact.StateMachineArtifact;
import org.eclipse.osee.ats.artifact.TaskableStateMachineArtifact;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -29,6 +35,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
import org.eclipse.osee.framework.ui.skynet.cm.OseeCmEditor;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
/**
@@ -109,4 +116,39 @@ public class OseeAtsServiceImpl implements IOseeCmService {
}
return null;
}
+
+ @Override
+ public Artifact createPcr(String title, String description, String changeType, String priority, Date needByDate, Collection<String> productNames) {
+ try {
+ ChangeType cType = ChangeType.getChangeType(changeType);
+ if (cType == null) {
+ cType = ChangeType.Improvement;
+ }
+ PriorityType pType = PriorityType.getPriority(priority);
+ if (pType == null) {
+ pType = PriorityType.None;
+ }
+ Set<ActionableItemArtifact> aias = ActionableItemArtifact.getActionableItems(productNames);
+ if (aias.size() == 0) {
+ throw new OseeArgumentException("Can not resolve productNames to Actionable Items");
+ }
+ NewActionJob job = new NewActionJob(title, description, cType, pType, needByDate, false, aias, null);
+ job.schedule();
+ job.join();
+ return job.getActionArt();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public KeyedImage getImage(ImageType imageType) {
+ if (imageType == ImageType.Pcr) {
+ return AtsImage.TEAM_WORKFLOW;
+ } else if (imageType == ImageType.Task) {
+ return AtsImage.TASK;
+ }
+ return AtsImage.ACTION;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateGuid.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateGuid.java
index 58e95ea716..31a583b3e4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateGuid.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateGuid.java
@@ -27,7 +27,11 @@ public class GenerateGuid extends XNavigateItemAction {
public void run(TableLoadOption... tableLoadOptions) throws Exception {
XResultData resultData = new XResultData();
for (int x = 0; x < 20; x++) {
- resultData.log(GUID.create());
+ String guid = GUID.create();
+ while (guid.contains("+")) {
+ guid = GUID.create();
+ }
+ resultData.log(guid);
}
resultData.report("GUIDs");
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
index 2f6895d5a9..1eb5d623aa 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
@@ -13,6 +13,8 @@ package org.eclipse.osee.coverage.test;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
import java.util.Collection;
import junit.framework.Assert;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.merge.IMergeItem;
import org.eclipse.osee.coverage.merge.MergeImportManager;
import org.eclipse.osee.coverage.merge.MergeItemGroup;
@@ -226,7 +228,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -336,7 +338,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -445,7 +447,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -561,7 +563,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -676,7 +678,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -805,7 +807,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -959,7 +961,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -1109,7 +1111,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -1230,7 +1232,7 @@ public class CoveragePackageImportTest {
// Test Persist of CoveragePackage
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, commonBranch);
SkynetTransaction transaction = new SkynetTransaction(commonBranch, "Coverage Package Save");
- store.save(transaction);
+ store.save(transaction, getTestCoveragePackageEvent());
transaction.execute();
// Test Load of Coverage Package
@@ -1254,4 +1256,8 @@ public class CoveragePackageImportTest {
Assert.assertEquals(64, loadedCp.getCoverageItemsCovered(CoverageOptionManager.Not_Covered).size());
}
+
+ private CoveragePackageEvent getTestCoveragePackageEvent() {
+ return new CoveragePackageEvent(coveragePackage, CoverageEventType.Modified);
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
index e5ff504a06..5d610b47aa 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
@@ -14,6 +14,8 @@ import java.io.File;
import java.io.IOException;
import java.util.Collection;
import junit.framework.Assert;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.merge.MergeImportManager;
import org.eclipse.osee.coverage.merge.MergeManager;
@@ -203,7 +205,9 @@ public class VectorCastImportTest {
OseeCoverageStore store = OseeCoveragePackageStore.get(coveragePackage, BranchManager.getCommonBranch());
SkynetTransaction transaction =
new SkynetTransaction(BranchManager.getCommonBranch(), "Coverage Package Save");
- store.save(transaction);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent(coveragePackage, CoverageEventType.Modified);
+ store.save(transaction, coverageEvent);
transaction.execute();
// Test Load of Coverage Package
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemPersistTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemPersistTest.java
index 80abf9e19f..a957af6730 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemPersistTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemPersistTest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.coverage.test.model;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.model.CoverageItem;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
@@ -20,6 +22,7 @@ import org.eclipse.osee.coverage.test.util.CoverageTestUtil;
import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -94,9 +97,19 @@ public class CoverageItemPersistTest {
Artifact artifact = new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).getArtifact(true);
Assert.assertNotNull(artifact);
SkynetTransaction transaction = new SkynetTransaction(BranchManager.getCommonBranch(), "Save CoverageItem");
- new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).save(transaction);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent("Test CP", GUID.create(), CoverageEventType.Modified, GUID.create());
+ new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).save(transaction, coverageEvent);
transaction.execute();
+ // Not name/guid cause not attached to coverage package
+ Assert.assertNull(coverageEvent.getPackage().getGuid());
+ Assert.assertNull(coverageEvent.getPackage().getName());
+ Assert.assertNull(coverageEvent.getPackage().getEventType().equals(CoverageEventType.Modified));
+ Assert.assertEquals(10, coverageEvent.getCoverages().size());
+ Assert.assertEquals(CoverageEventType.Added,
+ coverageEvent.getCoverages().iterator().next().getEventType());
+
Assert.assertEquals(10, ci.getTestUnits().size());
}
@@ -119,7 +132,7 @@ public class CoverageItemPersistTest {
/**
* Test method for
- * {@link org.eclipse.osee.coverage.model.CoverageItem#delete(org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction, boolean)}
+ * {@link org.eclipse.osee.coverage.model.CoverageItem#delete(org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction, coverageEvent, boolean)}
* .
*/
@Test
@@ -127,11 +140,16 @@ public class CoverageItemPersistTest {
Artifact artifact = new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).getArtifact(false);
Assert.assertNotNull(artifact);
SkynetTransaction transaction = new SkynetTransaction(BranchManager.getCommonBranch(), "Save CoverageItem");
- new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).delete(transaction, false);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent("Test CP", GUID.create(), CoverageEventType.Deleted, GUID.create());
+ new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).delete(transaction, coverageEvent, false);
transaction.execute();
artifact = new OseeCoverageUnitStore(parentCu, BranchManager.getCommonBranch()).getArtifact(false);
Assert.assertNull(artifact);
Assert.assertEquals(0, CoverageTestUtil.getAllCoverageArtifacts().size());
+ Assert.assertEquals(10, coverageEvent.getCoverages().size());
+ Assert.assertEquals(CoverageEventType.Deleted,
+ coverageEvent.getCoverages().iterator().next().getEventType());
}
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CoverageTestNavigateViews.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CoverageTestNavigateViews.java
index 9e3218b739..98e897f4f8 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CoverageTestNavigateViews.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CoverageTestNavigateViews.java
@@ -45,9 +45,6 @@ public class CoverageTestNavigateViews implements ICoverageNavigateItem {
return items;
}
- // items.add(new CoverageImportTestNavigateItem(null, new CoverageImport1TestBlam()));
- // items.add(new CoverageImportTestNavigateItem(null, new CoverageImport2TestBlam()));
- // items.add(new CoverageImportTestNavigateItem(null, new CoverageImport3TestBlam()));
items.add(new CoveragePackage1(null));
items.add(new CoveragePackage1Import1(null));
items.add(new CoveragePackage1Import1B(null));
@@ -59,6 +56,7 @@ public class CoverageTestNavigateViews implements ICoverageNavigateItem {
items.add(new CoveragePackage1Import7(null));
items.add(new CoveragePackage1Import8(null));
items.add(new CoveragePackage1Import9(null));
+ items.add(new CreateWorkProductAction(null));
return items;
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CreateWorkProductAction.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CreateWorkProductAction.java
new file mode 100644
index 0000000000..7ecb5ee000
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/navigate/CreateWorkProductAction.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.coverage.test.navigate;
+
+import java.util.Arrays;
+import org.eclipse.osee.coverage.editor.CoverageEditor;
+import org.eclipse.osee.coverage.editor.CoverageEditorInput;
+import org.eclipse.osee.coverage.store.CoverageRelationTypes;
+import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
+import org.eclipse.osee.coverage.util.CoverageUtil;
+import org.eclipse.osee.coverage.util.dialog.CoveragePackageArtifactListDialog;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CreateWorkProductAction extends XNavigateItemAction {
+
+ public CreateWorkProductAction() {
+ super(null, "");
+ }
+
+ public CreateWorkProductAction(XNavigateItem parent) {
+ super(parent, "Create Work Product Action");
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws Exception {
+
+ IOseeCmService cmService = SkynetGuiPlugin.getInstance().getOseeCmService();
+ if (cmService == null) {
+ AWorkbench.popup("Can not acquire CM Service");
+ return;
+ }
+
+ if (!CoverageUtil.getBranchFromUser(false)) {
+ return;
+ }
+ Branch branch = CoverageUtil.getBranch();
+ CoveragePackageArtifactListDialog dialog =
+ new CoveragePackageArtifactListDialog("Open Coverage Package", "Select Coverage Package");
+ dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch));
+ if (dialog.open() == 0) {
+ Artifact coveragePackageArtifact = (Artifact) dialog.getResult()[0];
+ OseeCoveragePackageStore store = new OseeCoveragePackageStore(coveragePackageArtifact);
+
+ SkynetTransaction transaction = new SkynetTransaction(branch, getName());
+ Artifact actionArt =
+ cmService.createPcr("Reqts PCR 1001", "Do requirements for PCR 1001", "Improvement", "1", null,
+ Arrays.asList("SAW Requirements"));
+ actionArt.persist(transaction);
+ Artifact reqTeamArt = actionArt.getRelatedArtifact(CoverageRelationTypes.ActionToWorkflow_WorkFlow);
+ reqTeamArt.persist(transaction);
+
+ coveragePackageArtifact.addRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, reqTeamArt);
+ coveragePackageArtifact.persist(transaction);
+
+ actionArt =
+ cmService.createPcr("Code PCR 1001", "Do code for PCR 33201", "Improvement", "1", null,
+ Arrays.asList("SAW Code"));
+ actionArt.persist(transaction);
+ Artifact codeTeamArt = actionArt.getRelatedArtifact(CoverageRelationTypes.ActionToWorkflow_WorkFlow);
+ codeTeamArt.persist(transaction);
+
+ coveragePackageArtifact.addRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, codeTeamArt);
+ coveragePackageArtifact.persist(transaction);
+
+ actionArt =
+ cmService.createPcr("Test PCR 1001", "Do test for PCR 33201", "Improvement", "1", null,
+ Arrays.asList("SAW Test"));
+ actionArt.persist(transaction);
+ Artifact testTeamArt = actionArt.getRelatedArtifact(CoverageRelationTypes.ActionToWorkflow_WorkFlow);
+ testTeamArt.persist(transaction);
+
+ coveragePackageArtifact.addRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, testTeamArt);
+ coveragePackageArtifact.persist(transaction);
+
+ transaction.execute();
+
+ CoverageEditor.open(new CoverageEditorInput(coveragePackageArtifact.getName(), coveragePackageArtifact, null,
+ false));
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/jaxb/messages.xsd b/plugins/org.eclipse.osee.coverage/jaxb/messages.xsd
index 01d9d2d273..dfccd03c02 100644
--- a/plugins/org.eclipse.osee.coverage/jaxb/messages.xsd
+++ b/plugins/org.eclipse.osee.coverage/jaxb/messages.xsd
@@ -3,19 +3,21 @@
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
jxb:version="2.0">
-<xsd:element name="CoveragePackageSave" type="CoveragePackageSave"/>
+<xsd:element name="CoveragePackageEvent1" type="CoveragePackageEvent1"/>
-<xsd:complexType name="CoveragePackageSave">
+<xsd:complexType name="CoveragePackageEvent1">
<xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="guids" type="xsd:string"/>
- <xsd:element name="sourceObject" type="xsd:string"/>
+ <xsd:element name="package" type="CoverageChange1"/>
+ <xsd:element name="coverages" type="CoverageChange1" maxOccurs="unbounded" minOccurs="1"/>
<xsd:element name="sessionId" type="xsd:string"/>
- <xsd:element name="machineName" type="xsd:string"/>
- <xsd:element name="userId" type="xsd:string"/>
- <xsd:element name="machineIp" type="xsd:string"/>
- <xsd:element name="clientVersion" type="xsd:string"/>
- <xsd:element name="port" type="xsd:string"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="CoverageChange1">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="guid" type="xsd:string"/>
+ <xsd:element name="modTypeGuid" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java
new file mode 100644
index 0000000000..d2478c2bc9
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CoverageChange1 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CoverageChange1">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="guid" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="modTypeGuid" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CoverageChange1", propOrder = {
+ "name",
+ "guid",
+ "modTypeGuid"
+})
+public class CoverageChange1 {
+
+ @XmlElement(required = true)
+ protected String name;
+ @XmlElement(required = true)
+ protected String guid;
+ @XmlElement(required = true)
+ protected String modTypeGuid;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the guid property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getGuid() {
+ return guid;
+ }
+
+ /**
+ * Sets the value of the guid property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setGuid(String value) {
+ this.guid = value;
+ }
+
+ /**
+ * Gets the value of the modTypeGuid property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getModTypeGuid() {
+ return modTypeGuid;
+ }
+
+ /**
+ * Sets the value of the modTypeGuid property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setModTypeGuid(String value) {
+ this.modTypeGuid = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java
new file mode 100644
index 0000000000..d25ee599ce
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java
@@ -0,0 +1,132 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CoveragePackageEvent1 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CoveragePackageEvent1">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="package" type="{}CoverageChange1"/>
+ * &lt;element name="coverages" type="{}CoverageChange1" maxOccurs="unbounded"/>
+ * &lt;element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CoveragePackageEvent1", propOrder = {
+ "_package",
+ "coverages",
+ "sessionId"
+})
+public class CoveragePackageEvent1 {
+
+ @XmlElement(name = "package", required = true)
+ protected CoverageChange1 _package;
+ @XmlElement(required = true)
+ protected List<CoverageChange1> coverages;
+ @XmlElement(required = true)
+ protected String sessionId;
+
+ /**
+ * Gets the value of the package property.
+ *
+ * @return
+ * possible object is
+ * {@link CoverageChange1 }
+ *
+ */
+ public CoverageChange1 getPackage() {
+ return _package;
+ }
+
+ /**
+ * Sets the value of the package property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CoverageChange1 }
+ *
+ */
+ public void setPackage(CoverageChange1 value) {
+ this._package = value;
+ }
+
+ /**
+ * Gets the value of the coverages property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the coverages property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getCoverages().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link CoverageChange1 }
+ *
+ *
+ */
+ public List<CoverageChange1> getCoverages() {
+ if (coverages == null) {
+ coverages = new ArrayList<CoverageChange1>();
+ }
+ return this.coverages;
+ }
+
+ /**
+ * Gets the value of the sessionId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ /**
+ * Sets the value of the sessionId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSessionId(String value) {
+ this.sessionId = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageSave.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageSave.java
deleted file mode 100644
index 793ab84534..0000000000
--- a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageSave.java
+++ /dev/null
@@ -1,235 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.04.08 at 07:37:57 AM MST
-//
-
-package org.eclipse.osee.coverage.msgs;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * <p>
- * Java class for CoveragePackageSave complex type.
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="CoveragePackageSave">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="guids" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="sourceObject" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="machineName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="userId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="machineIp" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="clientVersion" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="port" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "CoveragePackageSave", propOrder = {
- "name",
- "guids",
- "sourceObject",
- "sessionId",
- "machineName",
- "userId",
- "machineIp",
- "clientVersion",
- "port"})
-public class CoveragePackageSave {
-
- @XmlElement(required = true)
- protected String name;
- @XmlElement(required = true)
- protected String guids;
- @XmlElement(required = true)
- protected String sourceObject;
- @XmlElement(required = true)
- protected String sessionId;
- @XmlElement(required = true)
- protected String machineName;
- @XmlElement(required = true)
- protected String userId;
- @XmlElement(required = true)
- protected String machineIp;
- @XmlElement(required = true)
- protected String clientVersion;
- @XmlElement(required = true)
- protected String port;
-
- /**
- * Gets the value of the name property.
- *
- * @return possible object is {@link String }
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value allowed object is {@link String }
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the guids property.
- *
- * @return possible object is {@link String }
- */
- public String getGuids() {
- return guids;
- }
-
- /**
- * Sets the value of the guids property.
- *
- * @param value allowed object is {@link String }
- */
- public void setGuids(String value) {
- this.guids = value;
- }
-
- /**
- * Gets the value of the sourceObject property.
- *
- * @return possible object is {@link String }
- */
- public String getSourceObject() {
- return sourceObject;
- }
-
- /**
- * Sets the value of the sourceObject property.
- *
- * @param value allowed object is {@link String }
- */
- public void setSourceObject(String value) {
- this.sourceObject = value;
- }
-
- /**
- * Gets the value of the sessionId property.
- *
- * @return possible object is {@link String }
- */
- public String getSessionId() {
- return sessionId;
- }
-
- /**
- * Sets the value of the sessionId property.
- *
- * @param value allowed object is {@link String }
- */
- public void setSessionId(String value) {
- this.sessionId = value;
- }
-
- /**
- * Gets the value of the machineName property.
- *
- * @return possible object is {@link String }
- */
- public String getMachineName() {
- return machineName;
- }
-
- /**
- * Sets the value of the machineName property.
- *
- * @param value allowed object is {@link String }
- */
- public void setMachineName(String value) {
- this.machineName = value;
- }
-
- /**
- * Gets the value of the userId property.
- *
- * @return possible object is {@link String }
- */
- public String getUserId() {
- return userId;
- }
-
- /**
- * Sets the value of the userId property.
- *
- * @param value allowed object is {@link String }
- */
- public void setUserId(String value) {
- this.userId = value;
- }
-
- /**
- * Gets the value of the machineIp property.
- *
- * @return possible object is {@link String }
- */
- public String getMachineIp() {
- return machineIp;
- }
-
- /**
- * Sets the value of the machineIp property.
- *
- * @param value allowed object is {@link String }
- */
- public void setMachineIp(String value) {
- this.machineIp = value;
- }
-
- /**
- * Gets the value of the clientVersion property.
- *
- * @return possible object is {@link String }
- */
- public String getClientVersion() {
- return clientVersion;
- }
-
- /**
- * Sets the value of the clientVersion property.
- *
- * @param value allowed object is {@link String }
- */
- public void setClientVersion(String value) {
- this.clientVersion = value;
- }
-
- /**
- * Gets the value of the port property.
- *
- * @return possible object is {@link String }
- */
- public String getPort() {
- return port;
- }
-
- /**
- * Sets the value of the port property.
- *
- * @param value allowed object is {@link String }
- */
- public void setPort(String value) {
- this.port = value;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java
new file mode 100644
index 0000000000..755dc320e9
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java
@@ -0,0 +1,68 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.eclipse.osee.coverage.msgs package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _CoveragePackageEvent1_QNAME = new QName("", "CoveragePackageEvent1");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.eclipse.osee.coverage.msgs
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link CoveragePackageEvent1 }
+ *
+ */
+ public CoveragePackageEvent1 createCoveragePackageEvent1() {
+ return new CoveragePackageEvent1();
+ }
+
+ /**
+ * Create an instance of {@link CoverageChange1 }
+ *
+ */
+ public CoverageChange1 createCoverageChange1() {
+ return new CoverageChange1();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CoveragePackageEvent1 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "CoveragePackageEvent1")
+ public JAXBElement<CoveragePackageEvent1> createCoveragePackageEvent1(CoveragePackageEvent1 value) {
+ return new JAXBElement<CoveragePackageEvent1>(_CoveragePackageEvent1_QNAME, CoveragePackageEvent1 .class, null, value);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
index f5779c0211..f57a1cd096 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
@@ -19,17 +19,21 @@ import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.coverage.model.IWorkProductRelatable;
import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.coverage.model.WorkProductTask;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.coverage.util.dialog.WorkProductListDialog;
+import org.eclipse.osee.coverage.util.dialog.WorkProductTaskFilteredTreeEntryDialog;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
-import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.ImageManager;
/**
@@ -42,7 +46,7 @@ public class CreateWorkProductTaskAction extends Action {
private final CoverageXViewer coverageXViewer;
public CreateWorkProductTaskAction(CoverageXViewer coverageXViewer, ISelectedCoverageEditorItem selectedCoverageEditorItem, ISaveable saveable) {
- super("Create Work Product Task");
+ super("Create/Update Work Product Task");
this.coverageXViewer = coverageXViewer;
this.selectedCoverageEditorItem = selectedCoverageEditorItem;
this.saveable = saveable;
@@ -81,24 +85,35 @@ public class CreateWorkProductTaskAction extends Action {
return;
}
- WorkProductListDialog dialog = new WorkProductListDialog(getText(), "Select Work Product to add task");
+ WorkProductListDialog dialog = new WorkProductListDialog(getText(), "Select Work Product");
dialog.setInput(coverageXViewer.getWorkProductTaskProvider().getWorkProductRelatedActions());
if (dialog.open() != 0) {
return;
}
WorkProductAction action = (WorkProductAction) dialog.getResult()[0];
- EntryDialog eDialog = new EntryDialog(getText(), "Enter Task Title");
- if (eDialog.open() != 0) {
- return;
- }
- String taskTitle = eDialog.getEntry();
- Artifact newTaskArt = cm.createWorkTask(taskTitle, action.getGuid());
- if (newTaskArt == null) {
- AWorkbench.popup("Unable to create new Work Product task.");
+
+ WorkProductTaskFilteredTreeEntryDialog taskDialog =
+ new WorkProductTaskFilteredTreeEntryDialog(getText(), "Select existing task or enter new task name",
+ "New Task Name");
+ taskDialog.setInput(action.getTasks());
+ if (taskDialog.open() != 0) {
return;
}
try {
+ String taskTitle = taskDialog.getEntryValue();
+ Artifact newTaskArt = null;
+ if (Strings.isValid(taskTitle)) {
+ newTaskArt = cm.createWorkTask(taskTitle, action.getGuid());
+ } else {
+ WorkProductTask task = taskDialog.getSelection();
+ newTaskArt = ArtifactQuery.getArtifactFromId(task.getGuid(), BranchManager.getCommonBranch());
+ }
+ if (newTaskArt == null) {
+ AWorkbench.popup("Unable to create new Work Product task.");
+ return;
+ }
+
for (ICoverage coverage : relateableCoverageItems) {
if (coverage instanceof IWorkProductRelatable) {
((IWorkProductRelatable) coverage).setWorkProductGuid(newTaskArt.getGuid());
@@ -106,6 +121,15 @@ public class CreateWorkProductTaskAction extends Action {
}
newTaskArt.persist(getText());
saveable.save(relateableCoverageItems);
+
+ coverageXViewer.getWorkProductTaskProvider().reload();
+ for (ICoverage coverage : relateableCoverageItems) {
+ if (coverage instanceof IWorkProductRelatable) {
+ ((IWorkProductRelatable) coverage).setWorkProductTask(coverageXViewer.getWorkProductTaskProvider().getWorkProductTask(
+ newTaskArt.getGuid()));
+ coverageXViewer.update(coverage);
+ }
+ }
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoverUnitAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoverUnitAction.java
index 3ba62f1fbb..ec2de16125 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoverUnitAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoverUnitAction.java
@@ -15,11 +15,16 @@ import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.coverage.event.CoverageEventManager;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.coverage.model.ICoverageUnitProvider;
import org.eclipse.osee.coverage.store.OseeCoverageUnitStore;
+import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -72,16 +77,21 @@ public class DeleteCoverUnitAction extends Action {
try {
SkynetTransaction transaction =
new SkynetTransaction(saveable.getBranch(), "Coverage - Delete Coverage Unit");
+ ICoverage coverage = selectedCoverageEditorItem.getSelectedCoverageEditorItems().iterator().next();
+ CoveragePackage coveragePackage = (CoveragePackage) CoverageUtil.getParentCoveragePackageBase(coverage);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent(coveragePackage, CoverageEventType.Modified);
List<ICoverage> deleteItems = new ArrayList<ICoverage>();
for (ICoverage coverageItem : selectedCoverageEditorItem.getSelectedCoverageEditorItems()) {
if (coverageItem.getParent() instanceof ICoverageUnitProvider) {
((ICoverageUnitProvider) coverageItem.getParent()).removeCoverageUnit((CoverageUnit) coverageItem);
deleteItems.add(coverageItem);
new OseeCoverageUnitStore((CoverageUnit) coverageItem, saveable.getBranch()).delete(transaction,
- false);
+ coverageEvent, false);
}
}
transaction.execute();
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
for (ICoverage coverageItem : deleteItems) {
refreshable.remove(coverageItem);
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoveragePackageAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoveragePackageAction.java
index 74ea9e0fde..ec674a339d 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoveragePackageAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/DeleteCoveragePackageAction.java
@@ -12,6 +12,9 @@ package org.eclipse.osee.coverage.action;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.coverage.event.CoverageEventManager;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
@@ -23,6 +26,7 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.CheckBoxDialog;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -55,6 +59,10 @@ public class DeleteCoveragePackageAction extends Action {
new CoveragePackageArtifactListDialog("Delete Package", "Select Package");
dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch));
if (dialog.open() == 0) {
+ if (dialog.getResult().length == 0) {
+ AWorkbench.popup("Must select coverage package.");
+ return;
+ }
Artifact coveragePackageArtifact = (Artifact) dialog.getResult()[0];
CoveragePackage coveragePackage = OseeCoveragePackageStore.get(coveragePackageArtifact);
CheckBoxDialog cDialog =
@@ -69,10 +77,13 @@ public class DeleteCoveragePackageAction extends Action {
if (!purge) {
transaction = new SkynetTransaction(branch, "Delete Coverage Package");
}
- OseeCoveragePackageStore.get(coveragePackage, branch).delete(transaction, purge);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent(coveragePackage, CoverageEventType.Deleted);
+ OseeCoveragePackageStore.get(coveragePackage, branch).delete(transaction, coverageEvent, purge);
if (!purge) {
transaction.execute();
}
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
}
}
} catch (OseeCoreException ex) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
index effa3f5e4b..eda8e2bcb1 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
@@ -14,6 +14,9 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.coverage.editor.CoverageEditor;
import org.eclipse.osee.coverage.editor.CoverageEditorInput;
+import org.eclipse.osee.coverage.event.CoverageEventManager;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
@@ -59,8 +62,11 @@ public class NewCoveragePackageAction extends Action {
new CoveragePackage(dialog.getEntry(), CoverageOptionManagerDefault.instance(),
new DbWorkProductTaskProvider(branch));
SkynetTransaction transaction = new SkynetTransaction(branch, "Add Coverage Package");
- OseeCoveragePackageStore.get(coveragePackage, branch).save(transaction);
+ CoveragePackageEvent coverageEvent =
+ new CoveragePackageEvent(coveragePackage, CoverageEventType.Added);
+ OseeCoveragePackageStore.get(coveragePackage, branch).save(transaction, coverageEvent);
transaction.execute();
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
CoverageEditor.open(new CoverageEditorInput(dialog.getEntry(), OseeCoveragePackageStore.get(
coveragePackage, branch).getArtifact(false), coveragePackage, false));
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenCoveragePackageAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenCoveragePackageAction.java
index 4b27f839ed..ebc185f063 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenCoveragePackageAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenCoveragePackageAction.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
@@ -54,6 +55,10 @@ public class OpenCoveragePackageAction extends Action {
new CoveragePackageArtifactListDialog("Open Coverage Package", "Select Coverage Package");
dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch));
if (dialog.open() == 0) {
+ if (dialog.getResult().length == 0) {
+ AWorkbench.popup("Must select coverage package.");
+ return;
+ }
Artifact coveragePackageArtifact = (Artifact) dialog.getResult()[0];
CoverageEditor.open(new CoverageEditorInput(coveragePackageArtifact.getName(), coveragePackageArtifact,
null, false));
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
index 5b6d59748c..021f2d5a2c 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
@@ -13,7 +13,6 @@ import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.osee.coverage.action.IRefreshable;
import org.eclipse.osee.coverage.action.OpenMultipleWorkProductsAction;
import org.eclipse.osee.coverage.action.RemoveRelatedWorkProductAction;
import org.eclipse.osee.coverage.internal.Activator;
@@ -25,6 +24,7 @@ import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.coverage.util.ISaveable;
+import org.eclipse.osee.coverage.util.WorkProductActionLabelProvider;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -35,7 +35,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
@@ -58,7 +57,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class CoverageEditorWorkProductTab extends FormPage implements ISaveable, IRefreshable {
+public class CoverageEditorWorkProductTab extends FormPage implements ISaveable {
private ScrolledForm scrolledForm;
private final CoveragePackage coveragePackage;
@@ -158,7 +157,7 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
private XListViewer createActionListViewer(Composite parent) {
actionListViewer = new XListViewer("Drag in Actions related to changing work products");
actionListViewer.setContentProvider(new ArrayContentProvider());
- actionListViewer.setLabelProvider(new StringLabelProvider());
+ actionListViewer.setLabelProvider(new WorkProductActionLabelProvider());
actionListViewer.createWidgets(parent, 2);
coverageEditor.getToolkit().adapt(actionListViewer.getTable());
coverageEditor.getToolkit().adapt(actionListViewer.getLabelWidget(), true, true);
@@ -215,16 +214,4 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
return coveragePackage;
}
- @Override
- public void refresh(Object element) {
- }
-
- @Override
- public void update(Object element) {
- }
-
- @Override
- public void remove(Object element) {
- }
-
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
index bb550a2429..debc6b1f8f 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/params/CoverageParameters.java
@@ -120,7 +120,7 @@ public class CoverageParameters {
* coverage isn't CoverageUnit OR<br>
* CoverageUnit assignee equals search assignee
*/
- public boolean isAssigneeMatch(ICoverage coverage) throws OseeCoreException {
+ public boolean isAssigneeMatch(ICoverage coverage) {
if (assignee == null || !(coverage instanceof CoverageUnit)) {
return true;
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
index 9f1f45e08f..4f2332e116 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
@@ -103,7 +103,7 @@ public class CoverageLabelProvider extends XViewerLabelProvider {
return coverage.getNamespace();
}
if (xCol.equals(CoverageXViewerFactory.Work_Product_Task)) {
- return coverage.getWorkProductTask();
+ return coverage.getWorkProductTaskStr();
}
if (xCol.equals(CoverageXViewerFactory.Guid)) {
return coverage.getGuid();
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
index 302d2be533..2ad22df058 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
@@ -243,6 +243,8 @@ public class CoverageXViewer extends XViewer implements ISelectedCoverageEditorI
editMethodAction.run();
} else if (xCol.equals(CoverageXViewerFactory.Coverage_Rationale)) {
editRationaleAction.run();
+ } else if (xCol.equals(CoverageXViewerFactory.Work_Product_Task)) {
+ createWorkProductTaskAction.run();
} else if (xCol.equals(CoverageXViewerFactory.Name)) {
viewSourceAction.run();
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewerFactory.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewerFactory.java
index 94f7e8bf1f..c7c343533c 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewerFactory.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewerFactory.java
@@ -37,7 +37,7 @@ public class CoverageXViewerFactory extends SkynetXViewerFactory {
public static XViewerColumn Coverage_Method = new XViewerColumn(NAMESPACE + ".coverateMethod", "Coverage Method",
100, SWT.LEFT, true, SortDataType.String, false, "");
public static XViewerColumn Work_Product_Task = new XViewerColumn(NAMESPACE + ".workProductTask",
- "Work Product Task", 100, SWT.LEFT, false, SortDataType.String, false, "");
+ "Work Product Task", 100, SWT.LEFT, true, SortDataType.String, false, "");
public static XViewerColumn Coverage_Rationale = new XViewerColumn(NAMESPACE + ".coverageRationale",
"Coverage Rationale", 100, SWT.LEFT, true, SortDataType.String, false, "");
public static XViewerColumn Coverage_Test_Units = new XViewerColumn(NAMESPACE + ".coverageTestUnits",
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java
new file mode 100644
index 0000000000..424f073a4d
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java
@@ -0,0 +1,53 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:02:40 PM MST
+//
+
+package org.eclipse.osee.coverage.event;
+
+import org.eclipse.osee.coverage.model.ICoverage;
+
+public class CoverageChange {
+
+ protected String name;
+ protected String guid;
+ protected CoverageEventType coverageEventType;
+
+ public CoverageChange(ICoverage coverage, CoverageEventType coverageEventType) {
+ this(coverage.getName(), coverage.getGuid(), coverageEventType);
+ }
+
+ public CoverageChange(String name, String guid, CoverageEventType coverageEventType) {
+ super();
+ this.name = name;
+ this.guid = guid;
+ this.coverageEventType = coverageEventType;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public void setGuid(String value) {
+ this.guid = value;
+ }
+
+ public CoverageEventType getEventType() {
+ return coverageEventType;
+ }
+
+ public void setEventType(CoverageEventType coverageEventType) {
+ this.coverageEventType = coverageEventType;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
index fb0f25f836..ebde093cff 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
@@ -14,11 +14,15 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import org.eclipse.osee.coverage.editor.CoverageEditor;
import org.eclipse.osee.coverage.internal.Activator;
-import org.eclipse.osee.coverage.msgs.CoveragePackageSave;
+import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.msgs.CoverageChange1;
+import org.eclipse.osee.coverage.msgs.CoveragePackageEvent1;
import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.messaging.ConnectionNode;
@@ -88,20 +92,23 @@ public class CoverageEventManager implements IArtifactEventListener, OseeMessagi
}
private void stopListeningForRemoteCoverageEvents() {
- oseeMessagingTracker.close();
+ if (oseeMessagingTracker != null) {
+ oseeMessagingTracker.close();
+ }
oseeMessagingTracker = null;
}
public void addingRemoteEventService(ConnectionNode connectionNode) {
this.connectionNode = connectionNode;
- connectionNode.subscribe(CoverageMessages.CoveragePackageSave, new CoverageMessageListener(), instance);
+ connectionNode.subscribe(CoverageMessages.CoveragePackageEvent1, new CoverageMessageListener(), instance);
}
- public void sendRemoteEvent(CoveragePackageSave packSave) {
- System.out.println(String.format("Sending CoveragePackageSave [%s]", packSave.getName()));
+ public void sendRemoteEvent(CoveragePackageEvent coverageEvent) {
+ System.out.println(String.format("Sending CoveragePackageEvent [%s]", coverageEvent.getPackage().getName()));
if (connectionNode != null) {
try {
- connectionNode.send(CoverageMessages.CoveragePackageSave, packSave, instance);
+ CoveragePackageEvent1 event1 = getCoveragePackageEvent(coverageEvent);
+ connectionNode.send(CoverageMessages.CoveragePackageEvent1, event1, instance);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -124,16 +131,17 @@ public class CoverageEventManager implements IArtifactEventListener, OseeMessagi
@Override
public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
- for (CoverageEditor editor : editors) {
+ for (CoverageEditor editor : new CopyOnWriteArrayList<CoverageEditor>(editors)) {
try {
for (EventBasicGuidArtifact eventArt : artifactEvent.getArtifacts()) {
if (editor.getCoverageEditorInput().getCoveragePackageArtifact() == null) {
return;
}
- if (editor.getCoverageEditorInput().getCoveragePackageArtifact().getBranch().getGuid() != eventArt.getBranchGuid()) {
+ if (!editor.getCoverageEditorInput().getCoveragePackageArtifact().getBranch().getGuid().equals(
+ eventArt.getBranchGuid())) {
return;
}
- if (eventArt.getModType() == EventModType.Deleted || eventArt.getModType() == EventModType.ChangeType || eventArt.getModType() == EventModType.Purged) {
+ if (eventArt.is(EventModType.Deleted, EventModType.ChangeType, EventModType.Purged)) {
if (eventArt.getGuid().equals(editor.getCoverageEditorInput().getCoveragePackageArtifact().getGuid())) {
unregister(editor);
editor.closeEditor();
@@ -159,7 +167,7 @@ public class CoverageEventManager implements IArtifactEventListener, OseeMessagi
public class CoverageMessageListener extends OseeMessagingListener {
public CoverageMessageListener() {
- super(CoveragePackageSave.class);
+ super(CoveragePackageEvent1.class);
}
@Override
@@ -167,16 +175,98 @@ public class CoverageEventManager implements IArtifactEventListener, OseeMessagi
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
- CoveragePackageSave packSave = (CoveragePackageSave) message;
- System.out.println(String.format("Receiving CoveragePackageSave [%s]", packSave.getName()));
+ CoveragePackageEvent1 coverageEvent1 = (CoveragePackageEvent1) message;
+ try {
+ // Don't process this event if sent from this session
+ if (coverageEvent1.getSessionId().equals(ClientSessionManager.getSessionId())) {
+ return;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ CoveragePackageEvent coverageEvent = getCoveragePackageEvent(coverageEvent1);
+ if (coverageEvent != null) {
+ processCoveragePackageEvent(coverageEvent);
+ }
}
});
}
}
+ private void processCoveragePackageEvent(CoveragePackageEvent coverageEvent) {
+ if (coverageEvent != null) {
+ System.out.println(String.format("Receiving coverageEvent [%s]", coverageEvent.getPackage().getName()));
+ CoverageChange packageCoverage = coverageEvent.getPackage();
+ CoverageEventType packageModType = packageCoverage.getEventType();
+ for (CoverageEditor editor : new CopyOnWriteArrayList<CoverageEditor>(editors)) {
+ try {
+ if (packageModType == CoverageEventType.Deleted) {
+ unregister(editor);
+ editor.closeEditor();
+ } else if (packageModType == CoverageEventType.Modified) {
+ CoveragePackage coveragePackage = (CoveragePackage) editor.getCoveragePackageBase();
+ handleCoverageEditorSaveEvent(editor, coveragePackage, coverageEvent);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ }
+
+ private void handleCoverageEditorSaveEvent(CoverageEditor editor, CoveragePackage coveragePackage, CoveragePackageEvent coverageEvent) {
+ System.out.println("handle coverage save event => " + coverageEvent);
+ }
+
@Override
public List<? extends IEventFilter> getEventFilters() {
return Arrays.asList(createArtifactTypeEventFilter());
}
+ private CoveragePackageEvent1 getCoveragePackageEvent(CoveragePackageEvent event) {
+ CoveragePackageEvent1 event1 = new CoveragePackageEvent1();
+ event1.setSessionId(event.getSessionId());
+ CoverageChange1 change1 = new CoverageChange1();
+ change1.setGuid(event.getPackage().getGuid());
+ change1.setName(event.getPackage().getName());
+ change1.setModTypeGuid(event.getPackage().getEventType().getGuid());
+ event1.setPackage(change1);
+ for (CoverageChange change : event.getCoverages()) {
+ CoverageChange1 childChange1 = new CoverageChange1();
+ childChange1.setGuid(change.getGuid());
+ childChange1.setName(change.getName());
+ childChange1.setModTypeGuid(change.getEventType().getGuid());
+ }
+ return event1;
+ }
+
+ private CoveragePackageEvent getCoveragePackageEvent(CoveragePackageEvent1 coveragePackageEvent1) {
+ try {
+ CoverageEventType packageEventType =
+ CoverageEventType.getType(coveragePackageEvent1.getPackage().getModTypeGuid());
+ if (packageEventType != null) {
+ CoveragePackageEvent event =
+ new CoveragePackageEvent(coveragePackageEvent1.getPackage().getName(),
+ coveragePackageEvent1.getPackage().getGuid(), packageEventType, coveragePackageEvent1.getSessionId());
+ event.setSessionId(coveragePackageEvent1.getSessionId());
+ for (CoverageChange1 change : coveragePackageEvent1.getCoverages()) {
+ CoverageEventType eventType = CoverageEventType.getType(change.getGuid());
+ if (eventType != null) {
+ event.getCoverages().add(new CoverageChange(change.getName(), change.getGuid(), eventType));
+ } else {
+ OseeLog.log(Activator.class, Level.INFO,
+ "Unhandled coverage event type => " + coveragePackageEvent1.getPackage().getModTypeGuid());
+ }
+ }
+ return event;
+ } else {
+ OseeLog.log(Activator.class, Level.INFO,
+ "Unhandled package coverage event type => " + coveragePackageEvent1.getPackage().getModTypeGuid());
+ }
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventType.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventType.java
new file mode 100644
index 0000000000..ac9c0061d6
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventType.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.coverage.event;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum CoverageEventType {
+
+ Deleted("ABcgW44X_jiwtDxrfAgA"),
+ Added("ABcgW5K27j1dQf8cC5gA"),
+ Modified("ABcgW5NCnS8CxqjhS9QA");
+
+ private final String guid;
+
+ private CoverageEventType(String guid) {
+ this.guid = guid;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public static CoverageEventType getType(String guid) {
+ for (CoverageEventType type : values()) {
+ if (type.guid.equals(guid)) {
+ return type;
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageMessages.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageMessages.java
index 3cd82de9cc..9a00e82721 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageMessages.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageMessages.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.coverage.event;
import org.eclipse.osee.framework.messaging.MessageID;
public enum CoverageMessages implements MessageID {
- CoveragePackageSave(true, "Aylfa1rRxx6NQf4MfNwA", "topic:org.eclipse.osee.coverage.msgs.CoveragePackageSave", org.eclipse.osee.coverage.msgs.CoveragePackageSave.class, false);
+ CoveragePackageEvent1(true, "Aylfa1rRxx6NQf4MfNwA", "topic:org.eclipse.osee.coverage.msgs.coverageEvent", org.eclipse.osee.coverage.msgs.CoveragePackageEvent1.class, false);
private String name;
private Class<?> clazz;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java
new file mode 100644
index 0000000000..ec3915e209
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java
@@ -0,0 +1,62 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:02:40 PM MST
+//
+
+package org.eclipse.osee.coverage.event;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+public class CoveragePackageEvent {
+
+ protected CoverageChange _package;
+ protected List<CoverageChange> coverages;
+ protected String sessionId;
+
+ public CoveragePackageEvent(String coveragePackageName, String coveragePackageGuid, CoverageEventType coverageEventType, String sessionId) {
+ _package = new CoverageChange(coveragePackageName, coveragePackageGuid, coverageEventType);
+ }
+
+ public CoveragePackageEvent(CoveragePackage coveragePackage, CoverageEventType coverageEventType) {
+ try {
+ this.sessionId = ClientSessionManager.getSessionId();
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, "Can't get sessionId", ex);
+ this.sessionId = GUID.create();
+ }
+ _package = new CoverageChange(coveragePackage, coverageEventType);
+ }
+
+ public CoverageChange getPackage() {
+ return _package;
+ }
+
+ public void setPackage(CoverageChange value) {
+ this._package = value;
+ }
+
+ public List<CoverageChange> getCoverages() {
+ if (coverages == null) {
+ coverages = new ArrayList<CoverageChange>();
+ }
+ return this.coverages;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(String value) {
+ this.sessionId = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
index 512dee5f41..792524198a 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
@@ -186,7 +186,7 @@ public class MergeItem extends MergeItemBase {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
index 3b88eede60..f9848e6060 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
@@ -154,7 +154,7 @@ public class MergeItemGroup extends MergeItemBase {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
index 1e41e63a45..589502ad15 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
@@ -124,7 +124,7 @@ public class CoverageImport extends CoveragePackageBase {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
index 7edd631a0d..66fd6c61fe 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
@@ -34,6 +34,7 @@ public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProdu
String rationale;
String orderNumber;
String workProductGuid;
+ WorkProductTask workProductTask;
private final CoverageUnit coverageUnit;
private static String PROPERTY_STORE_ID = "coverage.item";
@@ -82,6 +83,7 @@ public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProdu
coverageitem.setRationale(rationale);
coverageitem.setTestUnitProvider(testUnitProvider);
coverageitem.setWorkProductGuid(workProductGuid);
+ coverageitem.setWorkProductTask(workProductTask);
return coverageitem;
}
@@ -303,7 +305,10 @@ public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProdu
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
+ if (getWorkProductTask() != null) {
+ return getWorkProductTask().toString();
+ }
if (Strings.isValid(workProductGuid)) {
return workProductGuid;
}
@@ -320,4 +325,14 @@ public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProdu
this.workProductGuid = workProductGuid;
}
+ @Override
+ public WorkProductTask getWorkProductTask() {
+ return workProductTask;
+ }
+
+ @Override
+ public void setWorkProductTask(WorkProductTask workProductTask) {
+ this.workProductTask = workProductTask;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
index 7335a4d018..d7d9f4f913 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
@@ -74,7 +74,7 @@ public class CoveragePackage extends CoveragePackageBase {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageTestUnit.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageTestUnit.java
index 720a01adf1..86c1103986 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageTestUnit.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageTestUnit.java
@@ -115,7 +115,7 @@ public class CoverageTestUnit extends NamedIdentity implements ICoverage {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
index efe85ade68..9a0bf07e4e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
@@ -40,6 +40,7 @@ public class CoverageUnit extends NamedIdentity implements IWorkProductRelatable
String location;
String orderNumber = "";
String workProductGuid;
+ WorkProductTask workProductTask;
final List<CoverageUnit> coverageUnits = new ArrayList<CoverageUnit>();
ICoverage parent;
ICoverageUnitFileContentsProvider fileContentsProvider;
@@ -357,7 +358,10 @@ public class CoverageUnit extends NamedIdentity implements IWorkProductRelatable
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
+ if (getWorkProductTask() != null) {
+ return getWorkProductTask().toString();
+ }
if (Strings.isValid(workProductGuid)) {
return workProductGuid;
}
@@ -374,4 +378,14 @@ public class CoverageUnit extends NamedIdentity implements IWorkProductRelatable
this.workProductGuid = workProductGuid;
}
+ @Override
+ public WorkProductTask getWorkProductTask() {
+ return workProductTask;
+ }
+
+ @Override
+ public void setWorkProductTask(WorkProductTask workProductTask) {
+ this.workProductTask = workProductTask;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/ICoverage.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/ICoverage.java
index 36f381faac..882eccfff9 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/ICoverage.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/ICoverage.java
@@ -54,6 +54,6 @@ public interface ICoverage extends Named, Identity {
public String getOrderNumber();
- public String getWorkProductTask();
+ public String getWorkProductTaskStr();
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java
index 4ac03170bc..a006bf6728 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java
@@ -10,4 +10,9 @@ public interface IWorkProductRelatable {
public String getWorkProductGuid();
public void setWorkProductGuid(String workProductGuid);
+
+ public WorkProductTask getWorkProductTask();
+
+ public void setWorkProductTask(WorkProductTask workProductTask);
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/MessageCoverageItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/MessageCoverageItem.java
index 16e45d5862..ee64c53841 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/MessageCoverageItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/MessageCoverageItem.java
@@ -107,7 +107,7 @@ public class MessageCoverageItem extends NamedIdentity implements ICoverage {
}
@Override
- public String getWorkProductTask() {
+ public String getWorkProductTaskStr() {
return "";
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java
index 7eddce81c5..c7d6469723 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java
@@ -53,6 +53,11 @@ public class WorkProductTask {
}
@Override
+ public String toString() {
+ return getName() + " - " + (completed ? "[Completed]" : "[InWork]");
+ }
+
+ @Override
public int hashCode() {
final int prime = 31;
int result = 1;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
index 2f143f7c53..ebf7296f5c 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
@@ -24,6 +24,10 @@ public class CoverageRelationTypes extends NamedIdentity implements IRelationEnu
RelationSide.SIDE_B, "AAMFE99pzm4zSibDT9gA", "TeamWorkflowTargetedForVersion");
public static final CoverageRelationTypes TeamWorkflowTargetedForVersion_Workflow = new CoverageRelationTypes(
RelationSide.SIDE_A, "AAMFE99pzm4zSibDT9gA", "TeamWorkflowTargetedForVersion");
+ public static final CoverageRelationTypes ActionToWorkflow_Action = new CoverageRelationTypes(RelationSide.SIDE_A,
+ "AAMFE953ixQThusHUPwA", "ActionToWorkflow");
+ public static final CoverageRelationTypes ActionToWorkflow_WorkFlow = new CoverageRelationTypes(RelationSide.SIDE_B,
+ "AAMFE953ixQThusHUPwA", "ActionToWorkflow");
private CoverageRelationTypes(RelationSide relationSide, String guid, String name) {
super(guid, name);
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
index 7f17716777..a57309e9f3 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
@@ -16,6 +16,8 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.logging.Level;
import org.eclipse.osee.coverage.event.CoverageEventManager;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoverageImport;
import org.eclipse.osee.coverage.model.CoverageItem;
@@ -24,7 +26,7 @@ import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
-import org.eclipse.osee.coverage.msgs.CoveragePackageSave;
+import org.eclipse.osee.coverage.model.IWorkProductRelatable;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -32,6 +34,7 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -88,34 +91,43 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
}
}
}
+ loadWorkProductTaskNames();
+ }
+
+ private void loadWorkProductTaskNames() {
+ for (ICoverage coverage : coveragePackage.getCoverageItems()) {
+ if (coverage instanceof IWorkProductRelatable) {
+ if (Strings.isValid(((IWorkProductRelatable) coverage).getWorkProductGuid())) {
+ ((IWorkProductRelatable) coverage).setWorkProductTask(this.coveragePackage.getWorkProductTaskProvider().getWorkProductTask(
+ ((IWorkProductRelatable) coverage).getWorkProductGuid()));
+ }
+ }
+ }
}
@Override
- public Result save(SkynetTransaction transaction) throws OseeCoreException {
+ public Result save(SkynetTransaction transaction, CoveragePackageEvent coverageEvent) throws OseeCoreException {
+ boolean newCoveragePackage = getArtifact(false) == null;
getArtifact(true);
ElapsedTime elapsedTime = new ElapsedTime(getClass().getSimpleName() + " - save");
- CoveragePackageSave coveragePackageSave = new CoveragePackageSave();
- coveragePackageSave.setName(coveragePackage.getName());
artifact.setName(coveragePackage.getName());
+ coverageEvent.getPackage().setEventType(newCoveragePackage ? CoverageEventType.Added : CoverageEventType.Modified);
artifact.setSoleAttributeValue(CoreAttributeTypes.Active, coveragePackage.isEditable().isTrue());
for (CoverageUnit coverageUnit : coveragePackage.getCoverageUnits()) {
- OseeCoverageStore store = new OseeCoverageUnitStore(coverageUnit, artifact.getBranch());
- store.save(transaction);
+ OseeCoverageUnitStore store = new OseeCoverageUnitStore(coverageUnit, artifact.getBranch());
+ store.save(transaction, coverageEvent);
Artifact childArt = store.getArtifact(false);
if (childArt.getParent() == null && !artifact.getChildren().contains(childArt)) {
artifact.addChild(store.getArtifact(false));
}
}
artifact.persist(transaction);
- CoverageEventManager.getInstance().sendRemoteEvent(coveragePackageSave);
elapsedTime.end();
return Result.TrueResult;
}
- public Result save(SkynetTransaction transaction, Collection<ICoverage> coverages) throws OseeCoreException {
+ public Result save(SkynetTransaction transaction, CoveragePackageEvent coverageEvent, Collection<ICoverage> coverages) throws OseeCoreException {
ElapsedTime elapsedTime = new ElapsedTime(getClass().getSimpleName() + " - save(coverages)");
- CoveragePackageSave coveragePackageSave = new CoveragePackageSave();
- coveragePackageSave.setName(coveragePackage.getName());
for (ICoverage coverage : coverages) {
CoverageUnit coverageUnit = null;
if (coverage instanceof CoverageItem) {
@@ -126,10 +138,9 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
throw new OseeArgumentException("Unhandled coverage type");
}
OseeCoverageUnitStore store = new OseeCoverageUnitStore(coverageUnit, transaction.getBranch());
- store.save(transaction);
+ store.save(transaction, coverageEvent);
}
elapsedTime.end();
- CoverageEventManager.getInstance().sendRemoteEvent(coveragePackageSave);
return Result.TrueResult;
}
@@ -171,7 +182,7 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
}
@Override
- public void delete(SkynetTransaction transaction, boolean purge) throws OseeCoreException {
+ public void delete(SkynetTransaction transaction, CoveragePackageEvent coverageEvent, boolean purge) throws OseeCoreException {
if (getArtifact(false) != null) {
if (purge) {
getArtifact(false).purgeFromBranch();
@@ -180,7 +191,7 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
}
}
for (CoverageUnit childCoverageUnit : coveragePackage.getCoverageUnits()) {
- new OseeCoverageUnitStore(childCoverageUnit, transaction.getBranch()).delete(transaction, purge);
+ new OseeCoverageUnitStore(childCoverageUnit, transaction.getBranch()).delete(transaction, coverageEvent, purge);
}
}
@@ -197,8 +208,10 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
public Result save(Collection<ICoverage> coverages) {
try {
SkynetTransaction transaction = new SkynetTransaction(branch, "Coverage Save");
- save(transaction, coverages);
+ CoveragePackageEvent coverageEvent = new CoveragePackageEvent(coveragePackage, CoverageEventType.Modified);
+ save(transaction, coverageEvent, coverages);
transaction.execute();
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
return new Result("Save Failed: " + ex.getLocalizedMessage());
@@ -215,4 +228,8 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
this.coverageOptionManager = coverageOptionManager;
}
+ @Override
+ public CoveragePackageEvent getBaseCoveragePackageEvent(CoverageEventType coverageEventType) {
+ return new CoveragePackageEvent(coveragePackage, coverageEventType);
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageStore.java
index 36c7eb7b55..85138840e4 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageStore.java
@@ -11,6 +11,9 @@
package org.eclipse.osee.coverage.store;
import java.util.logging.Level;
+import org.eclipse.osee.coverage.event.CoverageEventManager;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.framework.core.data.IArtifactType;
@@ -55,14 +58,16 @@ public abstract class OseeCoverageStore extends CoverageStore {
}
- public abstract void delete(SkynetTransaction transaction, boolean purge) throws OseeCoreException;
+ public abstract void delete(SkynetTransaction transaction, CoveragePackageEvent coverageEvent, boolean purge) throws OseeCoreException;
@Override
public Result save() {
try {
SkynetTransaction transaction = new SkynetTransaction(branch, "Coverage Save");
- save(transaction);
+ CoveragePackageEvent coverageEvent = getBaseCoveragePackageEvent(CoverageEventType.Modified);
+ save(transaction, coverageEvent);
transaction.execute();
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
return new Result("Save Failed: " + ex.getLocalizedMessage());
@@ -73,11 +78,15 @@ public abstract class OseeCoverageStore extends CoverageStore {
@Override
public void delete(boolean purge) throws OseeCoreException {
SkynetTransaction transaction = new SkynetTransaction(branch, "Coverage Save");
- delete(transaction, purge);
+ CoveragePackageEvent coverageEvent = getBaseCoveragePackageEvent(CoverageEventType.Deleted);
+ delete(transaction, coverageEvent, purge);
transaction.execute();
+ CoverageEventManager.getInstance().sendRemoteEvent(coverageEvent);
}
- public abstract Result save(SkynetTransaction transaction) throws OseeCoreException;
+ public abstract CoveragePackageEvent getBaseCoveragePackageEvent(CoverageEventType coverageEventType);
+
+ public abstract Result save(SkynetTransaction transaction, CoveragePackageEvent coverageEvent) throws OseeCoreException;
public Branch getBranch() {
return branch;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
index cc1c4a50ae..3bf4c541c1 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
@@ -14,16 +14,21 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import org.eclipse.osee.coverage.event.CoverageChange;
+import org.eclipse.osee.coverage.event.CoverageEventType;
+import org.eclipse.osee.coverage.event.CoveragePackageEvent;
import org.eclipse.osee.coverage.model.CoverageItem;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.UsersByIds;
@@ -61,7 +66,7 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
}
@Override
- public void delete(SkynetTransaction transaction, boolean purge) throws OseeCoreException {
+ public void delete(SkynetTransaction transaction, CoveragePackageEvent coverageEvent, boolean purge) throws OseeCoreException {
if (getArtifact(false) != null) {
if (purge) {
getArtifact(false).purgeFromBranch();
@@ -69,8 +74,9 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
getArtifact(false).deleteAndPersist(transaction);
}
}
+ coverageEvent.getCoverages().add(new CoverageChange(coverageUnit, CoverageEventType.Deleted));
for (CoverageUnit childCoverageUnit : coverageUnit.getCoverageUnits()) {
- new OseeCoverageUnitStore(childCoverageUnit, branch).delete(transaction, purge);
+ new OseeCoverageUnitStore(childCoverageUnit, branch).delete(transaction, coverageEvent, purge);
}
}
@@ -104,7 +110,7 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
}
@Override
- public Result save(SkynetTransaction transaction) throws OseeCoreException {
+ public Result save(SkynetTransaction transaction, CoveragePackageEvent coverageEvent) throws OseeCoreException {
Artifact artifact = getArtifact(true);
artifact.setName(coverageUnit.getName());
@@ -121,6 +127,17 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
items.add(coverageItem.toXml());
}
artifact.setAttributeValues(CoverageAttributeTypes.Item, items);
+ for (Attribute<Object> attr : artifact.getAttributes(CoverageAttributeTypes.Item)) {
+ if (attr.isDirty()) {
+ CoverageChange change = new CoverageChange(coverageUnit, CoverageEventType.Modified);
+ if (attr.getModificationType() == ModificationType.NEW || attr.getModificationType() == ModificationType.UNDELETED || attr.getModificationType() == ModificationType.INTRODUCED) {
+ change.setEventType(CoverageEventType.Added);
+ } else if (attr.getModificationType() == ModificationType.DELETED) {
+ change.setEventType(CoverageEventType.Deleted);
+ }
+ coverageEvent.getCoverages().add(change);
+ }
+ }
if (Strings.isValid(coverageUnit.getNotes())) {
artifact.setSoleAttributeFromString(CoverageAttributeTypes.Notes, coverageUnit.getNotes());
}
@@ -154,7 +171,7 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
}
// Save current/new coverage items
for (CoverageUnit childCoverageUnit : coverageUnit.getCoverageUnits()) {
- new OseeCoverageUnitStore(childCoverageUnit, branch).save(transaction);
+ new OseeCoverageUnitStore(childCoverageUnit, branch).save(transaction, coverageEvent);
}
// Delete removed coverage units and folders
for (Artifact childArt : artifact.getChildren()) {
@@ -168,12 +185,19 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
}
if (!found) {
new OseeCoverageUnitStore(coverageUnit, childArt, CoverageOptionManagerDefault.instance()).delete(
- transaction, false);
+ transaction, coverageEvent, false);
}
}
}
artifact.persist(transaction);
+ if (artifact.isDirty()) {
+ CoverageChange change = new CoverageChange(coverageUnit, CoverageEventType.Modified);
+ if (artifact.getModType() == ModificationType.NEW) {
+ change.setEventType(CoverageEventType.Added);
+ }
+ coverageEvent.getCoverages().add(change);
+ }
return Result.TrueResult;
}
@@ -203,4 +227,9 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
}
return UsersByIds.getUsers(string);
}
+
+ @Override
+ public CoveragePackageEvent getBaseCoveragePackageEvent(CoverageEventType coverageEventType) {
+ throw new IllegalArgumentException("Should never be called");
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
index 8ae07daa68..8a133d8d23 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
@@ -277,4 +277,5 @@ public class CoverageUtil {
}
return true;
}
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/WorkProductActionLabelProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/WorkProductActionLabelProvider.java
new file mode 100644
index 0000000000..aee0b261bc
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/WorkProductActionLabelProvider.java
@@ -0,0 +1,50 @@
+package org.eclipse.osee.coverage.util;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService.ImageType;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.swt.graphics.Image;
+
+public class WorkProductActionLabelProvider implements ILabelProvider {
+
+ @Override
+ public Image getImage(Object arg0) {
+ if (arg0 instanceof WorkProductAction) {
+ return ImageManager.getImage(SkynetGuiPlugin.getInstance().getOseeCmService().getImage(ImageType.Pcr));
+ } else {
+ return ImageManager.getImage(SkynetGuiPlugin.getInstance().getOseeCmService().getImage(ImageType.Task));
+ }
+ }
+
+ @Override
+ public String getText(Object arg0) {
+ if (arg0 instanceof WorkProductAction) {
+ return String.format("%s - %d Tasks", arg0.toString(), ((WorkProductAction) arg0).getTasks().size());
+ }
+ return arg0.toString();
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener arg0) {
+ // do nothing
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ @Override
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener arg0) {
+ // do nothing
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java
index 2cdb4afb37..93875d614b 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.coverage.util.dialog;
import java.util.Collection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.coverage.util.WorkProductActionLabelProvider;
import org.eclipse.osee.framework.ui.swt.Displays;
/**
@@ -41,12 +41,7 @@ public class WorkProductListDialog extends org.eclipse.ui.dialogs.ListDialog {
// do nothing
}
});
- setLabelProvider(new LabelProvider() {
- @Override
- public String getText(Object element) {
- return element.toString();
- }
- });
+ setLabelProvider(new WorkProductActionLabelProvider());
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeDialog.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeDialog.java
new file mode 100644
index 0000000000..5ea6e46b7a
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeDialog.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osee.coverage.util.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.coverage.model.WorkProductTask;
+import org.eclipse.osee.coverage.util.WorkProductActionLabelProvider;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEEFilteredTreeDialog;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkProductTaskFilteredTreeDialog extends OSEEFilteredTreeDialog<Collection<WorkProductTask>> {
+ private WorkProductTask selection;
+
+ public WorkProductTaskFilteredTreeDialog(String title, String message) {
+ super(title, message, new WorkProductActionLabelProvider(), new ArrayTreeContentProvider(), new PatternFilter());
+ setCheckTree(false);
+ setMultiSelect(false);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control comp = super.createDialogArea(container);
+ try {
+ getTreeViewer().getViewer().setSorter(new StringNameSorter());
+ getTreeViewer().getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection sel = (IStructuredSelection) getTreeViewer().getViewer().getSelection();
+ if (sel.isEmpty()) {
+ selection = null;
+ } else {
+ selection =
+ (WorkProductTask) ((IStructuredSelection) getTreeViewer().getViewer().getSelection()).getFirstElement();
+ }
+ }
+ });
+ getTreeViewer().getViewer().getTree().addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ updateStatusLabel();
+ }
+ });
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 400;
+ getTreeViewer().getViewer().getTree().setLayoutData(gd);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return comp;
+ }
+
+ @Override
+ protected Result isComplete() {
+ try {
+ if (selection == null) {
+ return new Result("Must select Work Product Task.");
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return Result.TrueResult;
+ }
+
+ public WorkProductTask getSelection() {
+ return selection;
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java
new file mode 100644
index 0000000000..883f0e6373
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductTaskFilteredTreeEntryDialog.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.coverage.util.dialog;
+
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkProductTaskFilteredTreeEntryDialog extends WorkProductTaskFilteredTreeDialog {
+
+ private String entryValue = null;
+ private final String entryName;
+ private XText xText = null;
+
+ public WorkProductTaskFilteredTreeEntryDialog(String title, String message, String entryName) {
+ super(title, message);
+ this.entryName = entryName;
+ }
+
+ @Override
+ protected void createPostCustomArea(Composite parent) {
+ super.createPreCustomArea(parent);
+ xText = new XText(entryName);
+ if (entryValue != null) {
+ xText.setText(entryValue);
+ }
+ xText.addXModifiedListener(new XModifiedListener() {
+ @Override
+ public void widgetModified(XWidget widget) {
+ entryValue = xText.get();
+ updateStatusLabel();
+ }
+ });
+ xText.createWidgets(parent, 2);
+ }
+
+ public String getEntryValue() {
+ return entryValue;
+ }
+
+ public void setEntryValue(String entryValue) {
+ this.entryValue = entryValue;
+ }
+
+ @Override
+ protected Result isComplete() {
+ if (super.isComplete().isFalse() && !Strings.isValid(entryValue)) {
+ return new Result("Must either select task or enter new task title.");
+ }
+ return Result.TrueResult;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
index 7abbfd314f..656f847f41 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
@@ -54,6 +54,7 @@ public class OseeApplicationServer {
private static final String ApplicationServer = "Application Server";
private OseeApplicationServer() {
+ // private constructor
}
public static String getOseeApplicationServer() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/accessProviders/ArtifactTypeAccessProvder.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/accessProviders/ArtifactTypeAccessProvder.java
index e0a5231c7c..13d26ce9d8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/accessProviders/ArtifactTypeAccessProvder.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/accessProviders/ArtifactTypeAccessProvder.java
@@ -38,7 +38,6 @@ public class ArtifactTypeAccessProvder {
/**
* @return Returns artifact types that a user has write permissions for on a specific branch
- * @throws OseeCoreException
*/
public Collection<ArtifactType> getWritableTypes() throws OseeCoreException {
Iterator<ArtifactType> artTypeIterator = artifactTypes.iterator();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
index 231fe1f944..9bcb24de30 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.ui.skynet.cm;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
@@ -21,6 +22,13 @@ import org.eclipse.osee.framework.ui.swt.KeyedImage;
*/
public interface IOseeCmService {
+ public static enum ImageType {
+ Pcr,
+ Task
+ };
+
+ KeyedImage getImage(ImageType imageType);
+
boolean isCmAdmin();
void openArtifact(Artifact artifact, OseeCmEditor oseeCmEditor);
@@ -38,4 +46,6 @@ public interface IOseeCmService {
KeyedImage getOpenImage(OseeCmEditor oseeCmEditor);
Artifact createWorkTask(String name, String parentPcrGuid);
+
+ Artifact createPcr(String title, String description, String changeType, String priority, Date needByDate, Collection<String> productNames);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java
new file mode 100644
index 0000000000..3d1e967fe9
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.ui.skynet.util;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+public class StringNameSorter extends ViewerSorter {
+
+ public StringNameSorter() {
+ super();
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public int compare(Viewer viewer, Object o1, Object o2) {
+
+ return getComparator().compare(o1.toString(), o2.toString());
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
index 5dbe8cafd4..3143ac2ed2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
@@ -58,6 +58,10 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
// provided for subclass implementation
}
+ protected void createPostCustomArea(Composite parent) {
+ // provided for subclass implementation
+ }
+
/**
* Sets the input. Convenience method.
*
@@ -132,6 +136,9 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
if (initialSelections != null) {
updateInitialSelections(initialSelections);
}
+
+ createPostCustomArea(parent);
+
return parent;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
index d2e4a8b11c..5837d729de 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
-import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.ArtifactContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ListDialog;
@@ -32,7 +32,7 @@ public class UserListDialog extends ListDialog {
super(parent);
setTitle(title);
setMessage(title);
- setContentProvider(new ArrayContentProvider());
+ setContentProvider(new ArtifactContentProvider());
setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
@@ -42,7 +42,8 @@ public class UserListDialog extends ListDialog {
return "Unknown Object";
}
});
- setInput(UserManager.getUsersSortedByName());
+ System.err.println("Switch this back to only active: getUsersSortedByName");
+ setInput(UserManager.getUsersAllSortedByName());
setShellStyle(getShellStyle() | SWT.RESIZE);
}

Back to the top