diff options
112 files changed, 390 insertions, 399 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java index b31ea750dff..e68512e7b41 100644 --- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java +++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java @@ -131,8 +131,6 @@ public class PopulateDemoActions extends XNavigateItemAction { SevereLoggingMonitor monitorLog = TestUtil.severeLoggingStart(); - Branch saw1Branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); - // Import all requirements on SAW_Bld_1 Branch demoDbImportReqsTx(); @@ -140,8 +138,8 @@ public class PopulateDemoActions extends XNavigateItemAction { // Create traceability between System, Subsystem and Software requirements SkynetTransaction demoDbTraceability = - new SkynetTransaction(saw1Branch, "Populate Demo DB - Create Traceability"); - demoDbTraceabilityTx(demoDbTraceability, saw1Branch); + new SkynetTransaction(DemoSawBuilds.SAW_Bld_1, "Populate Demo DB - Create Traceability"); + demoDbTraceabilityTx(demoDbTraceability, DemoSawBuilds.SAW_Bld_1); demoDbTraceability.execute(); DemoDbUtil.sleep(5000); @@ -207,9 +205,8 @@ public class PopulateDemoActions extends XNavigateItemAction { try { OseeLog.log(OseeAtsConfigDemoActivator.class, Level.INFO, "Creating SAW_Bld_2 branch off SAW_Bld_1"); // Create SAW_Bld_2 branch off SAW_Bld_1 - Branch parentBranch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); Branch childBranch = - BranchManager.createBaselineBranch(parentBranch, DemoSawBuilds.SAW_Bld_2, + BranchManager.createBaselineBranch(DemoSawBuilds.SAW_Bld_1, DemoSawBuilds.SAW_Bld_2, UserManager.getUser(SystemUser.OseeSystem)); DemoDbUtil.sleep(5000); @@ -500,7 +497,7 @@ public class PopulateDemoActions extends XNavigateItemAction { } } - private void demoDbTraceabilityTx(SkynetTransaction transaction, Branch branch) { + private void demoDbTraceabilityTx(SkynetTransaction transaction, IOseeBranch branch) { try { Collection<Artifact> systemArts = DemoDbUtil.getArtTypeRequirements(CoreArtifactTypes.SystemRequirement, "Robot", branch); diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfig.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfig.java index de2804a7d40..375f1fbd183 100644 --- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfig.java +++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfig.java @@ -15,7 +15,6 @@ import org.eclipse.osee.ats.config.demo.DemoSubsystems; 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.model.Branch; import org.eclipse.osee.framework.database.init.IDbInitializationTask; import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -47,8 +46,7 @@ public class DemoDatabaseConfig implements IDbInitializationTask { } - private void populateProgramBranch(IOseeBranch branch) throws OseeCoreException { - Branch programBranch = BranchManager.getBranch(branch); + private void populateProgramBranch(IOseeBranch programBranch) throws OseeCoreException { Artifact sawProduct = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Component, programBranch, "SAW Product Decomposition"); diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDbUtil.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDbUtil.java index a7a44a9f07d..323d608ad9a 100644 --- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDbUtil.java +++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/config/DemoDbUtil.java @@ -19,6 +19,7 @@ import org.eclipse.osee.ats.config.demo.internal.OseeAtsConfigDemoActivator; import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.util.AtsUtil; 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.exception.OseeExceptions; @@ -79,7 +80,7 @@ public class DemoDbUtil { return getArtTypeRequirements(CoreArtifactTypes.SoftwareRequirement, str.name(), branch); } - public static Collection<Artifact> getArtTypeRequirements(IArtifactType artifactType, String artifactNameStr, Branch branch) throws OseeCoreException { + public static Collection<Artifact> getArtTypeRequirements(IArtifactType artifactType, String artifactNameStr, IOseeBranch branch) throws OseeCoreException { OseeLog.log(OseeAtsConfigDemoActivator.class, Level.INFO, "Getting \"" + artifactNameStr + "\" requirement(s) from Branch " + branch.getName()); Collection<Artifact> arts = diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/access/AtsBranchAccessManagerTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/access/AtsBranchAccessManagerTest.java index 2987908edd2..02178f98d9e 100644 --- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/access/AtsBranchAccessManagerTest.java +++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/access/AtsBranchAccessManagerTest.java @@ -9,7 +9,6 @@ import java.util.Arrays; import java.util.logging.Level; import junit.framework.Assert; import org.eclipse.osee.ats.core.branch.AtsBranchManagerCore; -import org.eclipse.osee.ats.access.AtsBranchAccessManager; import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.type.AtsRelationTypes; import org.eclipse.osee.ats.core.workflow.ActionableItemManagerCore; @@ -22,7 +21,6 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; 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.event.OseeEventManager; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; import org.eclipse.osee.support.test.util.DemoActionableItems; @@ -69,7 +67,7 @@ public class AtsBranchAccessManagerTest { public void testIsApplicable() throws OseeCoreException { AtsBranchAccessManager mgr = new AtsBranchAccessManager(); Assert.assertFalse(mgr.isApplicable(AtsUtil.getAtsBranch())); - Assert.assertFalse(mgr.isApplicable(BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1))); + Assert.assertFalse(mgr.isApplicable(DemoSawBuilds.SAW_Bld_1)); TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Requirements); diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java index c6efaa910ef..b113b7c493d 100644 --- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java +++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java @@ -279,11 +279,11 @@ public class AtsBranchConfigurationTest { Assert.assertTrue("Should be 1 new artifact in change report, found " + newArts.size(), newArts.size() == 1); } - public static void cleanupBranchTest(IOseeBranch testType) throws Exception { - String namespace = "org.branchTest." + testType.getName().toLowerCase(); + public static void cleanupBranchTest(IOseeBranch branch) throws Exception { + String namespace = "org.branchTest." + branch.getName().toLowerCase(); OseeLog.log(AtsPlugin.class, Level.INFO, "Cleanup from previous run of ATS for team " + namespace); Artifact aArt = - ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.Action, testType.getName() + " Req Changes", + ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.Action, branch.getName() + " Req Changes", AtsUtil.getAtsBranch()); if (aArt != null) { SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test"); @@ -301,7 +301,7 @@ public class AtsBranchConfigurationTest { if (arts.size() > 0) { SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test"); for (Artifact verArt : arts) { - if (verArt.getName().contains(testType.getName())) { + if (verArt.getName().contains(branch.getName())) { verArt.deleteAndPersist(transaction, true); } } @@ -310,7 +310,7 @@ public class AtsBranchConfigurationTest { // Delete Team Definitions Artifact art = - ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.TeamDefinition, testType.getName(), + ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.TeamDefinition, branch.getName(), AtsUtil.getAtsBranch()); if (art != null) { SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test"); @@ -320,7 +320,7 @@ public class AtsBranchConfigurationTest { // Delete AIs art = - ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.ActionableItem, testType.getName(), + ArtifactQuery.checkArtifactFromTypeAndName(AtsArtifactTypes.ActionableItem, branch.getName(), AtsUtil.getAtsBranch()); if (art != null) { SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test"); @@ -347,17 +347,13 @@ public class AtsBranchConfigurationTest { BranchManager.refreshBranches(); // delete working branches for (Branch workingBranch : BranchManager.getBranches(BranchArchivedState.ALL, BranchType.WORKING)) { - if (workingBranch.getName().contains(testType.getName())) { + if (workingBranch.getName().contains(branch.getName())) { BranchManager.purgeBranch(workingBranch); TestUtil.sleep(2000); } } - // delete baseline branch - Branch branch = BranchManager.getBranchByGuid(testType.getGuid()); - if (branch != null) { - BranchManager.purgeBranch(branch); - TestUtil.sleep(2000); - } + BranchManager.purgeBranch(branch); + TestUtil.sleep(2000); } catch (BranchDoesNotExist ex) { // do nothing diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java index d36e9408099..8d68b2dd50e 100644 --- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java +++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java @@ -34,13 +34,11 @@ import org.eclipse.osee.framework.core.client.ClientSessionManager; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.exception.OseeAuthenticationException; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.User; 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.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; @@ -62,10 +60,9 @@ public class DemoTestUtil { public static TeamWorkFlowArtifact toolsTeamWorkflow; public static Result isDbPopulatedWithDemoData() throws Exception { - Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Collection<Artifact> robotArtifacts = - ArtifactQuery.getArtifactListFromTypeAndName(CoreArtifactTypes.SoftwareRequirement, "%Robot%", branch); + ArtifactQuery.getArtifactListFromTypeAndName(CoreArtifactTypes.SoftwareRequirement, "%Robot%", + DemoSawBuilds.SAW_Bld_1); if (robotArtifacts.size() < 6) { return new Result( String.format( diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/access/AtsBranchAccessManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/access/AtsBranchAccessManager.java index 41d08288627..fb3bb0e1aba 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/access/AtsBranchAccessManager.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/access/AtsBranchAccessManager.java @@ -27,17 +27,18 @@ import org.eclipse.osee.ats.core.type.AtsArtifactTypes; import org.eclipse.osee.ats.internal.AtsPlugin; import org.eclipse.osee.ats.util.AtsUtil; import org.eclipse.osee.framework.core.data.IAccessContextId; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.SystemUser; import org.eclipse.osee.framework.core.data.TokenFactory; 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.model.type.ArtifactType; import org.eclipse.osee.framework.logging.OseeLog; 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.ArtifactCache; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.event.OseeEventManager; import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactTypeEventFilter; @@ -77,9 +78,9 @@ public class AtsBranchAccessManager implements IArtifactEventListener, IAccessCo OseeEventManager.removeListener(this); } - private Artifact getAssociatedArtifact(Branch objectBranch) throws OseeCoreException { + private Artifact getAssociatedArtifact(IOseeBranch branch) throws OseeCoreException { Artifact toReturn = null; - int artId = objectBranch.getAssociatedArtifactId(); + int artId = BranchManager.getBranch(branch).getAssociatedArtifactId(); if (artId > 0) { toReturn = ArtifactQuery.getArtifactFromId(artId, AtsUtil.getAtsBranchToken()); } else { @@ -91,7 +92,7 @@ public class AtsBranchAccessManager implements IArtifactEventListener, IAccessCo /** * True if not common branch and branch's associated artifact is a Team Workflow artifact */ - public boolean isApplicable(Branch objectBranch) { + public boolean isApplicable(IOseeBranch objectBranch) { boolean result = false; try { if (!AtsUtil.getAtsBranchToken().equals(objectBranch)) { @@ -106,7 +107,7 @@ public class AtsBranchAccessManager implements IArtifactEventListener, IAccessCo return result; } - public Collection<IAccessContextId> getContextId(Branch branch) { + public Collection<IAccessContextId> getContextId(IOseeBranch branch) { if (branchGuidToContextIdCache.containsKey(branch.getGuid())) { return branchGuidToContextIdCache.get(branch.getGuid()); } diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsCmAccessControl.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsCmAccessControl.java index 45c3565f20f..8088f8f5992 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsCmAccessControl.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsCmAccessControl.java @@ -15,7 +15,7 @@ import java.util.Collections; import org.eclipse.osee.ats.access.AtsBranchAccessManager; import org.eclipse.osee.ats.util.AtsUtil; import org.eclipse.osee.framework.core.data.IAccessContextId; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.model.IBasicArtifact; import org.eclipse.osee.framework.core.model.access.AccessModel; import org.eclipse.osee.framework.core.model.access.HasAccessModel; @@ -45,8 +45,8 @@ public class AtsCmAccessControl implements CmAccessControl, HasAccessModel { if (object instanceof Artifact && !((Artifact) object).getBranch().equals(AtsUtil.getAtsBranchToken())) { result = atsBranchAccessManager.isApplicable(((Artifact) object).getBranch()); } - if (object instanceof Branch) { - result = atsBranchAccessManager.isApplicable((Branch) object); + if (object instanceof IOseeBranch) { + result = atsBranchAccessManager.isApplicable((IOseeBranch) object); } } return result; @@ -63,8 +63,8 @@ public class AtsCmAccessControl implements CmAccessControl, HasAccessModel { if (object instanceof Artifact && !((Artifact) object).getBranch().equals(AtsUtil.getAtsBranchToken())) { return atsBranchAccessManager.getContextId(((Artifact) object).getBranch()); } - if (object instanceof Branch) { - return atsBranchAccessManager.getContextId((Branch) object); + if (object instanceof IOseeBranch) { + return atsBranchAccessManager.getContextId((IOseeBranch) object); } } return Collections.emptyList(); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java index 49f049042a5..1af7eba2407 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.osee.ats.core.type.AtsArtifactTypes; import org.eclipse.osee.ats.internal.AtsPlugin; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.SystemUser; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -69,9 +70,9 @@ public class ArtifactImpactToActionSearchItem extends XNavigateItemAction { private IProgressMonitor monitor; private final String artifactName; private final XResultData rd = new XResultData(); - private final Branch branch; + private final IOseeBranch branch; - public ActionToArtifactImpactJob(String artifactName, Branch branch) { + public ActionToArtifactImpactJob(String artifactName, IOseeBranch branch) { super("Searching \"" + artifactName + "\"..."); this.artifactName = artifactName; this.branch = branch; @@ -114,7 +115,7 @@ public class ArtifactImpactToActionSearchItem extends XNavigateItemAction { processArts.addAll(srchArts); } int x = 1; - rd.log("Artifact Impact to Action for artifact(s) on branch \"" + branch.getShortName() + "\""); + rd.log("Artifact Impact to Action for artifact(s) on branch \"" + branch.getName() + "\""); HashCollection<Artifact, TransactionRecord> transactionMap = ChangeManager.getModifingTransactions(processArts); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java index 92052fde81f..f61e3b184bd 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java @@ -27,6 +27,7 @@ import org.eclipse.osee.ats.core.workdef.StateEventType; import org.eclipse.osee.ats.editor.stateItem.AtsStateItemManager; import org.eclipse.osee.ats.editor.stateItem.IAtsStateItem; import org.eclipse.osee.ats.internal.AtsPlugin; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.SystemUser; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -118,7 +119,7 @@ public class AtsBranchCommitJob extends Job { return Status.OK_STATUS; } - private void commit(boolean commitPopup, Branch sourceBranch, Branch destinationBranch, boolean archiveWorkingBranch) throws OseeCoreException { + private void commit(boolean commitPopup, IOseeBranch sourceBranch, IOseeBranch destinationBranch, boolean archiveWorkingBranch) throws OseeCoreException { boolean branchCommitted = false; ConflictManagerExternal conflictManager = new ConflictManagerExternal(destinationBranch, sourceBranch); diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/CoveragePackageImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/CoveragePackageImportTest.java index 020cbfff0d4..daf6b5317f1 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/CoveragePackageImportTest.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/CoveragePackageImportTest.java @@ -43,11 +43,11 @@ import org.eclipse.osee.coverage.store.OseeCoverageStore; import org.eclipse.osee.coverage.util.CoverageTestUtil; import org.eclipse.osee.coverage.util.CoverageUtil; import org.eclipse.osee.coverage.util.ISaveable; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeStateException; import org.eclipse.osee.framework.core.util.Result; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -157,7 +157,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -187,7 +187,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -317,7 +317,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -421,7 +421,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -540,7 +540,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -667,7 +667,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -786,7 +786,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -957,7 +957,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -1110,7 +1110,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -1234,7 +1234,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } @@ -1368,7 +1368,7 @@ public class CoveragePackageImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/VectorCastImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/VectorCastImportTest.java index ea9cb20497e..2322e96bb82 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/VectorCastImportTest.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/VectorCastImportTest.java @@ -13,7 +13,6 @@ package org.eclipse.osee.coverage; import java.io.File; import java.io.IOException; import java.util.Collection; -import org.junit.Assert; import org.eclipse.osee.coverage.event.CoverageEventType; import org.eclipse.osee.coverage.event.CoveragePackageEvent; import org.eclipse.osee.coverage.internal.Activator; @@ -34,8 +33,8 @@ import org.eclipse.osee.coverage.util.CoverageUtil; import org.eclipse.osee.coverage.util.ISaveable; import org.eclipse.osee.coverage.vcast.IVectorCastCoverageImportProvider; import org.eclipse.osee.coverage.vcast.VectorCastAdaCoverageImporter; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.plugin.core.PluginUtil; @@ -45,6 +44,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; import org.eclipse.osee.framework.ui.skynet.results.XResultData; import org.junit.AfterClass; +import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -163,7 +163,7 @@ public class VectorCastImportTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoveragePreferencesTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoveragePreferencesTest.java index 135e7ccdf28..704149e5853 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoveragePreferencesTest.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoveragePreferencesTest.java @@ -10,13 +10,11 @@ *******************************************************************************/ package org.eclipse.osee.coverage.model; -import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault; -import org.eclipse.osee.coverage.model.CoveragePreferences; import org.eclipse.osee.coverage.util.CoverageTestUtil; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; @@ -41,7 +39,7 @@ public class CoveragePreferencesTest { private static Artifact getCoveragePrefArt() throws OseeCoreException { try { - Branch branch = CoverageTestUtil.getTestBranch(); + IOseeBranch branch = CoverageTestUtil.getTestBranch(); Assert.assertNotNull(branch); return ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.GeneralData, "Coverage Preferences", branch); } catch (ArtifactDoesNotExist ex) { diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoverageUnitPersistTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoverageUnitPersistTest.java index 59533eef658..825ea448d7d 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoverageUnitPersistTest.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/model/CoverageUnitPersistTest.java @@ -26,9 +26,9 @@ import org.eclipse.osee.coverage.store.OseeCoveragePackageStore; import org.eclipse.osee.coverage.util.CoverageTestUtil; import org.eclipse.osee.coverage.util.CoverageUtil; import org.eclipse.osee.coverage.util.ISaveable; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -133,7 +133,7 @@ public class CoverageUnitPersistTest { } @Override - public Branch getBranch() { + public IOseeBranch getBranch() { return CoverageTestUtil.getTestBranch(); } }, mergeItems); diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/navigate/CreateWorkProductAction.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/navigate/CreateWorkProductAction.java index 2d4ed057ad8..d33e8d65257 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/navigate/CreateWorkProductAction.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/navigate/CreateWorkProductAction.java @@ -21,7 +21,7 @@ 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.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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; @@ -56,7 +56,7 @@ public class CreateWorkProductAction extends XNavigateItemAction { if (!CoverageUtil.getBranchFromUser(false)) { return; } - Branch branch = CoverageUtil.getBranch(); + IOseeBranch branch = CoverageUtil.getBranch(); CoveragePackageArtifactListDialog dialog = new CoveragePackageArtifactListDialog("Open Coverage Package", "Select Coverage Package"); dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch)); 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 6533767dd87..46559faff10 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 @@ -13,8 +13,6 @@ package org.eclipse.osee.coverage.util; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.logging.Level; -import org.eclipse.osee.coverage.internal.Activator; import org.eclipse.osee.coverage.model.CoverageItem; import org.eclipse.osee.coverage.model.CoverageOption; import org.eclipse.osee.coverage.model.CoveragePackageBase; @@ -22,15 +20,12 @@ import org.eclipse.osee.coverage.model.CoverageUnit; import org.eclipse.osee.coverage.model.ICoverage; 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.dialog.CoveragePackageArtifactListDialog; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; -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.PurgeArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager; import org.eclipse.osee.support.test.util.DemoSawBuilds; @@ -108,13 +103,8 @@ public class CoverageTestUtil { } } - public static Branch getTestBranch() { - try { - return BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); - } catch (OseeCoreException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - return null; + public static IOseeBranch getTestBranch() { + return DemoSawBuilds.SAW_Bld_1; } public static Artifact getSelectedCoveragePackageFromDialog() throws OseeCoreException { 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 58622c6b720..92fe5b9be25 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 @@ -20,8 +20,8 @@ import org.eclipse.osee.coverage.model.CoveragePackage; 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.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -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; @@ -54,7 +54,7 @@ public class DeleteCoveragePackageAction extends Action { if (!CoverageUtil.getBranchFromUser(false)) { return; } - Branch branch = CoverageUtil.getBranch(); + IOseeBranch branch = CoverageUtil.getBranch(); CoveragePackageArtifactListDialog dialog = new CoveragePackageArtifactListDialog("Delete Package", "Select Package"); dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch)); 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 f46f79a234e..83192cc7cc0 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 @@ -24,8 +24,8 @@ import org.eclipse.osee.coverage.store.DbWorkProductTaskProvider; import org.eclipse.osee.coverage.store.OseeCoveragePackageStore; import org.eclipse.osee.coverage.util.CoverageImage; import org.eclipse.osee.coverage.util.CoverageUtil; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -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.transaction.SkynetTransaction; @@ -55,7 +55,7 @@ public class NewCoveragePackageAction extends Action { if (!CoverageUtil.getBranchFromUser(false)) { return; } - Branch branch = CoverageUtil.getBranch(); + IOseeBranch branch = CoverageUtil.getBranch(); EntryDialog dialog = new EntryDialog(getText(), "Enter Coverage Package Name"); if (dialog.open() == 0) { CoveragePackage coveragePackage = 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 ebc185f0630..01c14577501 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 @@ -19,8 +19,8 @@ import org.eclipse.osee.coverage.store.OseeCoveragePackageStore; import org.eclipse.osee.coverage.util.CoverageImage; import org.eclipse.osee.coverage.util.CoverageUtil; import org.eclipse.osee.coverage.util.dialog.CoveragePackageArtifactListDialog; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -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; @@ -50,7 +50,7 @@ public class OpenCoveragePackageAction extends Action { if (!CoverageUtil.getBranchFromUser(false)) { return; } - Branch branch = CoverageUtil.getBranch(); + IOseeBranch branch = CoverageUtil.getBranch(); CoveragePackageArtifactListDialog dialog = new CoveragePackageArtifactListDialog("Open Coverage Package", "Select Coverage Package"); dialog.setInput(OseeCoveragePackageStore.getCoveragePackageArtifacts(branch)); 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 7c05162f3be..c4424560877 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 @@ -40,8 +40,8 @@ import org.eclipse.osee.coverage.model.CoverageUnit; import org.eclipse.osee.coverage.model.ICoverage; import org.eclipse.osee.coverage.model.IWorkProductTaskProvider; import org.eclipse.osee.coverage.util.ISaveable; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -332,8 +332,7 @@ public class CoverageXViewer extends XViewer implements ISelectedCoverageEditorI } @Override - public Branch getBranch() throws OseeCoreException { + public IOseeBranch getBranch() throws OseeCoreException { return xCoverageViewer.getSaveable().getBranch(); } - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePreferences.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePreferences.java index 618bda6b06a..4b32ad9fd97 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePreferences.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePreferences.java @@ -11,12 +11,12 @@ package org.eclipse.osee.coverage.model; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; @@ -29,10 +29,10 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; public class CoveragePreferences { private static String ARTIFACT_NAME = "Coverage Preferences"; - private final Branch branch; + private final IOseeBranch branch; private Artifact artifact; - public CoveragePreferences(Branch branch) { + public CoveragePreferences(IOseeBranch branch) { this.branch = branch; } diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java index 6955cb2271b..9c74986db07 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java @@ -22,7 +22,7 @@ import org.eclipse.osee.coverage.help.ui.CoverageHelpContext; import org.eclipse.osee.coverage.internal.Activator; import org.eclipse.osee.coverage.util.CoverageUtil; import org.eclipse.osee.framework.core.client.ClientSessionManager; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.plugin.core.IActionable; import org.eclipse.osee.framework.skynet.core.UserManager; @@ -85,7 +85,7 @@ public class CoverageNavigateView extends ViewPart implements IActionable { @Override public void handleEvent(Event event) { try { - Branch selectedBranch = xBranchSelectWidget.getData(); + IOseeBranch selectedBranch = xBranchSelectWidget.getData(); if (selectedBranch != null) { CoverageUtil.setNavigatorSelectedBranch(selectedBranch); } diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java index 8605de23bb8..69c1824f108 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java @@ -19,8 +19,8 @@ import org.eclipse.osee.coverage.model.CoveragePackage; import org.eclipse.osee.coverage.model.IWorkProductTaskProvider; import org.eclipse.osee.coverage.model.WorkProductAction; import org.eclipse.osee.coverage.model.WorkProductTask; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -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; @@ -32,10 +32,10 @@ import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService; public class DbWorkProductTaskProvider implements IWorkProductTaskProvider { private CoveragePackage coveragePackage; - private final Branch branch; + private final IOseeBranch branch; List<WorkProductAction> actions = new ArrayList<WorkProductAction>(); - public DbWorkProductTaskProvider(Branch branch) { + public DbWorkProductTaskProvider(IOseeBranch branch) { this.branch = branch; } @@ -73,7 +73,7 @@ public class DbWorkProductTaskProvider implements IWorkProductTaskProvider { } } - private void checkForErrorCase(List<String> relatedActionGuids, List<Artifact> relatedArtifacts, Branch branch) { + private void checkForErrorCase(List<String> relatedActionGuids, List<Artifact> relatedArtifacts, IOseeBranch branch) { boolean found = false; for (String guid : relatedActionGuids) { for (Artifact art : relatedArtifacts) { 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 11cbc0b02f9..3b2ee1de32d 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 @@ -31,12 +31,12 @@ import org.eclipse.osee.coverage.model.ICoverageUnitProvider; import org.eclipse.osee.coverage.model.IWorkProductRelatable; import org.eclipse.osee.coverage.util.ISaveable; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.PermissionEnum; 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.core.util.Result; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -67,7 +67,7 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave load(coverageOptionManager); } - public OseeCoveragePackageStore(CoveragePackage coveragePackage, Branch branch) { + public OseeCoveragePackageStore(CoveragePackage coveragePackage, IOseeBranch branch) { super(coveragePackage, CoverageArtifactTypes.CoveragePackage, branch); this.coveragePackage = coveragePackage; } @@ -76,7 +76,7 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave return coveragePackage; } - public static OseeCoveragePackageStore get(CoveragePackage coveragePackage, Branch branch) { + public static OseeCoveragePackageStore get(CoveragePackage coveragePackage, IOseeBranch branch) { return new OseeCoveragePackageStore(coveragePackage, branch); } @@ -225,7 +225,7 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave return coveragePackage.isEditable(); } - public static Collection<Artifact> getCoveragePackageArtifacts(Branch branch) throws OseeCoreException { + public static Collection<Artifact> getCoveragePackageArtifacts(IOseeBranch branch) throws OseeCoreException { return ArtifactQuery.getArtifactListFromType(CoverageArtifactTypes.CoveragePackage, branch); } 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 864e7232b4a..70145e6f3c7 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 @@ -16,9 +16,9 @@ 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; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -32,11 +32,11 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; */ public abstract class OseeCoverageStore extends CoverageStore { protected Artifact artifact; - protected Branch branch; + protected IOseeBranch branch; private final IArtifactType artifactType; private final ICoverage coverage; - public OseeCoverageStore(ICoverage coverage, IArtifactType artifactType, Branch branch) { + public OseeCoverageStore(ICoverage coverage, IArtifactType artifactType, IOseeBranch branch) { super(coverage); this.coverage = coverage; this.artifactType = artifactType; @@ -88,8 +88,7 @@ public abstract class OseeCoverageStore extends CoverageStore { public abstract Result save(SkynetTransaction transaction, CoveragePackageEvent coverageEvent) throws OseeCoreException; - public Branch getBranch() { + public IOseeBranch getBranch() { return branch; } - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitFileContentsProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitFileContentsProvider.java index 8ba263c334c..a357c89296f 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitFileContentsProvider.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitFileContentsProvider.java @@ -14,8 +14,8 @@ import java.util.logging.Level; import org.eclipse.osee.coverage.internal.Activator; import org.eclipse.osee.coverage.model.CoverageUnit; import org.eclipse.osee.coverage.model.ICoverageUnitFileContentsProvider; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -25,13 +25,13 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact; public class OseeCoverageUnitFileContentsProvider implements ICoverageUnitFileContentsProvider { private static OseeCoverageUnitFileContentsProvider instance; - private final Branch branch; + private final IOseeBranch branch; - private OseeCoverageUnitFileContentsProvider(Branch branch) { + private OseeCoverageUnitFileContentsProvider(IOseeBranch branch) { this.branch = branch; } - public static OseeCoverageUnitFileContentsProvider getInstance(Branch branch) { + public static OseeCoverageUnitFileContentsProvider getInstance(IOseeBranch branch) { if (instance == null) { instance = new OseeCoverageUnitFileContentsProvider(branch); } @@ -64,5 +64,4 @@ public class OseeCoverageUnitFileContentsProvider implements ICoverageUnitFileCo OseeLog.log(Activator.class, Level.SEVERE, ex); } } - -} +}
\ No newline at end of file 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 cd9b2028e2e..e08b3b6f889 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 @@ -28,9 +28,9 @@ import org.eclipse.osee.coverage.model.CoverageUnit; import org.eclipse.osee.coverage.model.ICoverage; import org.eclipse.osee.coverage.model.ITestUnitProvider; import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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.core.util.Result; import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -60,7 +60,7 @@ public class OseeCoverageUnitStore extends OseeCoverageStore { load(coverageOptionManager); } - public OseeCoverageUnitStore(CoverageUnit coverageUnit, Branch branch) { + public OseeCoverageUnitStore(CoverageUnit coverageUnit, IOseeBranch branch) { super(coverageUnit, coverageUnit.isFolder() ? CoverageArtifactTypes.CoverageFolder : CoverageArtifactTypes.CoverageUnit, branch); this.coverageUnit = coverageUnit; @@ -71,7 +71,7 @@ public class OseeCoverageUnitStore extends OseeCoverageStore { return unitStore.getCoverageUnit(); } - public static OseeCoverageUnitStore get(CoverageUnit coverageUnit, Branch branch) { + public static OseeCoverageUnitStore get(CoverageUnit coverageUnit, IOseeBranch branch) { return new OseeCoverageUnitStore(coverageUnit, branch); } 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 d510b3762bb..260661bd21c 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 @@ -28,6 +28,7 @@ import org.eclipse.osee.coverage.model.ICoverage; import org.eclipse.osee.coverage.model.ICoverageItemProvider; import org.eclipse.osee.coverage.model.ICoverageUnitProvider; import org.eclipse.osee.framework.core.client.ClientSessionManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.exception.BranchDoesNotExist; @@ -49,7 +50,7 @@ import org.eclipse.swt.widgets.Listener; */ public class CoverageUtil { - private static Branch branch = null; + private static IOseeBranch branch = null; private static List<Listener> branchChangeListeners = new ArrayList<Listener>(); public static boolean getBranchFromUser(boolean force) throws OseeCoreException { @@ -150,11 +151,11 @@ public class CoverageUtil { } } - public static Branch getBranch() { + public static IOseeBranch getBranch() { return branch; } - public static void setNavigatorSelectedBranch(Branch branch) { + public static void setNavigatorSelectedBranch(IOseeBranch branch) { CoverageUtil.branch = branch; for (Listener listener : branchChangeListeners) { listener.handleEvent(null); diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/ISaveable.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/ISaveable.java index d2b29180155..39f7a33a214 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/ISaveable.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/ISaveable.java @@ -13,8 +13,8 @@ package org.eclipse.osee.coverage.util; import java.util.Collection; import org.eclipse.osee.coverage.model.CoverageImport; import org.eclipse.osee.coverage.model.ICoverage; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.util.Result; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; @@ -31,5 +31,5 @@ public interface ISaveable { public Result isEditable(); - public Branch getBranch() throws OseeCoreException; + public IOseeBranch getBranch() throws OseeCoreException; } diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/jobs/ImportTraceUnitsOperationTest.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/jobs/ImportTraceUnitsOperationTest.java index 004588d211c..a06b6f1f5ff 100644 --- a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/jobs/ImportTraceUnitsOperationTest.java +++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/jobs/ImportTraceUnitsOperationTest.java @@ -47,7 +47,8 @@ public final class ImportTraceUnitsOperationTest { private static final String TEST_ONE_FILE = "ImportTraceUnitsTest1.txt"; private static final String TEST_TWO_FILE = "ImportTraceUnitsTest2.txt"; - private static final IOseeBranch TEST_BRANCH = TokenFactory.createBranch("BIkSWxVrZClFHss6FTAA", "Trace Unit Branch"); + private static final IOseeBranch TEST_BRANCH = + TokenFactory.createBranch("BIkSWxVrZClFHss6FTAA", "Trace Unit Branch"); private static final int RUNS = 3; private Branch importToBranch; @@ -64,11 +65,9 @@ public final class ImportTraceUnitsOperationTest { @Before public void setup() throws OseeCoreException { if (BranchManager.branchExists(TEST_BRANCH)) { - Branch branch = BranchManager.getBranch(TEST_BRANCH); - BranchManager.purgeBranch(branch); + BranchManager.purgeBranch(TEST_BRANCH); } - Branch baseBranch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_2); - importToBranch = BranchManager.createWorkingBranch(baseBranch, TEST_BRANCH, UserManager.getUser()); + importToBranch = BranchManager.createWorkingBranch(DemoSawBuilds.SAW_Bld_2, TEST_BRANCH, UserManager.getUser()); } @After diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java index 672121ad9fc..c0616a24025 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java @@ -14,7 +14,7 @@ import java.io.File; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.ui.plugin.util.DirectoryOrFileSelector; import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectComposite; import org.eclipse.swt.SWT; @@ -123,7 +123,7 @@ public class ImportTraceabilityPage extends WizardDataTransferPage { return directoryFileSelector.getFile(); } - public Branch getSelectedBranch() { + public IOseeBranch getSelectedBranch() { return branchSelectComposite.getSelectedBranch(); } diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java index 578bad31d91..3be01de0ce4 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java @@ -14,7 +14,7 @@ import java.io.File; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.osee.define.DefinePlugin; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.operation.Operations; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -36,7 +36,7 @@ public class ImportTraceabilityWizard extends Wizard implements IImportWizard { @Override public boolean performFinish() { try { - Branch branch = mainPage.getSelectedBranch(); + IOseeBranch branch = mainPage.getSelectedBranch(); File file = mainPage.getImportFile(); Operations.executeWorkAndCheckStatus(new ScriptTraceabilityOperation(file, branch, true)); } catch (Exception ex) { diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java index 893715f5c76..a63c37a932c 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java @@ -21,11 +21,11 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.define.DefinePlugin; import org.eclipse.osee.define.traceability.data.RequirementData; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeStateException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.CountingMap; import org.eclipse.osee.framework.jdk.core.type.HashCollection; import org.eclipse.osee.framework.jdk.core.type.Pair; @@ -58,7 +58,7 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation { private int pathPrefixLength; private final boolean writeOutResults; - public ScriptTraceabilityOperation(File file, Branch branch, boolean writeOutResults) throws IOException { + public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults) throws IOException { super("Importing Traceability", DefinePlugin.PLUGIN_ID); this.file = file; this.requirementData = new RequirementData(branch); diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/CodeUnitData.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/CodeUnitData.java index 8810e383917..a5bd7c31744 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/CodeUnitData.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/CodeUnitData.java @@ -15,8 +15,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; @@ -27,7 +27,7 @@ public class CodeUnitData extends BaseTraceDataCache { private final Map<String, Artifact> codeUnitMap; - public CodeUnitData(Branch branch) { + public CodeUnitData(IOseeBranch branch) { super("Code Unit Data", branch); this.codeUnitMap = new HashMap<String, Artifact>(); } diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/TestUnitData.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/TestUnitData.java index 48e88200aaa..27b41866d92 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/TestUnitData.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/TestUnitData.java @@ -18,8 +18,8 @@ import java.util.Set; import java.util.TreeSet; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; @@ -37,7 +37,7 @@ public class TestUnitData extends BaseTraceDataCache { private final HashMap<String, Artifact> testProcedureMap; private final HashMap<String, Artifact> testSupportMap; - public TestUnitData(Branch branch) { + public TestUnitData(IOseeBranch branch) { super("Test Unit Data", branch); this.testCaseMap = new HashMap<String, Artifact>(); this.testProcedureMap = new HashMap<String, Artifact>(); diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java index 33e443beb4d..87ae515bef7 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java @@ -28,6 +28,8 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.define.DefinePlugin; import org.eclipse.osee.define.traceability.TraceUnitExtensionManager; import org.eclipse.osee.define.traceability.TraceUnitExtensionManager.TraceHandler; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.MutableBoolean; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -278,7 +280,7 @@ public class ImportTraceUnitPage extends WizardDataTransferPage { protected boolean validateSourceGroup() { boolean result = directoryFileSelector.validate(this); if (result) { - Branch branch = getSelectedBranch(); + IOseeBranch branch = getSelectedBranch(); if (branch == null) { result = false; setErrorMessage("Please select a valid working branch"); @@ -305,7 +307,7 @@ public class ImportTraceUnitPage extends WizardDataTransferPage { return isWidgetAccessible(directoryFileSelector) ? directoryFileSelector.getFile().toURI() : null; } - public Branch getSelectedBranch() { + public IOseeBranch getSelectedBranch() { return isWidgetAccessible(branchSelectComposite) ? branchSelectComposite.getSelectedBranch() : null; } @@ -399,9 +401,13 @@ public class ImportTraceUnitPage extends WizardDataTransferPage { super.saveWidgetValues(); IDialogSettings settings = getDialogSettings(); if (settings != null) { - Branch branch = getSelectedBranch(); + IOseeBranch branch = getSelectedBranch(); if (branch != null) { - settings.put(BRANCH_KEY, branch.getId()); + try { + settings.put(BRANCH_KEY, BranchManager.getBranchId(branch)); + } catch (OseeCoreException ex) { + OseeLog.log(DefinePlugin.class, Level.SEVERE, ex); + } } settings.put(SELECTED_TRACE_HANDLERS_KEY, getTraceUnitHandlerIds()); diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java index d15e63abbe9..a605ed53fa9 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java @@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.osee.define.DefinePlugin; import org.eclipse.osee.define.traceability.operations.ImportTraceUnitsOperation; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.operation.IOperation; import org.eclipse.osee.framework.core.operation.Operations; import org.eclipse.osee.framework.logging.OseeLevel; @@ -39,7 +39,7 @@ public class ImportTraceUnitWizard extends Wizard implements IImportWizard { @Override public boolean performFinish() { try { - Branch importToBranch = page.getSelectedBranch(); + IOseeBranch importToBranch = page.getSelectedBranch(); boolean isRecursive = page.isFolderRecursionAllowed(); boolean isPersistChanges = page.isArtifactPersistanceAllowed(); URI source = page.getSourceURI(); diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java index 11956a9a97e..0382fc86305 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java @@ -16,22 +16,22 @@ import java.util.HashSet; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.nebula.widgets.xviewer.Activator; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.operation.AbstractOperation; /** * @author Roberto E. Escobar */ public class ImportTraceUnitsOperation extends AbstractOperation { - private final Branch importToBranch; + private final IOseeBranch importToBranch; private final boolean isRecursive; private final boolean isPersistChanges; private final boolean fileWithMultiPaths; private final URI source; private final String[] traceTypeIds; - public ImportTraceUnitsOperation(String jobName, Branch importToBranch, URI source, boolean isRecursive, boolean isPersistChanges, boolean fileWithMultiPaths, String... traceHandlerIds) { + public ImportTraceUnitsOperation(String jobName, IOseeBranch importToBranch, URI source, boolean isRecursive, boolean isPersistChanges, boolean fileWithMultiPaths, String... traceHandlerIds) { super("ImportTraceUnitsOperation", Activator.PLUGIN_ID); this.importToBranch = importToBranch; this.source = source; diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java index 6bd57e72e4f..c28bd830f11 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java @@ -22,12 +22,13 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.osee.define.traceability.TraceUnitExtensionManager; import org.eclipse.osee.define.traceability.TraceUnitExtensionManager.TraceHandler; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.Collections; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; /** * @author Roberto E. Escobar @@ -64,7 +65,7 @@ public class TraceUnitFromResourceOperation { operation.execute(monitor); } - public static void importTraceFromTestUnits(IProgressMonitor monitor, URI source, boolean isRecursive, boolean isFileWithMultiplePaths, Branch importToBranch, String... traceUnitHandlerIds) throws OseeCoreException { + public static void importTraceFromTestUnits(IProgressMonitor monitor, URI source, boolean isRecursive, boolean isFileWithMultiplePaths, IOseeBranch importToBranch, String... traceUnitHandlerIds) throws OseeCoreException { checkBranchArguments(importToBranch); ResourceToTraceUnit operation = @@ -110,13 +111,13 @@ public class TraceUnitFromResourceOperation { } } - private static void checkBranchArguments(Branch importToBranch) throws OseeArgumentException { + private static void checkBranchArguments(IOseeBranch importToBranch) throws OseeCoreException { if (importToBranch == null) { throw new OseeArgumentException("Branch to import into was null"); } - if (!importToBranch.getBranchType().isOfType(BranchType.WORKING)) { - throw new OseeArgumentException("Branch to import into was not a working branch: [%s]", - importToBranch); + BranchType branchType = BranchManager.getBranch(importToBranch).getBranchType(); + if (!branchType.isOfType(BranchType.WORKING)) { + throw new OseeArgumentException("Branch to import into was not a working branch: [%s]", importToBranch); } } } diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java index 90c4f039f16..10a7d3bebfc 100644 --- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java +++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java @@ -32,6 +32,7 @@ import org.eclipse.osee.define.traceability.data.TestUnitData; import org.eclipse.osee.define.traceability.data.TraceMark; import org.eclipse.osee.define.traceability.data.TraceUnit; import org.eclipse.osee.framework.core.data.IArtifactType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.IRelationTypeSide; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -39,7 +40,6 @@ import org.eclipse.osee.framework.core.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.HashCollection; import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.jdk.core.util.GUID; @@ -69,14 +69,14 @@ public class TraceUnitToArtifactProcessor implements ITraceUnitProcessor { private CodeUnitData codeUnitData; private TestUnitData testUnitData; - private final Branch importIntoBranch; + private final IOseeBranch importIntoBranch; private SkynetTransaction transaction; private final HashCollection<TraceUnit, TraceMark> reportTraceNotFound; private final HashCollection<String, String> unknownRelationError; private final Set<String> unRelatedUnits; - public TraceUnitToArtifactProcessor(Branch importIntoBranch) { + public TraceUnitToArtifactProcessor(IOseeBranch importIntoBranch) { this.importIntoBranch = importIntoBranch; this.reportTraceNotFound = new HashCollection<TraceUnit, TraceMark>(false, HashSet.class); this.unknownRelationError = new HashCollection<String, String>(false, HashSet.class); diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java index 6090c4841ac..a335653c4e1 100644 --- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java +++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java @@ -77,7 +77,7 @@ public class BranchAccessObject extends AccessObject { } public static BranchAccessObject getBranchAccessObjectFromCache(IOseeBranch branch) throws OseeCoreException { - return cache.get(BranchManager.getBranch(branch).getId()); + return cache.get(BranchManager.getBranchId(branch)); } @Override diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java index 5d6ae1c27c2..e4c42dd0051 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java @@ -46,8 +46,8 @@ public final class ArtifactDataAccessor implements ArtifactDataProvider { if (object instanceof Artifact) { final Artifact artifact = (Artifact) object; proxy = new XArtifactProxy(artifact); - } else if (object instanceof Branch) { - Branch branch = (Branch) object; + } else if (object instanceof IOseeBranch) { + IOseeBranch branch = (Branch) object; final Artifact artifact = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch); proxy = new XArtifactProxy(artifact); } diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java index dd9ae6a2c34..393a0bbb897 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java @@ -11,8 +11,8 @@ package org.eclipse.osee.framework.core.model.access.exp; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.PermissionEnum; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.IBasicArtifact; public class AttributeTypeAccessFilter implements IAccessFilter { @@ -35,7 +35,7 @@ public class AttributeTypeAccessFilter implements IAccessFilter { @Override public boolean acceptToObject(Object object) { //Return false if the object to be checked is a branch or artifact. - return !(object instanceof Branch) && !(object instanceof IBasicArtifact<?>); + return !(object instanceof IOseeBranch) && !(object instanceof IBasicArtifact<?>); } @Override 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 5f1f1558732..8084875c864 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 @@ -13,19 +13,15 @@ package org.eclipse.osee.framework.skynet.core.artifact; import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; import static org.junit.Assert.assertTrue; - import java.util.Arrays; 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.model.Branch; 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; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; /** @@ -48,10 +44,9 @@ public class Artifact_setAttributeValues { @org.junit.Test public void testSetAttributeValues() throws Exception { - Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Assert.assertNotNull(branch); Artifact artifact = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, branch, getClass().getSimpleName()); + ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, + getClass().getSimpleName()); artifact.setAttributeValues(CoreAttributeTypes.StaticId, firstSet); artifact.persist(); @@ -102,17 +97,13 @@ public class Artifact_setAttributeValues { } private Artifact getArtifact() throws Exception { - Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Assert.assertNotNull(branch); - return ArtifactQuery.getArtifactListFromName(getClass().getSimpleName(), branch, EXCLUDE_DELETED).iterator().next(); + return ArtifactQuery.getArtifactListFromName(getClass().getSimpleName(), DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED).iterator().next(); } private static void cleanup() throws Exception { - Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Assert.assertNotNull(branch); Collection<Artifact> arts = - ArtifactQuery.getArtifactListFromName(Artifact_setAttributeValues.class.getSimpleName(), branch, - EXCLUDE_DELETED); + ArtifactQuery.getArtifactListFromName(Artifact_setAttributeValues.class.getSimpleName(), + DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED); new PurgeArtifacts(arts).execute(); } } 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 f102ed0af5a..ed3ebb89bbe 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 @@ -13,10 +13,8 @@ package org.eclipse.osee.framework.skynet.core.artifact; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; - import java.util.Arrays; import java.util.Collection; - import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.jobs.Job; @@ -135,8 +133,7 @@ public class BranchStateTest { assertEquals(BranchState.MODIFIED, workingBranch.getBranchState()); assertTrue(workingBranch.isEditable()); - ConflictManagerExternal conflictManager = - new ConflictManagerExternal(BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), workingBranch); + ConflictManagerExternal conflictManager = new ConflictManagerExternal(DemoSawBuilds.SAW_Bld_1, workingBranch); BranchManager.commitBranch(null, conflictManager, true, false); assertEquals(BranchState.COMMITTED, workingBranch.getBranchState()); @@ -253,8 +250,8 @@ public class BranchStateTest { Artifact sameArtifact = null; try { baseArtifact = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.SoftwareRequirement, - BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), "Test Object"); + ArtifactTypeManager.addArtifact(CoreArtifactTypes.SoftwareRequirement, DemoSawBuilds.SAW_Bld_1, + "Test Object"); baseArtifact.setSoleAttributeFromString(CoreAttributeTypes.Annotation, "This is the base annotation"); baseArtifact.persist(); 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 507904beeb5..64af5545006 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 @@ -15,14 +15,11 @@ import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; - import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.util.Collection; - import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; -import org.eclipse.osee.framework.core.model.Branch; 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; @@ -42,8 +39,7 @@ public class NativeArtifactTest { @org.junit.Test public void testNativeArtifact() throws Exception { - CsvArtifact csvArtifact = - CsvArtifact.getCsvArtifact(getClass().getSimpleName(), BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), true); + CsvArtifact csvArtifact = CsvArtifact.getCsvArtifact(getClass().getSimpleName(), DemoSawBuilds.SAW_Bld_1, true); assertNotNull(csvArtifact); Artifact artifact = csvArtifact.getArtifact(); assertTrue(artifact.isAttributeTypeValid(CoreAttributeTypes.NativeContent)); @@ -88,14 +84,12 @@ public class NativeArtifactTest { } private Artifact getNativeArtifact() throws Exception { - Branch branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); - return CsvArtifact.getCsvArtifact(getClass().getSimpleName(), branch, false).getArtifact(); + return CsvArtifact.getCsvArtifact(getClass().getSimpleName(), DemoSawBuilds.SAW_Bld_1, false).getArtifact(); } private void cleanup() throws Exception { - Branch branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); Collection<Artifact> arts = - ArtifactQuery.getArtifactListFromName(getClass().getSimpleName(), branch, EXCLUDE_DELETED); + ArtifactQuery.getArtifactListFromName(getClass().getSimpleName(), DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED); new PurgeArtifacts(arts).execute(); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java index eb15ef7caaf..74c44e80bc3 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java @@ -17,10 +17,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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.IOperation; import org.eclipse.osee.framework.core.test.mocks.Asserts; import org.eclipse.osee.framework.database.core.ConnectionHandler; @@ -35,7 +35,7 @@ import org.eclipse.osee.support.test.util.TestUtil; * @author Ryan Schmitt */ public class PurgeTransactionTest { - private Branch branch; + private IOseeBranch branch; Collection<Artifact> softArts; private SkynetTransaction createTransaction; private SkynetTransaction modifyTransaction; @@ -66,7 +66,7 @@ public class PurgeTransactionTest { } private void init() throws Exception { - branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_2); + branch = DemoSawBuilds.SAW_Bld_2; preCreateCount = new HashMap<String, Integer>(); preModifyCount = new HashMap<String, Integer>(); postModifyPurgeCount = new HashMap<String, Integer>(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ReplaceWithAttributeTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ReplaceWithAttributeTest.java index e2fd5b61b07..d3ff6c795e1 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ReplaceWithAttributeTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ReplaceWithAttributeTest.java @@ -15,13 +15,10 @@ import static org.junit.Assert.assertTrue; 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.model.Branch; 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.Attribute; -import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.support.test.util.DemoSawBuilds; -import org.junit.Assert; /** * @author Jeff C. Phillips @@ -30,10 +27,9 @@ public class ReplaceWithAttributeTest { @org.junit.Test public void testReplaceAttributeVersion() throws Exception { - Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Assert.assertNotNull(branch); Artifact artifact = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, branch, getClass().getSimpleName()); + ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, + getClass().getSimpleName()); artifact.setAttributeValues(CoreAttributeTypes.Name, Collections.singletonList("Name")); artifact.persist(); 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 5a981be75a4..a9277832089 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 @@ -11,16 +11,13 @@ package org.eclipse.osee.framework.skynet.core.relation; import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; - import java.util.ArrayList; 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.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; 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; @@ -57,18 +54,15 @@ public class CrossBranchLinkTest { artifacts.addAll(ArtifactQuery.getArtifactListFromName(CrossBranchLinkTest.class.getSimpleName() + "%", BranchManager.getCommonBranch(), EXCLUDE_DELETED)); artifacts.addAll(ArtifactQuery.getArtifactListFromName(CrossBranchLinkTest.class.getSimpleName() + "%", - BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()), EXCLUDE_DELETED)); + DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED)); new PurgeArtifacts(artifacts).execute(); TestUtil.sleep(4000); } @Test public void testCrossBranchLink() throws OseeCoreException { - Branch sawBranch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); - Assert.assertNotNull(sawBranch); - Artifact artifact1 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, sawBranch, + ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, getClass().getSimpleName() + "-1"); artifact1.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); artifact1.persist(); @@ -90,7 +84,7 @@ public class CrossBranchLinkTest { Assert.assertEquals(artifact1, link.getArtifact()); Artifact artifact2 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, sawBranch, + ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, getClass().getSimpleName() + "-2"); artifact2.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); artifact2.persist(); @@ -98,7 +92,7 @@ public class CrossBranchLinkTest { CrossBranchLinkManager.addRelation(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo, artifact2); Artifact artifact3 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, sawBranch, + ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, getClass().getSimpleName() + "-3"); artifact3.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); artifact3.persist(); 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 76b73ec1356..b0434824a4c 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 @@ -11,7 +11,6 @@ package org.eclipse.osee.framework.skynet.core.util; import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; - import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -21,7 +20,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; - import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchArchivedState; @@ -48,7 +46,7 @@ public class FrameworkTestUtil { /** * Creates a simple artifact and adds it to the root artifact default hierarchical relation */ - public static Artifact createSimpleArtifact(IArtifactType artifactType, String name, Branch branch) throws OseeCoreException { + public static Artifact createSimpleArtifact(IArtifactType artifactType, String name, IOseeBranch branch) throws OseeCoreException { Artifact softArt = ArtifactTypeManager.addArtifact(artifactType, branch); softArt.setName(name); softArt.addAttribute(CoreAttributeTypes.Subsystem, "Electrical"); @@ -57,7 +55,7 @@ public class FrameworkTestUtil { return softArt; } - public static Collection<Artifact> createSimpleArtifacts(IArtifactType artifactType, int numArts, String name, Branch branch) throws OseeCoreException { + public static Collection<Artifact> createSimpleArtifacts(IArtifactType artifactType, int numArts, String name, IOseeBranch branch) throws OseeCoreException { List<Artifact> arts = new ArrayList<Artifact>(); for (int x = 1; x < numArts + 1; x++) { arts.add(createSimpleArtifact(artifactType, name + " " + x, branch)); 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 41834a23aa9..553b8875e67 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 @@ -14,11 +14,8 @@ package org.eclipse.osee.framework.skynet.core.utility; 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.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.support.test.util.DemoSawBuilds; @@ -39,7 +36,7 @@ public class CsvArtifactTest { @org.junit.Test public void testCreateCsvArtifact() throws Exception { - CsvArtifact csv = CsvArtifact.getCsvArtifact(id, BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), true); + CsvArtifact csv = CsvArtifact.getCsvArtifact(id, DemoSawBuilds.SAW_Bld_1, true); assertEquals(csv.getCsvData(), ""); csv.getArtifact().setName(id); csv.setCsvData(csvData); @@ -48,7 +45,7 @@ public class CsvArtifactTest { @org.junit.Test public void testgetCsvArtifactAndAppendData() throws Exception { - CsvArtifact csvArt = CsvArtifact.getCsvArtifact(id, BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), false); + CsvArtifact csvArt = CsvArtifact.getCsvArtifact(id, DemoSawBuilds.SAW_Bld_1, false); assertNotNull(csvArt); assertEquals(csvData, csvArt.getCsvData()); csvArt.appendData(appendData); @@ -57,7 +54,7 @@ public class CsvArtifactTest { @org.junit.Test public void testCsvGetData() throws Exception { - CsvArtifact csvArt = CsvArtifact.getCsvArtifact(id, BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), false); + CsvArtifact csvArt = CsvArtifact.getCsvArtifact(id, DemoSawBuilds.SAW_Bld_1, false); assertNotNull(csvArt); assertEquals(csvData + "\n" + appendData, csvArt.getCsvData()); } @@ -68,8 +65,7 @@ public class CsvArtifactTest { } private void cleanup() throws Exception { - Collection<Artifact> arts = - ArtifactQuery.getArtifactListFromName(id, BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), EXCLUDE_DELETED); + Collection<Artifact> arts = ArtifactQuery.getArtifactListFromName(id, DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED); new PurgeArtifacts(arts).execute(); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java index 73deba3b7ec..ddb5474d48d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java @@ -70,8 +70,7 @@ public final class OseeSystemArtifacts { artifact = ArtifactQuery.checkArtifactFromTypeAndName(artifactType, artifactName, branch); if (artifact == null && create) { if (Strings.isValid(guid)) { - artifact = - ArtifactTypeManager.addArtifact(artifactType, BranchManager.getBranch(branch), guid, (String) null); + artifact = ArtifactTypeManager.addArtifact(artifactType, branch, guid, (String) null); artifact.setName(artifactName); } else { artifact = ArtifactTypeManager.addArtifact(artifactType, branch, artifactName); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java index 9a6c2cc2642..005137c1143 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java @@ -15,8 +15,8 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.Collection; import java.util.HashSet; - import org.eclipse.osee.framework.core.data.IArtifactType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.SystemUser; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; @@ -123,7 +123,7 @@ public class User extends Artifact { setSetting(CoreAttributeTypes.FavoriteBranch.getName(), favoriteBranch.getGuid()); } - public boolean isFavoriteBranch(Branch branch) throws OseeCoreException { + public boolean isFavoriteBranch(IOseeBranch branch) throws OseeCoreException { Collection<Attribute<String>> attributes = getAttributes(CoreAttributeTypes.FavoriteBranch); for (Attribute<String> attribute : attributes) { if (branch.getGuid().equals(attribute.getValue())) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java index cfdd63b1b1f..49f19bdf897 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java @@ -19,6 +19,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.TxChange; import org.eclipse.osee.framework.core.exception.OseeCoreException; @@ -47,11 +48,11 @@ public class ArtifactPersistenceManager { private static final String RELATION_NEW_ON_BRANCH = "SELECT count(1) FROM osee_relation_link rel, osee_txs txs WHERE rel.a_art_id = ? and rel.b_art_id = ? and rel.rel_link_type_id = ? and rel.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id = ?"; - public static CharSequence getSelectArtIdSql(ISearchPrimitive searchCriteria, List<Object> dataList, Branch branch) { + public static CharSequence getSelectArtIdSql(ISearchPrimitive searchCriteria, List<Object> dataList, IOseeBranch branch) throws OseeCoreException { return getSelectArtIdSql(searchCriteria, dataList, null, branch); } - private static CharSequence getSelectArtIdSql(ISearchPrimitive searchCriteria, List<Object> dataList, String alias, Branch branch) { + private static CharSequence getSelectArtIdSql(ISearchPrimitive searchCriteria, List<Object> dataList, String alias, IOseeBranch branch) throws OseeCoreException { StringBuilder sql = new StringBuilder(); sql.append("SELECT "); @@ -74,11 +75,11 @@ public class ArtifactPersistenceManager { return sql; } - public static String getIdSql(List<ISearchPrimitive> searchCriteria, boolean all, List<Object> dataList, Branch branch) { + public static String getIdSql(List<ISearchPrimitive> searchCriteria, boolean all, List<Object> dataList, IOseeBranch branch) throws OseeCoreException { return getSql(searchCriteria, all, ARTIFACT_ID_SELECT, dataList, branch); } - private static String getSql(List<ISearchPrimitive> searchCriteria, boolean all, String header, List<Object> dataList, Branch branch) { + private static String getSql(List<ISearchPrimitive> searchCriteria, boolean all, String header, List<Object> dataList, IOseeBranch branch) throws OseeCoreException { StringBuilder sql = new StringBuilder(header); if (all) { @@ -118,9 +119,9 @@ public class ArtifactPersistenceManager { } @Deprecated - public static Collection<Artifact> getArtifacts(List<ISearchPrimitive> searchCriteria, boolean all, Branch branch, ISearchConfirmer confirmer) throws OseeCoreException { + public static Collection<Artifact> getArtifacts(List<ISearchPrimitive> searchCriteria, boolean all, IOseeBranch branch, ISearchConfirmer confirmer) throws OseeCoreException { LinkedList<Object> queryParameters = new LinkedList<Object>(); - queryParameters.add(branch.getId()); + queryParameters.add(BranchManager.getBranchId(branch)); return ArtifactLoader.getArtifacts(getSql(searchCriteria, all, ARTIFACT_SELECT, queryParameters, branch), queryParameters.toArray(), 100, LoadLevel.FULL, INCLUDE_CACHE, confirmer, null, EXCLUDE_DELETED); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java index 017e435d64d..886f6a06860 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java @@ -74,7 +74,7 @@ public class ArtifactTypeManager { return getAllTypes(); } - public static Collection<ArtifactType> getConcreteArtifactTypes(Branch branch) throws OseeCoreException { + public static Collection<ArtifactType> getConcreteArtifactTypes(IOseeBranch branch) throws OseeCoreException { Collection<ArtifactType> types = getAllTypes(); Iterator<ArtifactType> iterator = types.iterator(); while (iterator.hasNext()) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java index 1a835f25caa..19463a53774 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java @@ -225,7 +225,7 @@ public class BranchManager { return Operations.executeAsJob(operation, true); } - public static void purgeBranch(final Branch branch) throws OseeCoreException { + public static void purgeBranch(final IOseeBranch branch) throws OseeCoreException { Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(branch, false)); } @@ -248,20 +248,22 @@ public class BranchManager { * Delete a branch from the system. (This operation will set the branch state to deleted. This operation is * undo-able) */ - public static Job deleteBranch(final Branch branch) { + public static Job deleteBranch(final IOseeBranch branch) { return Operations.executeAsJob(new DeleteBranchOperation(branch), true); } - public static IStatus deleteBranchAndPend(final Branch branch) { + public static IStatus deleteBranchAndPend(final IOseeBranch branch) { return Operations.executeWork(new DeleteBranchOperation(branch)); } /** * Delete branches from the system. (sets branch state to deleted. operation is undo-able) + * + * @throws OseeCoreException */ - public static Job deleteBranch(final List<Branch> branches) { + public static Job deleteBranch(final List<? extends IOseeBranch> branches) { List<IOperation> ops = new ArrayList<IOperation>(); - for (Branch branch : branches) { + for (IOseeBranch branch : branches) { ops.add(new DeleteBranchOperation(branch)); } return Operations.executeAsJob(new CompositeOperation("Deleting multiple branches...", Activator.PLUGIN_ID, ops), @@ -465,7 +467,7 @@ public class BranchManager { return getCommonBranch(); } - public static Branch getLastBranch() { + public static IOseeBranch getLastBranch() { if (instance.lastBranch == null) { instance.initializeLastBranchValue(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java index bc4bc1c4263..bf2817ed44d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java @@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.artifact; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.model.Branch; @@ -23,15 +24,16 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator; */ public class DeleteBranchOperation extends AbstractOperation { - private final Branch branch; + private final IOseeBranch branch; - public DeleteBranchOperation(Branch branch) { + public DeleteBranchOperation(IOseeBranch branch) { super("Delete Branch: " + branch, Activator.PLUGIN_ID); this.branch = branch; } @Override protected void doWork(IProgressMonitor monitor) throws Exception { + Branch branch = BranchManager.getBranch(this.branch); BranchState originalState = branch.getBranchState(); BranchArchivedState originalArchivedState = branch.getArchiveState(); try { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactHridSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactHridSearch.java index bd18f23c22e..d48e11f2070 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactHridSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactHridSearch.java @@ -12,7 +12,8 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import static org.eclipse.osee.framework.skynet.core.artifact.search.DeprecatedOperator.EQUAL; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; /** * @author Robert A. Fisher @@ -43,7 +44,7 @@ public class ArtifactHridSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { String sql = "osee_artifact.human_readable_id" + operator + "?"; dataList.add(humanReadableId); @@ -51,7 +52,7 @@ public class ArtifactHridSearch implements ISearchPrimitive { } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return "osee_artifact"; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java index 0dfaa13d5c9..9e399c92e7c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java @@ -53,7 +53,7 @@ import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact public class ArtifactQuery { public static Artifact getArtifactFromToken(IArtifactToken artifactToken, IOseeBranch branch) throws OseeCoreException { - return getArtifactFromId(artifactToken.getGuid(), BranchManager.getBranch(branch)); + return getArtifactFromId(artifactToken.getGuid(), branch); } public static Artifact getArtifactFromToken(EventBasicGuidArtifact guidArt) throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java index 5a238658005..34645ce9019 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java @@ -11,7 +11,8 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; /** * @author Robert A. Fisher @@ -34,7 +35,7 @@ public class ArtifactTypeSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { String sql = "osee_artifact_type.name" + operation + " ? AND osee_artifact_type.art_type_id = osee_artifact.art_type_id"; dataList.add(typeName); @@ -43,7 +44,7 @@ public class ArtifactTypeSearch implements ISearchPrimitive { } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return tables; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java index 16365a90f38..7dc082e9f31 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java @@ -12,7 +12,9 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import static org.eclipse.osee.framework.skynet.core.artifact.search.DeprecatedOperator.IS; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; /** * @author Robert A. Fisher @@ -57,7 +59,7 @@ public class AttributeValueSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { StringBuilder sql = new StringBuilder(); if (operator == DeprecatedOperator.LIKE || operator == DeprecatedOperator.CONTAINS) { @@ -69,7 +71,7 @@ public class AttributeValueSearch implements ISearchPrimitive { sql.append(" AND attr_type_1.attr_type_id = attr_1.attr_type_id AND attr_1.gamma_id = txs.gamma_id AND txs.tx_current = 1 and txs.branch_id = ?"); - dataList.add(branch.getId()); + dataList.add(BranchManager.getBranchId(branch)); if (attributeValue != null) { sql.append(" AND attr_1.value "); @@ -85,7 +87,7 @@ public class AttributeValueSearch implements ISearchPrimitive { } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return tables; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/FromArtifactsSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/FromArtifactsSearch.java index c9db6ff4b12..97d1c8eefe7 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/FromArtifactsSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/FromArtifactsSearch.java @@ -12,7 +12,8 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.ArrayList; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager; import org.w3c.dom.Document; @@ -45,12 +46,12 @@ public class FromArtifactsSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { return "art_id in (" + ArtifactPersistenceManager.getIdSql(criteria, all, dataList, branch) + ")"; } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return "osee_artifact"; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ISearchPrimitive.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ISearchPrimitive.java index d9b71cce90a..01ead46aa3e 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ISearchPrimitive.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ISearchPrimitive.java @@ -11,7 +11,8 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; public interface ISearchPrimitive { @@ -19,8 +20,9 @@ public interface ISearchPrimitive { * The sql operators that will provide a set of art_id's for the given search. * * @return Return SQL string + * @throws OseeCoreException TODO */ - public String getCriteriaSql(List<Object> dataList, Branch branch); + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException; /** * The name of the column to use as the art_id column. @@ -33,9 +35,9 @@ public interface ISearchPrimitive { * Returns a list of the tables, comma separated, that are necessary for the sql statement returned from getSql(). * * @return tables string - * @see ISearchPrimitive#getCriteriaSql(List, Branch) + * @see ISearchPrimitive#getCriteriaSql(List, IOseeBranch) */ - public String getTableSql(List<Object> dataList, Branch branch); + public String getTableSql(List<Object> dataList, IOseeBranch branch); /** * Returns a string which can be used to later re-acquire the primitive in full diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java index 2fef8450652..88c5aa9017e 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java @@ -11,10 +11,12 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.List; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.IRelationTypeSide; import org.eclipse.osee.framework.core.enums.ModificationType; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; /** * @author Robert A. Fisher @@ -94,7 +96,7 @@ public class InRelationSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { StringBuffer sql = new StringBuffer(); boolean first = true; @@ -127,14 +129,14 @@ public class InRelationSearch implements ISearchPrimitive { } sql.append(" AND rel_1.gamma_id = txs1.gamma_id AND txs1.transaction_id = (SELECT max(txs1.transaction_id) FROM osee_relation_link rel2, osee_txs txs1 WHERE rel2.rel_link_id = rel_1.rel_link_id AND rel2.gamma_id = txs1.gamma_id AND txs1.branch_id = ? AND txs1.mod_type <>?)"); - dataList.add(branch.getId()); + dataList.add(BranchManager.getBranchId(branch)); dataList.add(ModificationType.DELETED.getValue()); return sql.toString(); } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return relationTables; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/NotSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/NotSearch.java index 8aed9347300..2dd93197f01 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/NotSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/NotSearch.java @@ -11,7 +11,8 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.List; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager; /** @@ -26,7 +27,7 @@ public class NotSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { return "NOT EXISTS(SELECT 'x' FROM (" + ArtifactPersistenceManager.getSelectArtIdSql(search, dataList, branch) + ") arts" + " WHERE osee_artifact.art_id = arts." + search.getArtIdColName() + ")"; } @@ -36,7 +37,7 @@ public class NotSearch implements ISearchPrimitive { } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return "osee_artifact"; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java index 0f547917fb4..88df774c56b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java @@ -12,11 +12,12 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import java.util.List; import org.eclipse.osee.framework.core.data.IArtifactType; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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.core.model.type.ArtifactType; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; /** @@ -36,9 +37,9 @@ public class OrphanArtifactSearch implements ISearchPrimitive { } @Override - public String getCriteriaSql(List<Object> dataList, Branch branch) { + public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException { dataList.add(aritfactType.getId()); - dataList.add(branch.getId()); + dataList.add(BranchManager.getBranchId(branch)); dataList.add(relationTypeId); return sql; @@ -50,7 +51,7 @@ public class OrphanArtifactSearch implements ISearchPrimitive { } @Override - public String getTableSql(List<Object> dataList, Branch branch) { + public String getTableSql(List<Object> dataList, IOseeBranch branch) { return tables; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java index e714b9c793d..986677ef9ad 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java @@ -13,9 +13,11 @@ package org.eclipse.osee.framework.skynet.core.conflict; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.ConflictStatus; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.revision.ConflictManagerInternal; /** @@ -27,9 +29,9 @@ public class ConflictManagerExternal { private final Branch sourceBranch; private List<Conflict> originalConflicts; - public ConflictManagerExternal(Branch destinationBranch, Branch sourceBranch) { - this.destinationBranch = destinationBranch; - this.sourceBranch = sourceBranch; + public ConflictManagerExternal(IOseeBranch destinationBranch, IOseeBranch sourceBranch) throws OseeCoreException { + this.destinationBranch = BranchManager.getBranch(destinationBranch); + this.sourceBranch = BranchManager.getBranch(sourceBranch); } public List<Conflict> getOriginalConflicts() throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java index 521c7bd6754..6a7af3f0100 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java @@ -59,7 +59,7 @@ public class ArtifactEvent extends FrameworkEvent { return relationReorderRecords; } - public boolean isForBranch(Branch branch) { + public boolean isForBranch(IOseeBranch branch) { return getBranchGuid().equals(branch.getGuid()); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java index a4db8839840..b7537d6c8d2 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.skynet.core.httpRequests; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.OseeServerContext; import org.eclipse.osee.framework.core.enums.CoreTranslatorId; import org.eclipse.osee.framework.core.enums.Function; @@ -38,9 +39,9 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation { private final Branch branch; private final boolean recursive; - public PurgeBranchHttpRequestOperation(Branch branch, boolean recursive) { + public PurgeBranchHttpRequestOperation(IOseeBranch branch, boolean recursive) throws OseeCoreException { super("Purge " + branch, Activator.PLUGIN_ID); - this.branch = branch; + this.branch = BranchManager.getBranch(branch); this.recursive = recursive; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java index c0c773c9092..2b2a8d46396 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java @@ -18,8 +18,8 @@ import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; @@ -70,7 +70,7 @@ public class AttributeBasedArtifactResolver extends NewArtifactImportResolver { } @Override - public Artifact resolve(RoughArtifact roughArtifact, Branch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { Artifact realArtifact = null; RoughArtifact roughParent = roughArtifact.getRoughParent(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java index 7fc43f8224f..5cf7e2feaac 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java @@ -13,8 +13,8 @@ package org.eclipse.osee.framework.skynet.core.importing.resolvers; import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; @@ -37,7 +37,7 @@ public class GuidBasedArtifactResolver extends NewArtifactImportResolver { } @Override - public Artifact resolve(RoughArtifact roughArtifact, Branch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { List<Artifact> descendants = root.getDescendants(); Artifact realArtifact = null; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java index eb9feacf803..0f2adcc85e6 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.importing.resolvers; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; @@ -22,5 +22,5 @@ import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; */ public interface IArtifactImportResolver { - public Artifact resolve(RoughArtifact roughArtifact, Branch branch, Artifact realParent, Artifact root) throws OseeCoreException; + public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java index 93548026981..73749bf55aa 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java @@ -12,9 +12,9 @@ package org.eclipse.osee.framework.skynet.core.importing.resolvers; import java.util.logging.Level; 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.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; @@ -34,7 +34,7 @@ public class NewArtifactImportResolver implements IArtifactImportResolver { } @Override - public Artifact resolve(final RoughArtifact roughArtifact, final Branch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(final RoughArtifact roughArtifact, final IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { IArtifactType artifactType = getArtifactType(roughArtifact.getRoughArtifactKind()); OseeLog.format(NewArtifactImportResolver.class, Level.INFO, "New artifact: [%s]. Attributes: [%s]", diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java index 9917933b585..409e37a081a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java @@ -170,7 +170,7 @@ public final class TransactionManager { return transactionId; } - public static synchronized TransactionRecord internalCreateTransactionRecord(Branch branch, User userToBlame, String comment) throws OseeCoreException { + public static synchronized TransactionRecord internalCreateTransactionRecord(IOseeBranch branch, User userToBlame, String comment) throws OseeCoreException { Integer transactionNumber = ConnectionHandler.getSequence().getNextTransactionId(); if (comment == null) { comment = ""; @@ -180,8 +180,8 @@ public final class TransactionManager { Date transactionTime = GlobalTime.GreenwichMeanTimestamp(); TransactionRecordFactory factory = Activator.getInstance().getTransactionFactory(); TransactionRecord transactionId = - factory.createOrUpdate(getTransactionCache(), transactionNumber, branch.getId(), comment, transactionTime, - authorArtId, -1, txType); + factory.createOrUpdate(getTransactionCache(), transactionNumber, BranchManager.getBranchId(branch), comment, + transactionTime, authorArtId, -1, txType); transactionId.setBranchCache(Activator.getInstance().getOseeCacheService().getBranchCache()); return transactionId; } diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java index 08163b90be8..616b9bb097d 100644 --- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java +++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java @@ -15,7 +15,7 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.ui.branch.graph.core.BranchGraphEditor; import org.eclipse.osee.framework.ui.branch.graph.core.BranchGraphEditorInput; import org.eclipse.osee.framework.ui.skynet.commandHandlers.AbstractSelectionChangedHandler; @@ -36,7 +36,8 @@ public class OpenBranchGraph extends AbstractSelectionChangedHandler { try { ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection(); if (selection instanceof IStructuredSelection) { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection((IStructuredSelection) selection); + List<? extends IOseeBranch> branches = + Handlers.getBranchesFromStructuredSelection((IStructuredSelection) selection); if (!branches.isEmpty()) { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor( new BranchGraphEditorInput(branches.iterator().next()), BranchGraphEditor.EDITOR_ID); diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditorInput.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditorInput.java index 2026b71a4f1..444ca7c0908 100644 --- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditorInput.java +++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditorInput.java @@ -11,10 +11,10 @@ package org.eclipse.osee.framework.ui.branch.graph.core; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.enums.CoreBranches; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; -import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; import org.eclipse.ui.PlatformUI; @@ -24,15 +24,15 @@ import org.eclipse.ui.PlatformUI; */ public class BranchGraphEditorInput implements IEditorInput { - private final Branch branch; + private final IOseeBranch branch; private TransactionRecord transactionId; - public BranchGraphEditorInput(Branch branch) { + public BranchGraphEditorInput(IOseeBranch branch) { this.branch = branch; } public BranchGraphEditorInput() throws OseeCoreException { - this(BranchManager.getSystemRootBranch()); + this(CoreBranches.SYSTEM_ROOT); } @Override @@ -68,7 +68,7 @@ public class BranchGraphEditorInput implements IEditorInput { return transactionId; } - public Branch getBranch() { + public IOseeBranch getBranch() { return branch; } diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java index 70b11a34647..cdafc5fb0fc 100644 --- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java +++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java @@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.gef.GraphicalViewer; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; @@ -35,7 +36,7 @@ import org.eclipse.ui.IWorkbenchWindow; */ public class LoadGraphOperation implements IExceptionableRunnable { - private Branch resource; + private IOseeBranch resource; private final GraphicalViewer viewer; private final BranchGraphEditor editor; private GraphCache graph; @@ -51,7 +52,7 @@ public class LoadGraphOperation implements IExceptionableRunnable { this.editor = editor; } - public LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor, Branch resource) { + public LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor, IOseeBranch resource) { this(part, viewer, editor); this.resource = resource; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java index ca4ae9c53b7..4dd50aca364 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java @@ -22,9 +22,9 @@ import java.util.List; import java.util.Map.Entry; import org.eclipse.core.resources.IFolder; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionDelta; import org.eclipse.osee.framework.core.operation.IOperation; import org.eclipse.osee.framework.core.operation.Operations; @@ -119,15 +119,15 @@ public final class ViewWordChangeAndDiffTest { TestUtil.severeLoggingEnd(severeLoggingMonitor); } - private Branch getTestBranch() throws OseeCoreException { + private IOseeBranch getTestBranch() throws OseeCoreException { // get the changes on the specified branch if (BranchManager.branchExists(DemoSawBuilds.SAW_Bld_2)) { - return BranchManager.getBranch(DemoSawBuilds.SAW_Bld_2); + return DemoSawBuilds.SAW_Bld_2; } - return BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); + return DemoSawBuilds.SAW_Bld_1; } - private static Collection<Change> getChanges(Branch testBranch) throws OseeCoreException { + private static Collection<Change> getChanges(IOseeBranch testBranch) throws OseeCoreException { Collection<Change> changes = new ArrayList<Change>(); IOperation operation = ChangeManager.comparedToParent(testBranch, changes); Operations.executeWorkAndCheckStatus(operation); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordTrackedChangesTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordTrackedChangesTest.java index 238022e3265..3ea77765b32 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordTrackedChangesTest.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordTrackedChangesTest.java @@ -13,7 +13,6 @@ package org.eclipse.osee.framework.ui.skynet.test.cases; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; @@ -37,8 +36,7 @@ public class WordTrackedChangesTest { @Before public void setUp() throws Exception { assertFalse("Not to be run on production datbase.", TestUtil.isProductionDb()); - FrameworkTestUtil.cleanupSimpleTest(BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), - WordTrackedChangesTest.class.getSimpleName()); + FrameworkTestUtil.cleanupSimpleTest(DemoSawBuilds.SAW_Bld_1, WordTrackedChangesTest.class.getSimpleName()); RenderingUtil.setPopupsAllowed(false); } @@ -59,9 +57,9 @@ public class WordTrackedChangesTest { public void testWholeWordSaveWithTrackChanges() throws Exception { String content = Lib.fileToString(getClass(), TEST_WORD_EDIT_FILE_NAME); LinkType linkType = LinkType.OSEE_SERVER_LINK; - Branch branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1); Artifact newArt = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.TestProcedureWML, branch, getClass().getSimpleName()); + ArtifactTypeManager.addArtifact(CoreArtifactTypes.TestProcedureWML, DemoSawBuilds.SAW_Bld_1, + getClass().getSimpleName()); newArt.persist(); String unlinkedContent = WordMlLinkHandler.unlink(linkType, newArt, content); @@ -70,8 +68,7 @@ public class WordTrackedChangesTest { @After public void tearDown() throws Exception { - FrameworkTestUtil.cleanupSimpleTest(BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()), - WordTrackedChangesTest.class.getSimpleName()); + FrameworkTestUtil.cleanupSimpleTest(DemoSawBuilds.SAW_Bld_1, WordTrackedChangesTest.class.getSimpleName()); FrameworkTestUtil.cleanupSimpleTest(BranchManager.getCommonBranch(), WordTrackedChangesTest.class.getSimpleName()); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java index 9708baff42d..21fa2f31108 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java @@ -44,6 +44,7 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.window.Window; import org.eclipse.osee.framework.access.AccessControlManager; 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.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.enums.DeletionFlag; @@ -226,7 +227,7 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent artifactExplorer.initializeSelectionBox(); } - private static ArtifactExplorer findView(Branch inputBranch, IWorkbenchPage page) { + private static ArtifactExplorer findView(IOseeBranch inputBranch, IWorkbenchPage page) { for (IViewReference view : page.getViewReferences()) { if (view.getId().equals(ArtifactExplorer.VIEW_ID)) { if (view.getView(false) != null && inputBranch.equals(((ArtifactExplorer) view.getView(false)).branch)) { @@ -294,9 +295,9 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent @Override public void handleEvent(Event event) { try { - Branch selectedBranch = branchSelect.getData(); + IOseeBranch selectedBranch = branchSelect.getData(); if (selectedBranch != null) { - branch = selectedBranch; + branch = BranchManager.getBranch(selectedBranch); explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch)); } } catch (Exception ex) { @@ -442,7 +443,7 @@ public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEvent /** * Reveal an artifact in the viewer and select it. */ - public static void exploreBranch(Branch branch) { + public static void exploreBranch(IOseeBranch branch) { if (branch != null) { IWorkbenchPage page = AWorkbench.getActivePage(); findView(branch, page); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java index 5282d881ae3..7766ec53ea0 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java @@ -18,10 +18,10 @@ import java.util.logging.Level; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.osee.framework.access.AccessControlData; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.UserManager; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -195,8 +195,8 @@ public class PolicyDialog extends Dialog { String name = ""; if (object instanceof Artifact) { name = ((Artifact) object).getName(); - } else if (object instanceof Branch) { - name = ((Branch) object).getName(); + } else if (object instanceof IOseeBranch) { + name = ((IOseeBranch) object).getName(); } return name; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchSelectComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchSelectComposite.java index 13c8dee4724..112f93d51c2 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchSelectComposite.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchSelectComposite.java @@ -14,6 +14,7 @@ package org.eclipse.osee.framework.ui.skynet.branch; import java.util.Collections; import java.util.HashSet; import java.util.Set; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLevel; @@ -38,7 +39,7 @@ public class BranchSelectComposite extends Composite { private Button branchSelectButton; private Text branchSelectTextWidget; - private Branch selectedBranch; + private IOseeBranch selectedBranch; private final Set<Listener> listeners; private final boolean allowOnlyWorkingBranches; @@ -102,7 +103,7 @@ public class BranchSelectComposite extends Composite { }); } - public Branch getSelectedBranch() { + public IOseeBranch getSelectedBranch() { return selectedBranch; } @@ -126,7 +127,7 @@ public class BranchSelectComposite extends Composite { } } - public void setSelected(Branch branch) { + public void setSelected(IOseeBranch branch) { if (branch != null) { selectedBranch = branch; branchSelectTextWidget.setText(selectedBranch.getName()); @@ -158,7 +159,7 @@ public class BranchSelectComposite extends Composite { /** * @param defaultSelectedBranch the defaultSelectedBranch to set */ - public void setDefaultSelectedBranch(Branch defaultSelectedBranch) { + public void setDefaultSelectedBranch(IOseeBranch defaultSelectedBranch) { setSelected(defaultSelectedBranch); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/ChangeUiUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/ChangeUiUtil.java index e759bb7763b..9d50429ba9c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/ChangeUiUtil.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/ChangeUiUtil.java @@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -22,6 +23,7 @@ import org.eclipse.osee.framework.core.model.TransactionDelta; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.core.util.Conditions; import org.eclipse.osee.framework.plugin.core.util.Jobs; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; @@ -31,16 +33,17 @@ import org.eclipse.ui.progress.UIJob; public final class ChangeUiUtil { - public static void open(Branch branch) throws OseeCoreException { + public static void open(IOseeBranch branch) throws OseeCoreException { + Branch heavyBranch = BranchManager.getBranch(branch); Conditions.checkNotNull(branch, "Branch"); - if (branch.getBranchType() == BranchType.BASELINE) { + if (heavyBranch.getBranchType() == BranchType.BASELINE) { if (!MessageDialog.openConfirm(AWorkbench.getActiveShell(), "Show Change Report", "You have chosen to show a change report for a BASLINE branch.\n\n" + // "This could be a very long running task and consume large resources.\n\nAre you sure?")) { return; } } - open(createInput(branch, true)); + open(createInput(heavyBranch, true)); } public static void open(TransactionRecord transactionId) throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java index 51c1590fb4c..d9d087caae4 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java @@ -14,9 +14,9 @@ import java.util.List; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.access.PolicyDialog; @@ -37,7 +37,7 @@ public class AccessControlHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); List<Artifact> artifacts = Handlers.getArtifactsFromStructuredSelection(structuredSelection); boolean hasArtifacts = artifacts.size() == 1; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java index 38cf98e5e06..03dfd0c16b1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java @@ -14,8 +14,8 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.TransactionDetailsType; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -38,8 +38,8 @@ public class ChangeReportHandler extends AbstractHandler { try { if (selectedObject instanceof TransactionRecord) { ChangeUiUtil.open((TransactionRecord) selectedObject); - } else if (selectedObject instanceof Branch) { - ChangeUiUtil.open((Branch) selectedObject); + } else if (selectedObject instanceof IOseeBranch) { + ChangeUiUtil.open((IOseeBranch) selectedObject); } } catch (Exception ex) { OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex); @@ -62,7 +62,7 @@ public class ChangeReportHandler extends AbstractHandler { if (selectedObject instanceof TransactionRecord) { enabled = ((TransactionRecord) selectedObject).getTxType() != TransactionDetailsType.Baselined; - } else if (selectedObject instanceof Branch) { + } else if (selectedObject instanceof IOseeBranch) { enabled = true; } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CopyHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CopyHandler.java index f6a30949483..b3dd6be56c8 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CopyHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CopyHandler.java @@ -19,6 +19,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -63,8 +64,8 @@ public class CopyHandler extends AbstractHandler { selectionObject = ((Match) object).getElement(); } - if (selectionObject instanceof Branch) { - names.add(((Branch) selectionObject).getName()); + if (selectionObject instanceof IOseeBranch) { + names.add(((IOseeBranch) selectionObject).getName()); } else if (selectionObject instanceof Artifact) { Artifact artifact = (Artifact) selectionObject; names.add(artifact.getName()); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java index 5e946dedf2f..1ec162d6883 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java @@ -16,7 +16,7 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer; @@ -25,7 +25,7 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer; */ public class OpenArtifactExplorerHandler extends AbstractHandler { - private List<Branch> getSelectedBranches() { + private List<? extends IOseeBranch> getSelectedBranches() { ISelectionProvider selectionProvider = AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); @@ -38,7 +38,7 @@ public class OpenArtifactExplorerHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent arg0) { - List<Branch> branches = getSelectedBranches(); + List<? extends IOseeBranch> branches = getSelectedBranches(); if (!branches.isEmpty()) { ArtifactExplorer.exploreBranch(branches.iterator().next()); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java index e17ee2c908d..2ad58981e99 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java @@ -16,6 +16,7 @@ import java.util.List; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -34,7 +35,7 @@ public class ArchiveBranchHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return !branches.isEmpty() && AccessControlManager.isOseeAdmin(); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java index dc546449b92..c636eb1aa05 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreBranches; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeCoreException; @@ -89,15 +90,15 @@ public class BranchCreationHandler extends CommandHandler { } Object object = structuredSelection.getFirstElement(); - Branch branch = null; + IOseeBranch branch = null; - if (object instanceof Branch) { - branch = (Branch) object; + if (object instanceof IOseeBranch) { + branch = (IOseeBranch) object; } else if (object instanceof TransactionRecord) { branch = ((TransactionRecord) object).getBranch(); } - if (branch == null || branch.getArchiveState().isArchived()) { + if (branch == null || BranchManager.getBranch(branch).getArchiveState().isArchived()) { return false; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java index 27c68a18ff3..0905a7d997f 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java @@ -16,6 +16,7 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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; @@ -70,11 +71,11 @@ public abstract class GeneralBranchHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return !branches.isEmpty() && AccessControlManager.isOseeAdmin(); } - private String buildDialogMessage(List<Branch> selectedBranches, String actionDesc) { + private String buildDialogMessage(List<? extends IOseeBranch> selectedBranches, String actionDesc) { StringBuilder branchesStatement = new StringBuilder(); branchesStatement.append(String.format("Are you sure you want to %s branch(es): ", actionDesc)); branchesStatement.append(Strings.buildStatment(selectedBranches)); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java index 00e45908813..ca7c9a30328 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java @@ -14,6 +14,7 @@ import java.util.List; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -65,7 +66,7 @@ public class OpenAssociatedArtifactHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return branches.size() == 1; } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java index 421d55dc238..f16731eee9c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java @@ -15,6 +15,7 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -60,7 +61,7 @@ public class SetAssociatedBranchArtifactHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return branches.size() == 1 && AccessControlManager.isOseeAdmin(); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java index 6065aa78fbb..8f5f56cbec2 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java @@ -18,8 +18,8 @@ import org.eclipse.core.commands.Command; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.UserManager; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; @@ -50,10 +50,10 @@ public class ToggleFavoriteBranchContributionItem extends CompoundContributionIt if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); if (!branches.isEmpty()) { - Branch selectedBranch = branches.iterator().next(); + IOseeBranch selectedBranch = branches.iterator().next(); if (selectedBranch != null) { try { String commandId = ToggleFavoriteBranchHandler.COMMAND_ID; @@ -75,7 +75,7 @@ public class ToggleFavoriteBranchContributionItem extends CompoundContributionIt return contributionItems.toArray(new IContributionItem[0]); } - private CommandContributionItem createCommand(String label, Branch branch, String commandId) { + private CommandContributionItem createCommand(String label, IOseeBranch branch, String commandId) { CommandContributionItem contributionItem; contributionItem = diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java index eb91bcb5cfd..0031700f6d9 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.branch; import java.util.List; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.UserManager; @@ -45,7 +46,7 @@ public class ToggleFavoriteBranchHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return branches.size() == 1; } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java index fe38491e0b9..e16c2548c89 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java @@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; import org.eclipse.osee.framework.access.AccessControlManager; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.exception.OseeCoreException; @@ -68,7 +69,7 @@ public class CommitIntoHandler extends CommitHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection); return branches.size() == 1 && AccessControlManager.isOseeAdmin(); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ArtifactSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ArtifactSelectionDialog.java index fa353adfd17..5f7e1d12696 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ArtifactSelectionDialog.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ArtifactSelectionDialog.java @@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; @@ -77,7 +78,7 @@ public class ArtifactSelectionDialog extends SelectionStatusDialog { branchSelect.setSelection(branch); } - public Branch getBranch() { + public IOseeBranch getBranch() { return branchSelect.getData(); } @@ -245,7 +246,7 @@ public class ArtifactSelectionDialog extends SelectionStatusDialog { @SuppressWarnings("unchecked") private void refreshItems() { - Branch branch = getBranch(); + IOseeBranch branch = getBranch(); if (branch != null) { List<Object> data = (List<Object>) treeViewer.getInput(); data.clear(); @@ -254,7 +255,7 @@ public class ArtifactSelectionDialog extends SelectionStatusDialog { } } - private Artifact getBaseArtifact(Branch branch) { + private Artifact getBaseArtifact(IOseeBranch branch) { Artifact toReturn = null; try { toReturn = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java index bdeb4abf708..c7772b5f0f1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java @@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; 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.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -117,7 +118,7 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I @Override public void handleEvent(Event event) { try { - branch = branchSelect.getData(); + branch = BranchManager.getBranch(branchSelect.getData()); refresh(); groupExpDnd.setBranch(branch); } catch (Exception ex) { @@ -438,7 +439,11 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I super.saveState(memento); memento = memento.createChild(INPUT); if (branch != null) { - memento.putInteger(BRANCH_ID, branch.getId()); + try { + memento.putInteger(BRANCH_ID, BranchManager.getBranchId(branch)); + } catch (OseeCoreException 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/group/GroupExplorerDragAndDrop.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerDragAndDrop.java index 4279533e071..f68677bf63b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerDragAndDrop.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerDragAndDrop.java @@ -19,6 +19,7 @@ import java.util.Set; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes; @@ -50,9 +51,9 @@ public class GroupExplorerDragAndDrop extends SkynetDragAndDrop { private final TreeViewer treeViewer; private final String viewId; private boolean isCtrlPressed = false; - private Branch branch; + private IOseeBranch branch; - public GroupExplorerDragAndDrop(TreeViewer treeViewer, String viewId, Branch branch) { + public GroupExplorerDragAndDrop(TreeViewer treeViewer, String viewId, IOseeBranch branch) { super(treeViewer.getTree(), viewId); this.treeViewer = treeViewer; this.viewId = viewId; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java index a0a84774ac4..09d63902a61 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ArtifactSearchPage.java @@ -30,8 +30,8 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.type.RelationType; import org.eclipse.osee.framework.help.ui.OseeHelpContext; import org.eclipse.osee.framework.logging.OseeLevel; @@ -139,8 +139,8 @@ public class ArtifactSearchPage extends DialogPage implements ISearchPage, IRepl } } - private Branch getSelectedBranch() { - Branch branch = branchSelect.getData(); + private IOseeBranch getSelectedBranch() { + IOseeBranch branch = branchSelect.getData(); if (branch == null) { branch = BranchManager.getLastBranch(); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/FilterArtifactSearchQuery.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/FilterArtifactSearchQuery.java index 96a8926fa46..b182d759612 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/FilterArtifactSearchQuery.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/FilterArtifactSearchQuery.java @@ -14,8 +14,8 @@ import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive; @@ -27,10 +27,10 @@ import org.eclipse.osee.framework.ui.skynet.search.filter.FilterModelList; */ public class FilterArtifactSearchQuery extends AbstractLegacyArtifactSearchQuery { private final FilterModelList filterList; - private final Branch branch; + private final IOseeBranch branch; private String criteriaLabel = ""; - public FilterArtifactSearchQuery(FilterModelList filterList, Branch branch) { + public FilterArtifactSearchQuery(FilterModelList filterList, IOseeBranch branch) { this.filterList = filterList; this.branch = branch; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/IdArtifactSearch.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/IdArtifactSearch.java index ea9140765f8..6678a2d4f64 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/IdArtifactSearch.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/IdArtifactSearch.java @@ -15,8 +15,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.DeletionFlag; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; @@ -25,10 +25,10 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; */ final class IdArtifactSearch extends AbstractLegacyArtifactSearchQuery { private final List<String> idsToSearch; - private final Branch branchToSearch; + private final IOseeBranch branchToSearch; private final DeletionFlag allowDeleted; - IdArtifactSearch(String searchString, Branch branchToSearch, DeletionFlag allowDeleted) { + IdArtifactSearch(String searchString, IOseeBranch branchToSearch, DeletionFlag allowDeleted) { super(); this.idsToSearch = new ArrayList<String>(); this.branchToSearch = branchToSearch; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java index 76eafa3e762..bb3afbfd36a 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java @@ -18,6 +18,7 @@ import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.action.Action; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.message.SearchOptions; @@ -82,7 +83,7 @@ public class QuickSearchView extends GenericViewPart implements Listener { if (memento != null) { if (Widgets.isAccessible(searchComposite)) { memento.putString(LAST_QUERY_KEY_ID, searchComposite.getQuery()); - Branch branch = branchSelect.getData(); + IOseeBranch branch = branchSelect.getData(); if (branch != null) { memento.putString(LAST_BRANCH_GUID, branch.getGuid()); } @@ -229,7 +230,7 @@ public class QuickSearchView extends GenericViewPart implements Listener { public void handleEvent(Event event) { if (Widgets.isAccessible(branchLabel) && branchSelect != null) { branchLabel.setText(""); - final Branch branch = branchSelect.getData(); + final IOseeBranch branch = branchSelect.getData(); if (branch == null) { branchLabel.setText("Error: Must Select a Branch"); } else if (Widgets.isAccessible(searchComposite) && searchComposite.isExecuteSearchEvent(event) && Widgets.isAccessible(optionsComposite)) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java index 9d226381386..84cc1881aa3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectComposite; @@ -38,7 +38,7 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { private BranchSelectComposite selectComposite; private Composite composite; - private Branch defaultBranch; + private IOseeBranch defaultBranch; private final List<Listener> listeners = new ArrayList<Listener>(); @@ -93,17 +93,17 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { } @Override - public Branch getData() { + public IOseeBranch getData() { return getSelection(); } - public Branch getSelection() { + public IOseeBranch getSelection() { return selectComposite.getSelectedBranch(); } @Override public String getReportData() { - Branch branch = selectComposite.getSelectedBranch(); + IOseeBranch branch = selectComposite.getSelectedBranch(); return branch != null ? branch.getName() : ""; } @@ -174,7 +174,7 @@ public class XBranchSelectWidget extends GenericXWidget implements Listener { } } - public void setSelection(Branch branch) { + public void setSelection(IOseeBranch branch) { defaultBranch = branch; if (selectComposite != null) { selectComposite.setSelected(branch); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTypeListViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTypeListViewer.java index 495f03f2030..7a9c21f798c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTypeListViewer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTypeListViewer.java @@ -12,8 +12,8 @@ package org.eclipse.osee.framework.ui.skynet.widgets; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.GUID; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -31,7 +31,7 @@ public abstract class XTypeListViewer extends XListViewer { setSorter(new ViewerSorter()); } - public Branch resolveBranch(String branchGuid) { + public IOseeBranch resolveBranch(String branchGuid) { try { if (GUID.isValid(branchGuid)) { return BranchManager.getBranchByGuid(branchGuid); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java index 354e9cf3e38..1d5d316521b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java @@ -15,7 +15,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.ui.plugin.util.IShellCloseEvent; import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectComposite; @@ -156,7 +156,7 @@ public class EntryDialogWithBranchSelect extends MessageDialog { this.entryText = entry; } - public Branch getBranch() { + public IOseeBranch getBranch() { return branchSelect.getSelectedBranch(); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java index 6c768d66003..8db60b8be5e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java @@ -555,8 +555,12 @@ public class MergeXWidget extends GenericXWidget implements IAdaptable { @Override public void run() { if (sourceBranch.getBranchState().isRebaselineInProgress()) { - ConflictManagerExternal conflictManager = new ConflictManagerExternal(destBranch, sourceBranch); - BranchManager.completeUpdateBranch(conflictManager, true, false); + try { + ConflictManagerExternal conflictManager = new ConflictManagerExternal(destBranch, sourceBranch); + BranchManager.completeUpdateBranch(conflictManager, true, false); + } catch (OseeCoreException ex) { + OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex); + } } } } diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java index 44cd525d842..d4fa251b037 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java @@ -18,6 +18,7 @@ import java.util.Set; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -42,7 +43,7 @@ public class OteArtifactFetcher<T extends Artifact> { * Creates a new Artifact in the specified branch */ @SuppressWarnings("unchecked") - public T getNewArtifact(Branch branch) throws OseeCoreException { + public T getNewArtifact(IOseeBranch branch) throws OseeCoreException { checkForNull(branch); return (T) ArtifactTypeManager.addArtifact(oteArtifactType, branch); } @@ -70,7 +71,7 @@ public class OteArtifactFetcher<T extends Artifact> { * @return artifact instances */ @SuppressWarnings("unchecked") - public Set<T> getAllArtifacts(Branch branch) throws OseeArgumentException { + public Set<T> getAllArtifacts(IOseeBranch branch) throws OseeArgumentException { checkForNull(branch); Set<T> toReturn = new HashSet<T>(); try { diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java index 041886ea080..d6be65ba6c2 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java @@ -16,13 +16,13 @@ import java.net.URI; import java.util.Date; import java.util.List; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; -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.skynet.core.artifact.Artifact; @@ -67,7 +67,7 @@ public class TestRunOperator { } } - public static TestRunOperator getNewArtifactWithOperator(Branch branch) throws OseeCoreException { + public static TestRunOperator getNewArtifactWithOperator(IOseeBranch branch) throws OseeCoreException { return new TestRunOperator(TEST_RUN_ARTIFACT_FETCHER.getNewArtifact(branch)); } diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java index 59670c82f1d..118bc1f417d 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java @@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.ote.define.OteDefinePlugin; import org.eclipse.osee.ote.define.operations.LinkTestRunToTestScriptOperation; @@ -30,9 +30,9 @@ public class OutfileToArtifactJob extends Job { private final URI[] filesToImport; private Artifact[] results; private URI[] filesWithErrors; - private final Branch branch; + private final IOseeBranch branch; - public OutfileToArtifactJob(Branch branch, URI... filesToImport) { + public OutfileToArtifactJob(IOseeBranch branch, URI... filesToImport) { super(JOB_NAME); setUser(true); setPriority(Job.LONG); diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java index 610a3bf3c53..81719fa020d 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java @@ -16,7 +16,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.jdk.core.util.ChecksumUtil; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -29,12 +29,12 @@ import org.eclipse.osee.ote.define.utilities.OutfileParserExtensionManager; * @author Roberto E. Escobar */ public class OutfileToArtifactOperation { - private final Branch branch; + private final IOseeBranch branch; private final URI[] filesToImport; private final List<Artifact> results; private final List<URI> filesWithErrors; - public OutfileToArtifactOperation(Branch branch, URI... filesToImport) { + public OutfileToArtifactOperation(IOseeBranch branch, URI... filesToImport) { this.branch = branch; this.filesToImport = filesToImport; this.results = new ArrayList<Artifact>(); diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/ImportOutfileUIOperation.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/ImportOutfileUIOperation.java index 4f824715f70..9ce3a6a2860 100644 --- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/ImportOutfileUIOperation.java +++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/ImportOutfileUIOperation.java @@ -16,7 +16,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.data.IOseeBranch; 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.Displays; @@ -33,9 +33,9 @@ import org.eclipse.swt.widgets.Shell; public class ImportOutfileUIOperation { private final URI[] fileSystemObjects; - private final Branch selectedBranch; + private final IOseeBranch selectedBranch; - public ImportOutfileUIOperation(Branch selectedBranch, URI... fileSystemObjects) { + public ImportOutfileUIOperation(IOseeBranch selectedBranch, URI... fileSystemObjects) { this.fileSystemObjects = fileSystemObjects; this.selectedBranch = selectedBranch; } diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java index 2d8d6fb8474..ac08c601a4e 100644 --- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java +++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java @@ -29,9 +29,9 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.TestRunStorageKey; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget; @@ -264,14 +264,14 @@ public class OutfileImportPage extends WizardDataTransferPage { @Override protected boolean validateDestinationGroup() { boolean toReturn = super.validateDestinationGroup(); - Branch branch = branchSelect.getData(); + IOseeBranch branch = branchSelect.getData(); if (branch == null) { setMessage(null); setErrorMessage("Please select a working branch. Cannot import into a null branch."); toReturn &= false; } else { try { - if (!branch.hasParentBranch()) { + if (!BranchManager.getBranch(branch).hasParentBranch()) { setMessage(null); setErrorMessage("Please select a working branch. Cannot import into a top-level branch."); toReturn &= false; @@ -303,10 +303,10 @@ public class OutfileImportPage extends WizardDataTransferPage { branchIds = new String[0]; } - Branch branch = branchSelect.getData(); + IOseeBranch branch = branchSelect.getData(); try { - if (branch != null && branch.hasParentBranch()) { - String lastBranchSelected = Integer.toString(branch.getId()); + if (branch != null && BranchManager.getBranch(branch).hasParentBranch()) { + String lastBranchSelected = Integer.toString(BranchManager.getBranchId(branch)); branchIds = addToHistory(branchIds, lastBranchSelected); settings.put(TestRunStorageKey.BRANCH_IDS, branchIds); |