summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-06-28 12:34:55 (EDT)
committerRyan D. Brooks2011-06-28 12:34:55 (EDT)
commit319ee5c8eed1d976bd99bbc5a6cec460fe02f438 (patch)
tree3b73990b7d196e93a9d978f8aec43b8bdf99e789
parent21c6952d695a7114a5b2ece238a85137d6b7a159 (diff)
downloadorg.eclipse.osee-319ee5c8eed1d976bd99bbc5a6cec460fe02f438.zip
org.eclipse.osee-319ee5c8eed1d976bd99bbc5a6cec460fe02f438.tar.gz
org.eclipse.osee-319ee5c8eed1d976bd99bbc5a6cec460fe02f438.tar.bz2
refinement[bgz_350609]: Allow ArtifactExplorer to purge children
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsTestUtil.java3
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/AtsPurgeTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java2
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/util/CoverageTestUtil.java3
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/blam/operation/TestPlanComplianceReportTest.java15
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPurgeTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_setAttributeValues.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/BranchStateTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/NativeArtifactTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationDeletionTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/util/FrameworkTestUtil.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifactTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java13
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/PreviewAndMultiPreviewTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/render/word/WordTemplateProcessorTest.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java16
23 files changed, 74 insertions, 40 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsTestUtil.java
index 91fd1fe..841f18e 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsTestUtil.java
@@ -36,6 +36,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.IBasicUser;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.util.WorkPageType;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -371,7 +372,7 @@ public class AtsTestUtil {
artifacts.addAll(ArtifactQuery.getArtifactListFromName(title + "%", AtsUtilCore.getAtsBranch(),
EXCLUDE_DELETED));
}
- new PurgeArtifacts(artifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
TestUtil.sleep(4000);
}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/AtsPurgeTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/AtsPurgeTest.java
index d8f4844..d7ec125 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/AtsPurgeTest.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/AtsPurgeTest.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.core.config.ActionableItemArtifact;
import org.eclipse.osee.ats.core.task.TaskArtifact;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
import org.eclipse.osee.ats.core.workflow.ChangeType;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
@@ -94,7 +95,7 @@ public class AtsPurgeTest {
TestUtil.checkThatIncreased(preCreateActionCount, postCreateActionCount);
// Purge Action, Workflow and Tasks
- new PurgeArtifacts(artsToPurge).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artsToPurge));
// Count rows and check that same as when began
DbTestUtil.getTableRowCounts(postPurgeCount, tables);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java
index e39fd66..a2f92ce 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java
@@ -42,6 +42,7 @@ import org.eclipse.osee.ats.world.WorldLabelProvider;
import org.eclipse.osee.ats.world.WorldXViewer;
import org.eclipse.osee.ats.world.WorldXViewerEventManager;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
@@ -198,7 +199,7 @@ public class TaskComposite extends Composite implements IWorldViewerEventHandler
taskArts.removeAll(items);
if (tasksNotInDb.size() > 0) {
- new PurgeArtifacts(tasksNotInDb).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(tasksNotInDb));
refreshActionHandler();
}
iXTaskViewer.getEditor().onDirtied();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
index df3fb2a..f631ce2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
@@ -110,7 +110,7 @@ public class AtsDeleteManager {
protected void doWork(IProgressMonitor monitor) throws Exception {
// perform the delete/purge
if (purge) {
- new PurgeArtifacts(allDeleteArts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(allDeleteArts));
} else if (allDeleteArts.size() > 0) {
SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Delete ATS Objects");
ArtifactPersistenceManager.deleteArtifact(transaction, false,
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/util/CoverageTestUtil.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/util/CoverageTestUtil.java
index bf430ab..17d77bb 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/util/CoverageTestUtil.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/util/CoverageTestUtil.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -39,7 +40,7 @@ public class CoverageTestUtil {
public static void cleanupCoverageTests() throws OseeCoreException {
try {
- new PurgeArtifacts(getAllCoverageArtifacts()).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(getAllCoverageArtifacts()));
} catch (ArtifactDoesNotExist ex) {
// do nothing
}
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/blam/operation/TestPlanComplianceReportTest.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/blam/operation/TestPlanComplianceReportTest.java
index fe08d7a..ec60270 100644
--- a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/blam/operation/TestPlanComplianceReportTest.java
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/blam/operation/TestPlanComplianceReportTest.java
@@ -14,12 +14,11 @@ import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.osee.define.blam.operation.TestPlanComplianceReport;
-import org.eclipse.osee.define.blam.operation.TestStatusEnum;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -57,7 +56,7 @@ public final class TestPlanComplianceReportTest {
buildTest(1, TestStatusEnum.NOT_PERFORMED_CODE, 0);
Assert.assertTrue("No \"Not Performed\" string found.",
resultBuffer.toString().contains(EXPECTED_NOT_PERFORMED_DATA));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
}
//@formatter:off
@@ -71,7 +70,7 @@ public final class TestPlanComplianceReportTest {
buildTest(1, TestStatusEnum.NOT_PERFORMED_CODE, 1);
Assert.assertTrue("No \"OseeErrorStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_ERROR_STYLE));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
}
//@formatter:off
@@ -87,21 +86,21 @@ public final class TestPlanComplianceReportTest {
resultBuffer.toString().contains(EXPECTED_OSEE_ERROR_STYLE));
Assert.assertTrue("No \"OseeBoldStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_BOLD_STYLE));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
buildTest(1, TestStatusEnum.COMPLETED_WITH_ISSUES_CODE, 0);
Assert.assertTrue("No \"OseeErrorStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_ERROR_STYLE));
Assert.assertTrue("No \"OseeBoldStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_BOLD_STYLE));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
buildTest(1, TestStatusEnum.COMPLETED_WITH_ISSUES_RESOLVED_CODE, 0);
Assert.assertTrue("No \"OseeErrorStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_ERROR_STYLE));
Assert.assertTrue("No \"OseeBoldStyle\" string found.",
resultBuffer.toString().contains(EXPECTED_OSEE_BOLD_STYLE));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
}
@Test
@@ -109,7 +108,7 @@ public final class TestPlanComplianceReportTest {
buildTest(1, TestStatusEnum.COMPLETED_PASSED_CODE, 2);
Assert.assertTrue("All test result files should be in 1 cell",
resultBuffer.toString().contains(EXPECTED_MULTIPLE_RESULTS_IN_1_CELL));
- new PurgeArtifacts(dummyArtifactList).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(dummyArtifactList));
}
@BeforeClass
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPurgeTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPurgeTest.java
index b9d7e84..f9f335a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPurgeTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPurgeTest.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.mocks.DbTestUtil;
import org.eclipse.osee.framework.skynet.core.util.FrameworkTestUtil;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
@@ -56,7 +57,7 @@ public class ArtifactPurgeTest extends AbstractPurgeTest {
DbTestUtil.getTableRowCounts(postCreateArtifactsCount, getTables());
TestUtil.checkThatIncreased(preCreateArtifactsCount, postCreateArtifactsCount);
- new PurgeArtifacts(softArts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(softArts));
// Count rows and check that same as when began
getPostTableCount();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java
index 93cbdd7..bd9943e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.junit.AfterClass;
@@ -82,6 +83,6 @@ public class Artifact_getLastModified {
Collection<Artifact> arts =
ArtifactQuery.getArtifactListFromName(Artifact_getLastModified.class.getSimpleName(),
BranchManager.getCommonBranch(), EXCLUDE_DELETED);
- new PurgeArtifacts(arts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(arts));
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_setAttributeValues.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_setAttributeValues.java
index 5391010..2939210 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_setAttributeValues.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_setAttributeValues.java
@@ -18,6 +18,7 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.support.test.util.DemoSawBuilds;
@@ -104,6 +105,6 @@ public class Artifact_setAttributeValues {
Collection<Artifact> arts =
ArtifactQuery.getArtifactListFromName(Artifact_setAttributeValues.class.getSimpleName(),
DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED);
- new PurgeArtifacts(arts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(arts));
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/BranchStateTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/BranchStateTest.java
index b7f0ca7..5ceb3ae 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/BranchStateTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/BranchStateTest.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
@@ -339,7 +340,7 @@ public class BranchStateTest {
purgeBranchAndChildren(branch);
}
if (toDelete != null && toDelete.length > 0) {
- new PurgeArtifacts(Arrays.asList(toDelete)).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(Arrays.asList(toDelete)));
}
} catch (Exception ex) {
// Do Nothing;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/NativeArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/NativeArtifactTest.java
index 22641c9..daef0e5 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/NativeArtifactTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/NativeArtifactTest.java
@@ -21,6 +21,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
@@ -40,7 +41,7 @@ public class NativeArtifactTest {
@BeforeClass
@AfterClass
public static void cleanup() throws Exception {
- new PurgeArtifacts(testArtifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(testArtifacts));
}
@org.junit.Test
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationDeletionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationDeletionTest.java
index 18b8e8a..134f009 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationDeletionTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationDeletionTest.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.rule.OseeHousekeepingRule;
@@ -47,7 +48,7 @@ public class RelationDeletionTest {
@After
public void cleanUp() throws OseeCoreException {
- new PurgeArtifacts(artifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
}
@Test
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java
index bd6a3d1..7939e27 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -54,7 +55,7 @@ public class RelationOrderingTest {
artsToDel.addAll(ArtifactQuery.getArtifactListFromTypeAndAttribute(CoreArtifactTypes.Folder,
CoreAttributeTypes.StaticId, STATIC_ID_TO_DELETE, BranchManager.getCommonBranch()));
if (artsToDel.size() > 0) {
- new PurgeArtifacts(artsToDel).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artsToDel));
Thread.sleep(5000);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java
index 29ce48e..89a5402 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -55,7 +56,7 @@ public class CrossBranchLinkTest {
BranchManager.getCommonBranch(), EXCLUDE_DELETED));
artifacts.addAll(ArtifactQuery.getArtifactListFromName(CrossBranchLinkTest.class.getSimpleName() + "%",
DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED));
- new PurgeArtifacts(artifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
TestUtil.sleep(4000);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/util/FrameworkTestUtil.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/util/FrameworkTestUtil.java
index b043482..daad42f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/util/FrameworkTestUtil.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/util/FrameworkTestUtil.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -97,7 +98,7 @@ public class FrameworkTestUtil {
artifacts.addAll(ArtifactQuery.getArtifactListFromName(title + "%", branch, EXCLUDE_DELETED));
}
if (artifacts.size() > 0) {
- new PurgeArtifacts(artifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
TestUtil.sleep(4000);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifactTest.java
index 2caf239..343e604 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifactTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifactTest.java
@@ -15,6 +15,7 @@ import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.Collection;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -40,7 +41,7 @@ public class CsvArtifactTest {
csv = CsvArtifact.getCsvArtifact(id, DemoSawBuilds.SAW_Bld_2, true);
}
Collection<Artifact> arts = ArtifactQuery.getArtifactListFromName(id, DemoSawBuilds.SAW_Bld_2, EXCLUDE_DELETED);
- new PurgeArtifacts(arts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(arts));
}
@org.junit.Test
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index 64cd961..56a65ac 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -15,10 +15,10 @@ import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hi
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -1095,8 +1095,17 @@ public class Artifact extends NamedIdentity implements IArtifact, IAdaptable, IB
/**
* Remove artifact from a specific branch in the database
*/
+ public final void purgeFromBranch(boolean purgeChildren) throws OseeCoreException {
+ Collection<Artifact> artifacts = new LinkedHashSet<Artifact>();
+ artifacts.add(this);
+ if (purgeChildren) {
+ artifacts.addAll(getDescendants());
+ }
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
+ }
+
public final void purgeFromBranch() throws OseeCoreException {
- new PurgeArtifacts(Arrays.asList(this)).execute();
+ purgeFromBranch(false);
}
public final boolean isDeleted() {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java
index 0363329..853ac1e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java
@@ -17,12 +17,13 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.DbTransaction;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.database.core.SQL3DataType;
@@ -38,7 +39,7 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
/**
* @author Ryan D. Brooks
*/
-public class PurgeArtifacts extends DbTransaction {
+public class PurgeArtifacts extends AbstractDbTxOperation {
private static final String INSERT_SELECT_ITEM =
"INSERT INTO osee_join_transaction (query_id, insert_time, gamma_id, transaction_id) SELECT /*+ ordered FIRST_ROWS */ ?, ?, txs.gamma_id, txs.transaction_id FROM osee_join_artifact aj, %s item, osee_txs txs WHERE aj.query_id = ? AND %s AND item.gamma_id = txs.gamma_id AND aj.branch_id = txs.branch_id";
@@ -59,12 +60,13 @@ public class PurgeArtifacts extends DbTransaction {
private boolean success;
public PurgeArtifacts(Collection<? extends Artifact> artifactsToPurge) {
+ super(Activator.getInstance().getOseeDatabaseService(), "Purge Artifact", Activator.PLUGIN_ID);
this.artifactsToPurge = artifactsToPurge;
this.success = false;
}
@Override
- protected void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected void doTxWork(IProgressMonitor monitor, OseeConnection connection) throws OseeCoreException {
if (artifactsToPurge == null || artifactsToPurge.size() == 0) {
return;
}
@@ -178,7 +180,7 @@ public class PurgeArtifacts extends DbTransaction {
}
@Override
- protected void handleTxFinally() throws OseeCoreException {
+ protected void handleTxFinally(IProgressMonitor monitor) throws OseeCoreException {
if (success) {
Set<EventBasicGuidArtifact> artifactChanges = new HashSet<EventBasicGuidArtifact>();
for (Artifact artifact : artifactsToPurge) {
@@ -199,4 +201,5 @@ public class PurgeArtifacts extends DbTransaction {
String sql = String.format(INSERT_SELECT_ITEM, tableName, artifactJoinSql);
databaseService.runPreparedUpdate(connection, sql, transactionJoinId, insertTime, queryId);
}
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/PreviewAndMultiPreviewTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/PreviewAndMultiPreviewTest.java
index 9e88ce3..4b4c9ee 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/PreviewAndMultiPreviewTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/PreviewAndMultiPreviewTest.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -70,7 +71,7 @@ public class PreviewAndMultiPreviewTest {
Assert.assertTrue(monitorLog.getLogsAtLevel(Level.WARNING).isEmpty());
Assert.assertTrue(monitorLog.getLogsAtLevel(Level.SEVERE).isEmpty());
TestUtil.severeLoggingEnd(monitorLog);
- new PurgeArtifacts(testArtifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(testArtifacts));
testArtifacts.clear();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java
index ac76264..96002bd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java
@@ -193,8 +193,8 @@ public final class ArtifactImportWizardTest {
@After
public void tearDown() throws Exception {
- new PurgeArtifacts(myRootArtifact.getDescendants()).execute();
- new PurgeArtifacts(Collections.singletonList(myRootArtifact)).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(myRootArtifact.getDescendants()));
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(Collections.singletonList(myRootArtifact)));
}
@BeforeClass
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/render/word/WordTemplateProcessorTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/render/word/WordTemplateProcessorTest.java
index 2d942a2..1e64618 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/render/word/WordTemplateProcessorTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/render/word/WordTemplateProcessorTest.java
@@ -19,6 +19,7 @@ import java.util.Collections;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -154,8 +155,8 @@ public class WordTemplateProcessorTest {
@AfterClass
public static void tearDownOnce() throws Exception {
TestUtil.severeLoggingEnd(monitorLog);
- new PurgeArtifacts(myRootArtifact.getChildren()).execute();
- new PurgeArtifacts(Collections.singletonList(myRootArtifact)).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(myRootArtifact.getChildren()));
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(Collections.singletonList(myRootArtifact)));
}
private static String getResourceData(String relativePath) throws IOException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java
index a6f3455..e759233 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -49,7 +50,7 @@ public class PurgeArtifactHandler extends CommandHandler {
IStatus toReturn = Status.CANCEL_STATUS;
monitor.beginTask("Purge artifact", artifacts.size());
try {
- new PurgeArtifacts(artifacts).execute();
+ Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts));
toReturn = Status.OK_STATUS;
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
index 1c7bd4f..c2eecc7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
@@ -21,6 +21,8 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -175,10 +177,14 @@ public class GlobalMenu {
public void run() {
final Collection<Artifact> artifactsToBePurged = globalMenuHelper.getArtifacts();
- if (MessageDialog.openConfirm(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Confirm Artifact Purge ",
- " Are you sure you want to purge this artifact, all of " + "its children and all history associated with these artifacts from the database ?")) {
+ final MessageDialogWithToggle dialog =
+ MessageDialogWithToggle.openOkCancelConfirm(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Confirm Artifact Purge ",
+ " Are you sure you want to purge this artifact and all history associated from the database? (cannot be undone)",
+ "Purge selected artifact's children?", false, null, null);
+
+ if (dialog.getReturnCode() == Window.OK) {
Job job = new Job("Purge artifact") {
@Override
@@ -203,7 +209,7 @@ public class GlobalMenu {
for (Artifact artifactToPurge : artifactsToBePurged) {
if (!artifactToPurge.isDeleted()) {
monitor.setTaskName("Purge: " + artifactToPurge.getName());
- artifactToPurge.purgeFromBranch();
+ artifactToPurge.purgeFromBranch(dialog.getToggleState());
}
monitor.worked(1);
}