Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-08-08 18:03:20 -0400
committerdonald.g.dunne2016-08-08 18:03:20 -0400
commit18fcb2cf1ceb0fa144c38182e432e25482af4bf6 (patch)
treef045e9e2c4f1479b8976028601af3627e3697159
parent35dda22ff4c8ffd41bbc8718e6a1647f1df63abe (diff)
downloadorg.eclipse.osee-18fcb2cf1ceb0fa144c38182e432e25482af4bf6.tar.gz
org.eclipse.osee-18fcb2cf1ceb0fa144c38182e432e25482af4bf6.tar.xz
org.eclipse.osee-18fcb2cf1ceb0fa144c38182e432e25482af4bf6.zip
refactor: Remove CoreBranches.COMMON_ID
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java6
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java9
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java2
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java3
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java35
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java14
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicUuidRelation.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreBranches.java1
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java36
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidRelation.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTransactionData.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultDataUI.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchParameters.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchRequest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/ArtifactSearch_V1Test.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/dsl/SearchDslTest.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/search/artifact/dsl/SearchQueryBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterCollectorGenerator.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java8
37 files changed, 149 insertions, 160 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
index 8f25d7ec8f..5a639bfa96 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.api.user;
import java.util.Collection;
import java.util.List;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -28,6 +29,8 @@ public interface IAtsUserService {
IAtsUser getUserById(String userId) throws OseeCoreException;
+ IAtsUser getUserByArtifactId(ArtifactId id);
+
boolean isUserIdValid(String userId) throws OseeCoreException;
boolean isUserNameValid(String name) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
index 4cb48f33f9..05a76c8ae2 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
@@ -100,9 +100,9 @@ public class AtsTaskService extends AbstractAtsTaskService {
if (relation != null) {
Artifact taskArt = atsClient.getArtifact(task.getUuid());
- DefaultBasicUuidRelation guidRelation = new DefaultBasicUuidRelation(AtsUtilCore.getAtsBranch().getUuid(),
- AtsRelationTypes.TeamWfToTask_Task.getGuid(), relation.getId(), relation.getGammaId(),
- getBasicGuidArtifact(teamWf), getBasicGuidArtifact(taskArt));
+ DefaultBasicUuidRelation guidRelation =
+ new DefaultBasicUuidRelation(AtsUtilCore.getAtsBranch(), AtsRelationTypes.TeamWfToTask_Task.getGuid(),
+ relation.getId(), relation.getGammaId(), getBasicGuidArtifact(teamWf), getBasicGuidArtifact(taskArt));
artifactEvent.getRelations().add(new EventBasicGuidRelation(RelationEventType.Added,
newTaskData.getTeamWfUuid().intValue(), new Long(task.getUuid()).intValue(), guidRelation));
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
index c10b1e0c4d..f6d944c8a1 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
@@ -45,7 +45,6 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
return SystemUser.OseeSystem.getUserId();
}
- @SuppressWarnings("unchecked")
@Override
public boolean isAtsAdmin(IAtsUser user) {
if (atsAdminArt == null) {
@@ -83,7 +82,7 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
atsUser.setUserId(userArt.getSoleAttributeValue(CoreAttributeTypes.UserId, ""));
atsUser.setEmail(userArt.getSoleAttributeValue(CoreAttributeTypes.Email, ""));
atsUser.setActive(userArt.getSoleAttributeValue(CoreAttributeTypes.Active, true));
- atsUser.setUuid(userArt.getUuid());
+ atsUser.setUuid(userArt.getId());
return atsUser;
}
@@ -125,4 +124,10 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
return user;
}
+ @Override
+ public IAtsUser getUserByArtifactId(ArtifactId id) {
+ ArtifactReadable userArt =
+ orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andId(id).getResults().getExactlyOne();
+ return createFromArtifact(userArt);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
index d201e9a389..a689ad53ed 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
@@ -34,7 +34,6 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeType;
import org.eclipse.osee.framework.core.model.change.CompareResults;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactTypes;
@@ -58,7 +57,7 @@ public class ReportResource {
@GET
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- public Response getTypeCount(@QueryParam("branchUuid") BranchId branch, @QueryParam("artTypes") List<Long> artTypes, @QueryParam("attrTypes") List<Long> attrTypes) throws OseeCoreException {
+ public Response getTypeCount(@QueryParam("branch") BranchId branch, @QueryParam("artTypes") List<Long> artTypes, @QueryParam("attrTypes") List<Long> attrTypes) {
List<ChangeItem> changes = getChanges(branch);
Set<Long> newArts = new HashSet<>();
Set<Long> modArts = new HashSet<>();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
index e74f6c7858..af2ae1eb61 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
@@ -29,7 +29,7 @@ public class ArtifactValidationRule extends AbstractValidationRule {
private String getStatusMessage(Artifact itemChecked, IStatus status) throws OseeCoreException {
String link =
XResultDataUI.getHyperlink(String.format("%s:[%s]", itemChecked.getArtifactTypeName(), itemChecked.getName()),
- AtsUtilClient.getAtsId(itemChecked), itemChecked.getBranchId());
+ AtsUtilClient.getAtsId(itemChecked), itemChecked.getBranch());
return String.format("%s: %s", link, status.getMessage());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
index 4d5e2fdc27..b12483bb89 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
@@ -154,6 +154,6 @@ public class ValidationReportOperation extends AbstractOperation {
public static String getRequirementHyperlink(Artifact art) throws OseeCoreException {
String atsId = AtsUtilClient.getAtsId(art);
String linkName = String.format("%s(%s)", art.getName(), atsId);
- return XResultDataUI.getHyperlink(linkName, atsId, art.getBranchId());
+ return XResultDataUI.getHyperlink(linkName, atsId, art.getBranch());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
index 83b00c089f..c853b6dd29 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.client.integration.tests.integration.skynet.core;
import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -623,7 +622,7 @@ public class ArtifactEventTest {
Assert.assertEquals(RelationOrderModType.Absolute, guidReorder.getModType());
Assert.assertEquals(parentRemGuidArt.getArtGuid(), guidReorder.getParentArt().getGuid());
Assert.assertEquals(parentRemGuidArt.getArtTypeGuid(), (long) guidReorder.getParentArt().getArtTypeGuid());
- Assert.assertTrue(guidReorder.getParentArt().isOnBranch(COMMON_ID));
+ Assert.assertTrue(guidReorder.getParentArt().isOnBranch(COMMON));
Assert.assertEquals(CoreRelationTypes.Default_Hierarchical__Child.getGuid(), guidReorder.getRelTypeGuid());
Assert.assertTrue(injectArt.isOnSameBranch(guidReorder));
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
index 1519a1ae79..a9f13ca5d8 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -76,12 +77,16 @@ public class SafetyWorkflowEventHandler implements EventHandler {
Object userArt = event.getProperty(SAFETY_EVENT_USER_ART);
checkEventObjects(branchId, userArt); // throws exception if incorrect
- ArtifactReadable assocArt = getAssociatedWorkflowArt((BranchId) branchId);
- if (assocArt != null) {
+
+ BranchReadable branch = queryFactory.branchQuery().andIds((BranchId) branchId).getResults().getExactlyOne();
+ ArtifactId workflowId = branch.getAssociatedArtifact();
+ if (workflowId.notEqual(SystemUser.OseeSystem)) {
+ ArtifactReadable assocArt = atsServer.getQuery().andId(workflowId).andIsOfType(
+ AtsArtifactTypes.TeamWorkflow).getResults().getExactlyOne();
IAtsTeamWorkflow safetyWf = getSafetyWorkflow(assocArt);
if (safetyWf == null) {
IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(assocArt);
- safetyWf = createSafetyAction(teamWf, (ArtifactReadable) userArt);
+ safetyWf = createSafetyAction(teamWf, (ArtifactId) userArt);
}
}
} catch (Exception ex) {
@@ -94,26 +99,10 @@ public class SafetyWorkflowEventHandler implements EventHandler {
throw new OseeArgumentException("BranchID provided to safety workflow creation event incorrect type: %s",
branchId.getClass());
}
- if (!(userArt instanceof ArtifactReadable)) {
+ if (!(userArt instanceof ArtifactId)) {
throw new OseeArgumentException("User Artifact provided to safety workflow creation event incorrect type: %s",
- userArt.toString());
- }
- }
-
- private ArtifactReadable getAssociatedWorkflowArt(BranchId branchId) {
- ArtifactReadable toReturn = null;
- ArtifactId workflowId = branch.getAssociatedArtifact();
- try {
- BranchReadable branch = queryFactory.branchQuery().andIds(branchId).getResults().getOneOrNull();
- if (branch != null) {
- long workflowUuid = branch.getAssociatedArtifactId();
- toReturn = atsServer.getQuery().andId(workflowId).andIsOfType(
- AtsArtifactTypes.TeamWorkflow).getResults().getOneOrNull();
- }
- } catch (Exception ex) {
- // do not throw exception when associated artifact is osee system or doesn't exist
+ userArt.getClass());
}
- return toReturn;
}
private IAtsTeamWorkflow getSafetyWorkflow(ArtifactReadable workflowArt) {
@@ -131,7 +120,7 @@ public class SafetyWorkflowEventHandler implements EventHandler {
return safetyWorkflow;
}
- private IAtsTeamWorkflow createSafetyAction(IAtsTeamWorkflow teamWf, ArtifactReadable userArt) {
+ private IAtsTeamWorkflow createSafetyAction(IAtsTeamWorkflow teamWf, ArtifactId userArt) {
IAtsTeamWorkflow teamWorkflow = null;
try {
IAtsActionableItem ai = atsServer.getCache().getAtsObject(AtsArtifactToken.SafetyActionableItem);
@@ -144,7 +133,7 @@ public class SafetyWorkflowEventHandler implements EventHandler {
}
IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER;
IAtsChangeSet changes = atsServer.getStoreService().createAtsChangeSet("Create System Safety Workflow",
- atsServer.getUserService().getUserById(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId)));
+ atsServer.getUserService().getUserByArtifactId(userArt));
IAtsAction action = atsServer.getActionFactory().getAction(teamWf);
teamWorkflow =
atsServer.getActionFactory().createTeamWorkflow(action, teamDef, java.util.Collections.singleton(ai),
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
index 061fa7e4ec..871a5cfd61 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.define.report.internal.wordupdate;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import com.google.common.collect.Lists;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -21,6 +21,7 @@ import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.osee.define.report.api.WordArtifactChange;
import org.eclipse.osee.define.report.api.WordUpdateChange;
import org.eclipse.osee.define.report.api.WordUpdateData;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -42,7 +43,6 @@ import org.osgi.service.event.EventAdmin;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-import com.google.common.collect.Lists;
/**
* @author Ryan D. Brooks
@@ -82,11 +82,6 @@ public class WordUpdateArtifact {
return wordArtifactUpdate(data, extractorDatas, oleDataElement);
}
- public ArtifactReadable getArtifact(Long branchUuid, long uuid) {
- ArtifactReadable toReturn = queryFactory.fromBranch(branchUuid).andUuid(uuid).getResults().getExactlyOne();
- return toReturn;
- }
-
public ArtifactReadable getArtifact(BranchId branch, String guid) {
return queryFactory.fromBranch(branch).andGuid(guid).getResults().getExactlyOne();
}
@@ -110,8 +105,8 @@ public class WordUpdateArtifact {
boolean singleArtifact = extractorDatas.size() == 1;
boolean containsOleData = false;
boolean containsWordData = false;
- ArtifactReadable userArtifact = getArtifact(COMMON_ID, data.getUserArtId());
- TransactionBuilder txBuilder = txFactory.createTransaction(data.getBranch(), userArtifact, data.getComment());
+ ArtifactId account = ArtifactId.valueOf(data.getUserArtId());
+ TransactionBuilder txBuilder = txFactory.createTransaction(data.getBranch(), account, data.getComment());
for (WordExtractorData extractorData : extractorDatas) {
ArtifactReadable artifact = getArtifact(data.getBranch(), extractorData.getGuid());
WordArtifactChange artChange = new WordArtifactChange();
@@ -176,7 +171,7 @@ public class WordUpdateArtifact {
}
TransactionReadable tx = txBuilder.commit();
if (tx != null) {
- postProcessChange(tx, updateChange, userArtifact);
+ postProcessChange(tx, updateChange, account);
}
} catch (Exception ex) {
@@ -190,14 +185,14 @@ public class WordUpdateArtifact {
return updateChange;
}
- private void postProcessChange(TransactionReadable tx, WordUpdateChange updateChange, ArtifactReadable userId) {
+ private void postProcessChange(TransactionReadable tx, WordUpdateChange updateChange, ArtifactId account) {
updateChange.setTx(tx);
updateChange.setBranch(tx.getBranch());
if (updateChange.hasSafetyRelatedArtifactChange()) {
try {
HashMap<String, Object> properties = new HashMap<String, Object>();
properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_BRANCH_ID, tx.getBranch());
- properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_USER_ART, userId);
+ properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_USER_ART, account);
Event event = new Event(SafetyWorkflowEventHandler.SAFETY_EVENT_TOPIC, properties);
eventAdmin.postEvent(event);
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
index e8725c21e4..c5ea66f8de 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.dsl.integration.util;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
@@ -93,13 +93,15 @@ public class OseeDslSegmentParserTest {
final String artifactGuid = GUID.create();
String data = null;
- data = String.format("//@start_artifact branch/%d/artifact/%s/ ()", COMMON_ID, artifactGuid);
- checkGetTagLocations(data, new TagLocation(true, COMMON_ID, artifactGuid, 0, data.length()));
+ Long commonId = COMMON.getId();
- data = String.format("//@end_artifact branch/%d/artifact/%s/ ()", COMMON_ID, artifactGuid);
- checkGetTagLocations(data, new TagLocation(false, COMMON_ID, artifactGuid, 0, data.length()));
+ data = String.format("//@start_artifact branch/%d/artifact/%s/ ()", commonId, artifactGuid);
+ checkGetTagLocations(data, new TagLocation(true, commonId, artifactGuid, 0, data.length()));
- data = String.format("//@end_artifact branch/%d/artifact/%s/", COMMON_ID, artifactGuid);
+ data = String.format("//@end_artifact branch/%d/artifact/%s/ ()", commonId, artifactGuid);
+ checkGetTagLocations(data, new TagLocation(false, commonId, artifactGuid, 0, data.length()));
+
+ data = String.format("//@end_artifact branch/%d/artifact/%s/", commonId, artifactGuid);
checkGetTagLocations(data);
data = "//@end_artifact branch//artifact/";
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicUuidRelation.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicUuidRelation.java
index b78724d360..a7cb28533c 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicUuidRelation.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicUuidRelation.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.event;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationType;
/**
@@ -23,8 +24,8 @@ public class DefaultBasicUuidRelation implements IBasicGuidRelation {
int gammaId;
int relationId;
- public DefaultBasicUuidRelation(Long branchUuid, Long relTypeUuid, int relationId, int gammaId, DefaultBasicGuidArtifact artA, DefaultBasicGuidArtifact artB) {
- this.branchUuid = branchUuid;
+ public DefaultBasicUuidRelation(BranchId branch, Long relTypeUuid, int relationId, int gammaId, DefaultBasicGuidArtifact artA, DefaultBasicGuidArtifact artB) {
+ this.branchUuid = branch.getId();
this.relTypeUuid = relTypeUuid;
this.relationId = relationId;
this.gammaId = gammaId;
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreBranches.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreBranches.java
index 08cf275566..619db9e3a0 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreBranches.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreBranches.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.framework.core.data.TokenFactory;
public final class CoreBranches {
public static final IOseeBranch COMMON = TokenFactory.createBranch(570, "Common");
- public static final Long COMMON_ID = COMMON.getUuid();
public static final IOseeBranch SYSTEM_ROOT = TokenFactory.createBranch(1, "System Root Branch");
public static final Long SYSTEM_ROOT_ID = SYSTEM_ROOT.getUuid();
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
index 26651a945b..0d38357a8f 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
@@ -98,6 +98,10 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
return branchGuid;
}
+ public BranchId getBranch() {
+ return BranchId.valueOf(branchGuid);
+ }
+
/**
* Sets the value of the branchGuid property.
*
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
index f7297b5ed7..6483a61251 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.framework.skynet.core.event;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidRelation;
import org.eclipse.osee.framework.skynet.core.relation.RelationEventType;
import org.junit.Assert;
@@ -32,48 +32,48 @@ public class EventBasicGuidRelationTest {
DefaultBasicGuidArtifact eventArt2 =
new DefaultBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
- EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranchId(),
+ EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranch(),
0x02L, 234, 333, 34, eventArt1, 33, eventArt2);
- EventBasicGuidRelation eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranchId(),
+ EventBasicGuidRelation eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranch(),
eventRel1.getRelTypeGuid(), eventRel1.getRelationId(), eventRel1.getGammaId(), eventRel1.getArtAId(),
eventRel1.getArtA(), eventRel1.getArtBId(), eventRel1.getArtB());
Assert.assertEquals(eventRel1.hashCode(), eventRel2.hashCode());
Assert.assertEquals(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Deleted, eventRel1.getBranchId(),
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Deleted, eventRel1.getBranch(),
eventRel1.getRelTypeGuid(), eventRel1.getRelationId(), eventRel1.getGammaId(), eventRel1.getArtAId(),
eventRel1.getArtA(), eventRel1.getArtBId(), eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Deleted, Lib.generateUuid(), eventRel1.getRelTypeGuid(),
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Deleted, BranchId.SENTINEL, eventRel1.getRelTypeGuid(),
eventRel1.getRelationId(), eventRel1.getGammaId(), eventRel1.getArtAId(), eventRel1.getArtA(),
eventRel1.getArtBId(), eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranchId(),
- eventRel1.getRelTypeGuid(), 99, eventRel1.getGammaId(), eventRel1.getArtAId(), eventRel1.getArtA(),
- eventRel1.getArtBId(), eventRel1.getArtB());
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranch(), eventRel1.getRelTypeGuid(),
+ 99, eventRel1.getGammaId(), eventRel1.getArtAId(), eventRel1.getArtA(), eventRel1.getArtBId(),
+ eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranchId(),
- eventRel1.getRelTypeGuid(), eventRel1.getRelationId(), 88, eventRel1.getArtAId(), eventRel1.getArtA(),
- eventRel1.getArtBId(), eventRel1.getArtB());
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranch(), eventRel1.getRelTypeGuid(),
+ eventRel1.getRelationId(), 88, eventRel1.getArtAId(), eventRel1.getArtA(), eventRel1.getArtBId(),
+ eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranchId(),
- eventRel1.getRelTypeGuid(), eventRel1.getRelationId(), eventRel1.getGammaId(), 77, eventRel1.getArtA(),
- eventRel1.getArtBId(), eventRel1.getArtB());
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranch(), eventRel1.getRelTypeGuid(),
+ eventRel1.getRelationId(), eventRel1.getGammaId(), 77, eventRel1.getArtA(), eventRel1.getArtBId(),
+ eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
- eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranchId(),
- eventRel1.getRelTypeGuid(), eventRel1.getRelationId(), eventRel1.getGammaId(), eventRel1.getArtAId(),
- eventRel1.getArtA(), 66, eventRel1.getArtB());
+ eventRel2 = new EventBasicGuidRelation(RelationEventType.Added, eventRel1.getBranch(), eventRel1.getRelTypeGuid(),
+ eventRel1.getRelationId(), eventRel1.getGammaId(), eventRel1.getArtAId(), eventRel1.getArtA(), 66,
+ eventRel1.getArtB());
Assert.assertNotSame(eventRel1, eventRel2);
@@ -98,7 +98,7 @@ public class EventBasicGuidRelationTest {
DefaultBasicGuidArtifact eventArt2 =
new DefaultBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
- EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranchId(),
+ EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranch(),
0x04L, 234, 333, 34, eventArt1, 33, eventArt2);
Assert.assertTrue(eventRel1.is(RelationEventType.Added));
Assert.assertTrue(eventRel1.is(RelationEventType.Added, RelationEventType.Purged));
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
index cac3348fed..7adf6f4ac4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
@@ -10,12 +10,12 @@ import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.artifact.IArtifactTypeProvider;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidRelation;
@@ -81,7 +81,7 @@ public class ArtifactTypeEventFilterTest {
CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
List<IBasicGuidRelation> relations = new ArrayList<>();
- EventBasicGuidRelation relation = new EventBasicGuidRelation(RelationEventType.Added, Lib.generateUuid(),
+ EventBasicGuidRelation relation = new EventBasicGuidRelation(RelationEventType.Added, BranchId.SENTINEL,
CoreRelationTypes.SupportingInfo_SupportedBy.getGuid(), 234, 123, 55, guidArtA, 66, guidArtB);
relations.add(relation);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
index 8d96f9f399..af1deecaf9 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
@@ -11,17 +11,16 @@
package org.eclipse.osee.framework.skynet.core.event.filter;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidRelation;
import org.eclipse.osee.framework.skynet.core.event.model.EventModType;
@@ -76,7 +75,7 @@ public class BranchUuidEventFilterTest {
CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
List<IBasicGuidRelation> relations = new ArrayList<>();
- EventBasicGuidRelation relation = new EventBasicGuidRelation(RelationEventType.Added, Lib.generateUuid(),
+ EventBasicGuidRelation relation = new EventBasicGuidRelation(RelationEventType.Added, BranchId.SENTINEL,
CoreRelationTypes.SupportingInfo_SupportedBy.getGuid(), 234, 123, 55, guidArtA, 66, guidArtB);
relations.add(relation);
@@ -89,7 +88,7 @@ public class BranchUuidEventFilterTest {
GUID.create());
relations.clear();
- relation = new EventBasicGuidRelation(RelationEventType.Added, COMMON_ID,
+ relation = new EventBasicGuidRelation(RelationEventType.Added, COMMON,
CoreRelationTypes.SupportingInfo_SupportedBy.getGuid(), 234, 123, 55, guidArtA, 66, guidArtB);
relations.add(relation);
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 b48543d885..446df0f382 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
@@ -702,7 +702,7 @@ public class ArtifactQuery {
SearchResult result = proxied.getSearchResult(RequestType.IDS);
SearchParameters searchParameters = result.getSearchParameters();
- BranchId branch = TokenFactory.createBranch(searchParameters.getBranchUuid());
+ BranchId branch = searchParameters.getBranch();
TransactionId tx = TransactionId.SENTINEL;
if (searchParameters.getFromTx() > 0) {
@@ -729,7 +729,7 @@ public class ArtifactQuery {
SearchResult result = proxied.getSearchResult(RequestType.MATCHES);
SearchParameters searchParameters = result.getSearchParameters();
- BranchId branch = TokenFactory.createBranch(searchParameters.getBranchUuid());
+ BranchId branch = searchParameters.getBranch();
TransactionId tx = TransactionId.SENTINEL;
if (searchParameters.getFromTx() > 0) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
index b9b2fdea13..79e729adc8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
@@ -235,10 +235,9 @@ public final class FrameworkEventUtil {
OseeLog.log(Activator.class, Level.WARNING,
"Can't determine RelationEventType from guid " + guidRel.getModTypeGuid());
}
- EventBasicGuidRelation event =
- new EventBasicGuidRelation(eventType, getBranchUuidFromRemoteEvent(guidRel.getBranchGuid()),
- guidRel.getRelTypeGuid(), guidRel.getRelationId(), guidRel.getGammaId(), guidRel.getArtAId(),
- getBasicGuidArtifact(guidRel.getArtA()), guidRel.getArtBId(), getBasicGuidArtifact(guidRel.getArtB()));
+ EventBasicGuidRelation event = new EventBasicGuidRelation(eventType, guidRel.getBranch(),
+ guidRel.getRelTypeGuid(), guidRel.getRelationId(), guidRel.getGammaId(), guidRel.getArtAId(),
+ getBasicGuidArtifact(guidRel.getArtA()), guidRel.getArtBId(), getBasicGuidArtifact(guidRel.getArtB()));
if (eventType == RelationEventType.ModifiedRationale || eventType == RelationEventType.Added) {
event.setRationale(guidRel.getRationale());
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidRelation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidRelation.java
index 800121d53d..f6af644ca6 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidRelation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidRelation.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event.model;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.DefaultBasicUuidRelation;
import org.eclipse.osee.framework.skynet.core.relation.RelationEventType;
@@ -25,11 +26,11 @@ public class EventBasicGuidRelation extends DefaultBasicUuidRelation {
private String rationale;
public EventBasicGuidRelation(RelationEventType relationEventType, int artAId, int artBId, DefaultBasicUuidRelation guidRel) {
- this(relationEventType, guidRel.getBranchId(), guidRel.getRelTypeGuid(), guidRel.getRelationId(),
+ this(relationEventType, guidRel.getBranch(), guidRel.getRelTypeGuid(), guidRel.getRelationId(),
guidRel.getGammaId(), artAId, guidRel.getArtA(), artBId, guidRel.getArtB());
}
- public EventBasicGuidRelation(RelationEventType relationEventType, Long branchUuid, Long relTypeGuid, int relationId, int gammaId, int artAId, DefaultBasicGuidArtifact artA, int artBId, DefaultBasicGuidArtifact artB) {
+ public EventBasicGuidRelation(RelationEventType relationEventType, BranchId branchUuid, Long relTypeGuid, int relationId, int gammaId, int artAId, DefaultBasicGuidArtifact artA, int artBId, DefaultBasicGuidArtifact artB) {
super(branchUuid, relTypeGuid, relationId, gammaId, artA, artB);
this.relationEventType = relationEventType;
this.artAId = artAId;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
index d634d4c21a..4977b9841f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
@@ -169,7 +169,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
RelationEventType relationEventType =
change.getModificationType().isDeleted() ? RelationEventType.Deleted : change.getModificationType().isUnDeleted() ? RelationEventType.Undeleted : RelationEventType.Added;
- DefaultBasicUuidRelation defaultBasicGuidRelation = new DefaultBasicUuidRelation(relChange.getBranchId(),
+ DefaultBasicUuidRelation defaultBasicGuidRelation = new DefaultBasicUuidRelation(relChange.getBranch(),
relChange.getRelationType().getGuid(), relChange.getItemId().getId().intValue(),
relChange.getGamma().getId().intValue(), relChange.getChangeArtifact().getBasicGuidArtifact(),
relChange.getEndTxBArtifact().getBasicGuidArtifact());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTransactionData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTransactionData.java
index 407479ca37..7e4e06fd89 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTransactionData.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTransactionData.java
@@ -80,7 +80,7 @@ public class RelationTransactionData extends BaseTransactionData {
@Override
protected void internalAddToEvents(ArtifactEvent artifactEvent) throws OseeCoreException {
- DefaultBasicUuidRelation defaultBasicGuidRelation = new DefaultBasicUuidRelation(relation.getBranchId(),
+ DefaultBasicUuidRelation defaultBasicGuidRelation = new DefaultBasicUuidRelation(relation.getBranch(),
relation.getRelationType().getId(), relation.getId(), relation.getGammaId(),
relation.getArtifactA().getBasicGuidArtifact(), relation.getArtifactB().getBasicGuidArtifact());
EventBasicGuidRelation event = new EventBasicGuidRelation(relationEventType, relation.getAArtifactId(),
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
index e4a39366d7..f1639ea644 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
@@ -47,7 +47,7 @@ public class ArtifactValidationCheckOperation extends AbstractOperation {
if (!status.isOK()) {
String link = XResultDataUI.getHyperlink(
String.format("%s:[%s]", itemChecked.getArtifactTypeName(), itemChecked.getName()), itemChecked.getGuid(),
- itemChecked.getBranchId());
+ itemChecked.getBranch());
String message = String.format("%s: %s", link, status.getMessage());
status =
new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message, status.getException());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultDataUI.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultDataUI.java
index 6fd76775e2..f35c4b2fed 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultDataUI.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultDataUI.java
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.results;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
@@ -32,9 +33,9 @@ public class XResultDataUI {
/*
* Creates hyperlink using name. Default editor will open guid for branchUuid given
*/
- public static String getHyperlink(String name, String guid, long branchUuid) {
+ public static String getHyperlink(String name, String guid, BranchId branch) {
return AHTML.getHyperlink(XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openArtifactBranch,
- guid + "(" + branchUuid + ")"), name);
+ guid + "(" + branch.getId() + ")"), name);
}
public static String getHyperlinkUrlExternal(String name, String url) {
@@ -69,18 +70,18 @@ public class XResultDataUI {
* Creates hyperlink using guid as name. Default editor will open.
*/
public static String getHyperlink(Artifact art) throws OseeCoreException {
- return getHyperlink(art.getGuid(), art.getGuid(), art.getBranchId());
+ return getHyperlink(art.getGuid(), art.getGuid(), art.getBranch());
}
public static String getHyperlinkWithName(Artifact art) throws OseeCoreException {
- return getHyperlink(art.toStringWithId(), art.getGuid(), art.getBranchId());
+ return getHyperlink(art.toStringWithId(), art.getGuid(), art.getBranch());
}
/*
* Creates hyperlink using name. Default editor will open.
*/
public static String getHyperlink(String name, Artifact art) throws OseeCoreException {
- return getHyperlink(name, art.getGuid(), art.getBranchId());
+ return getHyperlink(name, art.getGuid(), art.getBranch());
}
public static String report(XResultData resultData, final String title) {
@@ -138,7 +139,7 @@ public class XResultDataUI {
UserManager.getUser()));
rd.log("Example of hyperlinked guid on another branch: " + getHyperlink(UserManager.getUser().getGuid(),
- UserManager.getUser().getGuid(), COMMON_ID));
+ UserManager.getUser().getGuid(), COMMON));
rd.addRaw(AHTML.newline());
rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google",
"http://www.google.com") + AHTML.newline());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
index 6e59f1fa21..ab72b35ee6 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.intergration;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcService;
@@ -56,11 +56,10 @@ public class PurgeAttributeTest {
@Before
public void setupAndTeardown() {
TransactionBuilder tx = null;
- for (ArtifactReadable art : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON_ID).and(
- CoreAttributeTypes.Annotation, UNIQUE_ATTR_VALUE).getResults()) {
+ for (ArtifactReadable art : orcsApi.getQueryFactory().fromBranch(COMMON).and(CoreAttributeTypes.Annotation,
+ UNIQUE_ATTR_VALUE).getResults()) {
if (tx == null) {
- tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, Joe_Smith,
- getClass().getSimpleName());
+ tx = orcsApi.getTransactionFactory().createTransaction(COMMON, Joe_Smith, getClass().getSimpleName());
}
tx.deleteArtifact(art);
}
@@ -78,8 +77,8 @@ public class PurgeAttributeTest {
}
// Setup test
- TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, Joe_Smith,
- getClass().getSimpleName());
+ TransactionBuilder tx =
+ orcsApi.getTransactionFactory().createTransaction(COMMON, Joe_Smith, getClass().getSimpleName());
tx.createAttribute(CoreArtifactTokens.UserGroups, CoreAttributeTypes.Annotation, UNIQUE_ATTR_VALUE);
tx.createAttribute(CoreArtifactTokens.Everyone, CoreAttributeTypes.Annotation, UNIQUE_ATTR_VALUE);
tx.createAttribute(CoreArtifactTokens.OseeAdmin, CoreAttributeTypes.Annotation, UNIQUE_ATTR_VALUE);
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
index 1f231de45c..3d560f312b 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
@@ -17,7 +17,6 @@ import static org.eclipse.osee.framework.core.enums.BranchState.CREATION_IN_PROG
import static org.eclipse.osee.framework.core.enums.BranchType.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.BranchType.WORKING;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.util.Arrays;
@@ -345,7 +344,7 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON_ID, iterator.next());
+ assertEquals(COMMON.getId(), iterator.next());
}
@Test
@@ -375,7 +374,7 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON_ID, iterator.next());
+ assertEquals(COMMON.getId(), iterator.next());
}
@Test
@@ -415,7 +414,7 @@ public class BranchQuerySqlContextFactoryImplTest {
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON_ID, iterator.next());
+ assertEquals(COMMON.getId(), iterator.next());
assertEquals(WORKING.getValue(), iterator.next());
assertEquals(joins.get(0).getQueryId(), iterator.next());
assertEquals(ARCHIVED.getValue(), iterator.next());
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
index 4f014398bd..e082b299ec 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
@@ -123,7 +123,7 @@ public class OseeClientImpl implements OseeClient, QueryExecutor {
includeDeleted = true;
}
- SearchRequest params = new SearchRequest(branch.getUuid(), predicates, requestType, fromTx, includeDeleted);
+ SearchRequest params = new SearchRequest(branch, predicates, requestType, fromTx, includeDeleted);
JaxRsWebTarget resource = newTarget("branch/{branch-uuid}/artifact/search/v1", branch.getUuid());
try {
diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchParameters.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchParameters.java
index 970ce60488..64884b4dbe 100644
--- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchParameters.java
+++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchParameters.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.rest.model.search.artifact;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
/**
* @author John R. Misinco
@@ -18,7 +19,7 @@ import java.util.List;
*/
public interface SearchParameters {
- Long getBranchUuid();
+ BranchId getBranch();
List<Predicate> getPredicates();
diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchRequest.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchRequest.java
index cdd5305e48..bc85edefbb 100644
--- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchRequest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/search/artifact/SearchRequest.java
@@ -15,6 +15,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
+import org.eclipse.osee.framework.core.data.BranchId;
/**
* @author John R. Misinco
@@ -23,7 +24,7 @@ import javax.xml.bind.annotation.XmlTransient;
@XmlRootElement(name = "SearchRequest")
public class SearchRequest implements SearchParameters {
- private Long branchUuid;
+ private BranchId branch;
private RequestType type;
private int fromTx;
private boolean includeDeleted;
@@ -35,9 +36,8 @@ public class SearchRequest implements SearchParameters {
super();
}
- public SearchRequest(Long branchUuid, List<Predicate> predicates, RequestType type, int fromTx, boolean includeDeleted) {
- super();
- this.branchUuid = branchUuid;
+ public SearchRequest(BranchId branch, List<Predicate> predicates, RequestType type, int fromTx, boolean includeDeleted) {
+ this.branch = branch;
this.predicates = predicates;
this.type = type;
this.fromTx = fromTx;
@@ -45,8 +45,8 @@ public class SearchRequest implements SearchParameters {
}
@Override
- public Long getBranchUuid() {
- return branchUuid;
+ public BranchId getBranch() {
+ return branch;
}
@Override
@@ -61,8 +61,8 @@ public class SearchRequest implements SearchParameters {
return type;
}
- public void setBranchUuid(Long uuid) {
- this.branchUuid = uuid;
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
}
public void setPredicates(List<Predicate> predicates) {
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/ArtifactSearch_V1Test.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/ArtifactSearch_V1Test.java
index f53c08fa1a..ca991d49d4 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/ArtifactSearch_V1Test.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/ArtifactSearch_V1Test.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.search;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Collection;
@@ -60,13 +60,13 @@ public class ArtifactSearch_V1Test {
@Test
public void testSearchRequestNull() throws OseeCoreException {
when(orcsApi.getQueryFactory()).thenReturn(queryFactory);
- when(queryFactory.fromBranch(COMMON_ID)).thenReturn(builder);
+ when(queryFactory.fromBranch(COMMON)).thenReturn(builder);
Collection<IAttributeType> attrTypes = PredicateHandlerUtil.getIAttributeTypes(types);
Predicate predicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, types, Arrays.asList("AtsAdmin"));
when(builder.and(attrTypes, predicate.getValues().iterator().next(), predicate.getOptions())).thenReturn(builder);
- SearchRequest params = new SearchRequest(COMMON_ID, Arrays.asList(predicate), null, 0, false);
+ SearchRequest params = new SearchRequest(COMMON, Arrays.asList(predicate), null, 0, false);
SearchResponse response = search.getSearchWithMatrixParams(params);
Assert.assertEquals(response.getSearchRequest(), params);
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/dsl/SearchDslTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/dsl/SearchDslTest.java
index 8d71cab142..a306bdf62d 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/dsl/SearchDslTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/dsl/SearchDslTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.search.dsl;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
-import static org.mockito.Matchers.any;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.Arrays;
@@ -26,7 +25,6 @@ import org.eclipse.osee.orcs.rest.model.search.artifact.SearchMethod;
import org.eclipse.osee.orcs.rest.model.search.artifact.SearchRequest;
import org.eclipse.osee.orcs.search.QueryBuilder;
import org.eclipse.osee.orcs.search.QueryFactory;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -60,16 +58,15 @@ public class SearchDslTest {
@Test
public void testBuildValidSearchType() throws OseeCoreException {
- when(queryFactory.fromBranch(any(Long.class))).thenReturn(builder);
+ when(queryFactory.fromBranch(COMMON)).thenReturn(builder);
Predicate predicate =
new Predicate(SearchMethod.ATTRIBUTE_TYPE, Arrays.asList("1000000000000070"), Arrays.asList("AtsAdmin"));
- SearchRequest params = new SearchRequest(COMMON_ID, Arrays.asList(predicate), RequestType.IDS, 0, false);
+ SearchRequest params = new SearchRequest(COMMON, Arrays.asList(predicate), RequestType.IDS, 0, false);
dsl.build(queryFactory, params);
- verify(queryFactory).fromBranch(fromBranch.capture());
- Assert.assertEquals(COMMON_ID, fromBranch.getValue());
+ verify(queryFactory).fromBranch(COMMON);
verify(handler).handle(builder, predicate);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/search/artifact/dsl/SearchQueryBuilder.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/search/artifact/dsl/SearchQueryBuilder.java
index c33ff9e39e..5810d59ef8 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/search/artifact/dsl/SearchQueryBuilder.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/search/artifact/dsl/SearchQueryBuilder.java
@@ -37,7 +37,7 @@ public class SearchQueryBuilder {
public QueryBuilder build(QueryFactory queryFactory, SearchRequest params) throws OseeCoreException {
Conditions.checkNotNull(queryFactory, "queryFactory");
Conditions.checkNotNull(params, "params");
- QueryBuilder builder = queryFactory.fromBranch(params.getBranchUuid());
+ QueryBuilder builder = queryFactory.fromBranch(params.getBranch());
List<Predicate> predicates = params.getPredicates();
if (predicates != null) {
for (Predicate predicate : predicates) {
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
index dd853d5c65..921d45b2a0 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsValidationHelperAdapter.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal.writer;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -34,7 +34,7 @@ public class OrcsValidationHelperAdapter implements IOrcsValidationHelper {
@Override
public boolean isUserExists(String userId) {
- return orcsApi.getQueryFactory().fromBranch(COMMON_ID).and(CoreAttributeTypes.UserId,
+ return orcsApi.getQueryFactory().fromBranch(COMMON).and(CoreAttributeTypes.UserId,
userId).getResults().getAtMostOneOrNull() != null;
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterCollectorGenerator.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterCollectorGenerator.java
index eb192f4947..9670b8db57 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterCollectorGenerator.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/writer/OrcsWriterCollectorGenerator.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.rest.internal.writer;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -66,8 +65,8 @@ public class OrcsWriterCollectorGenerator {
collector.setPersistComment("Put Comment Here");
collector.setAsUserId(SystemUser.OseeSystem.getUserId());
collector.getBranch().setName(COMMON.getName());
- collector.getBranch().setUuid(COMMON_ID);
- collector.getBranch().setData(String.format("[%s]-[%s]", COMMON.getName(), COMMON_ID));
+ collector.getBranch().setUuid(COMMON.getId());
+ collector.getBranch().setData(String.format("[%s]-[%s]", COMMON.getName(), COMMON.getId()));
createInstructions();
createCreateSheet();
createUpdateSheet();
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
index 1e7c042bd1..8ff8826bed 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.api;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -56,11 +56,9 @@ public class OrcsAttributeLoadingTest {
OseeClassDatabase.cleanup();
}
- @SuppressWarnings("unchecked")
@Test
public void testAttributeLoading() throws Exception {
- ArtifactReadable art =
- query.fromBranch(COMMON_ID).andIds(CoreArtifactTokens.Everyone).getResults().getExactlyOne();
+ ArtifactReadable art = query.fromBranch(COMMON).andIds(CoreArtifactTokens.Everyone).getResults().getExactlyOne();
Assert.assertNotNull(art);
assertEquals("Everyone", art.getSoleAttributeAsString(CoreAttributeTypes.Name));
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
index d7d9ced9c9..d89f31ffcf 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.api;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -56,7 +56,7 @@ public class OrcsAttributeSearchTest {
@Test
public void testNameAttributeEqualSearch() throws OseeCoreException {
- QueryBuilder builder = queryFactory.fromBranch(COMMON_ID).and(CoreAttributeTypes.Name, "User Groups");
+ QueryBuilder builder = queryFactory.fromBranch(COMMON).and(CoreAttributeTypes.Name, "User Groups");
ResultSet<ArtifactReadable> resultSet = builder.getResults();
@@ -85,7 +85,7 @@ public class OrcsAttributeSearchTest {
@Test
public void testBooleanAttributeSearch() throws OseeCoreException {
- QueryBuilder builder = queryFactory.fromBranch(COMMON_ID).and(CoreAttributeTypes.DefaultGroup, "true");
+ QueryBuilder builder = queryFactory.fromBranch(COMMON).and(CoreAttributeTypes.DefaultGroup, "true");
ResultSet<ArtifactReadable> resultSet = builder.getResults();
assertEquals(1, resultSet.size());
@@ -97,15 +97,15 @@ public class OrcsAttributeSearchTest {
@Test
public void testNullAttributeSearch() {
- QueryBuilder builder = queryFactory.fromBranch(COMMON_ID).and(CoreAttributeTypes.Email, (String) null);
+ QueryBuilder builder = queryFactory.fromBranch(COMMON).and(CoreAttributeTypes.Email, (String) null);
ResultSet<ArtifactReadable> resultSet = builder.getResults();
assertEquals(8, resultSet.size());
- builder = queryFactory.fromBranch(COMMON_ID).and(CoreAttributeTypes.Email, "");
+ builder = queryFactory.fromBranch(COMMON).and(CoreAttributeTypes.Email, "");
resultSet = builder.getResults();
assertEquals(8, resultSet.size());
- builder = queryFactory.fromBranch(COMMON_ID).and(CoreAttributeTypes.Email, " ");
+ builder = queryFactory.fromBranch(COMMON).and(CoreAttributeTypes.Email, " ");
resultSet = builder.getResults();
assertEquals(0, resultSet.size());
}
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
index 39fb9f2635..635383c62f 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.api;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_2;
import static org.junit.Assert.assertEquals;
@@ -95,8 +95,8 @@ public class OrcsQueryTest {
}
@Test
- public void testAllArtifactsFromBranch() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ public void testAllArtifactsFromBranch() {
+ QueryBuilder builder = factory.fromBranch(COMMON);
assertEquals(245, builder.getCount());
assertEquals(245, builder.getResults().size());
@@ -104,21 +104,21 @@ public class OrcsQueryTest {
@Test
public void testNameAttributeNotExists() {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
builder.andNotExists(CoreAttributeTypes.Name);
assertEquals(0, builder.getCount());
}
@Test
public void testAttributeNotExists() {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
builder.andNotExists(CoreAttributeTypes.Afha);
assertTrue(builder.getCount() >= 245);
}
@Test
public void testQueryByIds() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID).andId(CoreArtifactTokens.UserGroups);
+ QueryBuilder builder = factory.fromBranch(COMMON).andId(CoreArtifactTokens.UserGroups);
assertEquals(1, builder.getCount());
ArtifactReadable artifact = builder.getResults().getExactlyOne();
@@ -127,7 +127,7 @@ public class OrcsQueryTest {
@Test
public void testQueryArtifactType() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID).andIsOfType(CoreArtifactTypes.Folder);
+ QueryBuilder builder = factory.fromBranch(COMMON).andIsOfType(CoreArtifactTypes.Folder);
assertTrue(builder.getCount() >= 6);
@@ -171,7 +171,7 @@ public class OrcsQueryTest {
@Test
public void testQueryArtifactTypesMatch() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
builder.andTypeEquals(CoreArtifactTypes.OseeTypeDefinition, CoreArtifactTypes.Folder);
assertTrue(builder.getCount() >= 14);
@@ -198,7 +198,7 @@ public class OrcsQueryTest {
@Test
public void testQueryAttributeValue() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
builder.and(CoreAttributeTypes.Name, "User Groups");
assertEquals(1, builder.getCount());
@@ -226,7 +226,7 @@ public class OrcsQueryTest {
@Test
public void testQueryMultipleArtifactType() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
builder.andIsOfType(CoreArtifactTypes.AccessControlModel, CoreArtifactTypes.GlobalPreferences);
assertEquals(2, builder.getCount());
@@ -242,7 +242,7 @@ public class OrcsQueryTest {
@Test
public void testQueryMultipleAttributeExistsType() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
List<IAttributeType> attributeTypes =
Arrays.asList(CoreAttributeTypes.AccessContextId, CoreAttributeTypes.Dictionary);
builder.andExists(attributeTypes);
@@ -254,7 +254,7 @@ public class OrcsQueryTest {
@Test
public void testQueryMultipleAttributeNotExistsType() throws OseeCoreException {
- QueryBuilder builder = factory.fromBranch(COMMON_ID);
+ QueryBuilder builder = factory.fromBranch(COMMON);
List<IAttributeType> attributeTypes = Arrays.asList(CoreAttributeTypes.ContentUrl, CoreAttributeTypes.Name);
builder.andNotExists(attributeTypes);
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java
index b3746e52f6..df67b6d983 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.api;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.SystemUser.OseeSystem;
import java.util.ArrayList;
import java.util.List;
@@ -19,7 +20,6 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TupleTypeId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreTupleTypes;
import org.eclipse.osee.framework.core.enums.DemoBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -81,7 +81,7 @@ public class OrcsTupleTest {
public void testAddTuple2() throws OseeCoreException {
TupleTypeId createTuple2Type = TupleTypeId.valueOf(24L);
TransactionBuilder transaction =
- orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, OseeSystem, "Add Tuple2 Test");
+ orcsApi.getTransactionFactory().createTransaction(COMMON, OseeSystem, "Add Tuple2 Test");
Long gamma_id = transaction.addTuple(createTuple2Type, 234L, "t");
transaction.commit();
@@ -95,7 +95,7 @@ public class OrcsTupleTest {
public void testAddTuple3() throws OseeCoreException {
TupleTypeId createTuple3Type = TupleTypeId.valueOf(44L);
TransactionBuilder transaction =
- orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, OseeSystem, "Add Tuple3 Test");
+ orcsApi.getTransactionFactory().createTransaction(COMMON, OseeSystem, "Add Tuple3 Test");
Long gamma_id = transaction.addTuple(createTuple3Type, 244L, 12L, "three");
transaction.commit();
@@ -109,7 +109,7 @@ public class OrcsTupleTest {
public void testAddTuple4() throws OseeCoreException {
TupleTypeId createTuple4Type = TupleTypeId.valueOf(44L);
TransactionBuilder transaction =
- orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, OseeSystem, "Add Tuple4 Test");
+ orcsApi.getTransactionFactory().createTransaction(COMMON, OseeSystem, "Add Tuple4 Test");
Long gamma_id = transaction.addTuple(createTuple4Type, 244L, 12L, "four", "four2");
transaction.commit();

Back to the top