Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-05-31 13:29:20 -0400
committerdonald.g.dunne2018-06-04 18:13:29 -0400
commit520e788e2dd8dab378651170cac7ca1f2f4ccbe1 (patch)
tree3543f27b183fdb04633917084ad63c70d20f4753
parentd1ee67f25e84d910a9ea32a119ca5467e443abbf (diff)
downloadorg.eclipse.osee-520e788e2dd8dab378651170cac7ca1f2f4ccbe1.tar.gz
org.eclipse.osee-520e788e2dd8dab378651170cac7ca1f2f4ccbe1.tar.xz
org.eclipse.osee-520e788e2dd8dab378651170cac7ca1f2f4ccbe1.zip
refactor: Remove un-necessary guid from ATS
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/query/IAtsQueryService.java11
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsObjectTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsColumnId.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionActivityColumn.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionColumn.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/AtsColumnService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/WorkPackageColumn.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsQueryService.java59
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsObjects.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionUiResource.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/StateResource.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/OpenWorkPackageByIdAction.java15
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/SearchWorkPackageOperation.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/AtsQuickSearchOperation.java32
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/internal/query/AtsQueryServiceImpl.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/review/defect/ReviewDefectManager.java2
22 files changed, 94 insertions, 99 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/query/IAtsQueryService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/query/IAtsQueryService.java
index 4a1b6fc4d3..712a29f2b8 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/query/IAtsQueryService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/query/IAtsQueryService.java
@@ -105,6 +105,8 @@ public interface IAtsQueryService {
ArtifactToken getArtifactByAtsId(String id);
+ ArtifactToken getArtifactByIdOrAtsId(String id);
+
ArtifactToken getArtifactByLegacyPcrId(String id);
Collection<ArtifactToken> getArtifactsByLegacyPcrId(String id);
@@ -120,8 +122,6 @@ public interface IAtsQueryService {
@Nullable
<T extends IAtsObject> ArtifactToken getArtifact(T atsObject);
- <T> T getConfigItem(String guid);
-
<T> T getConfigItem(Long id);
<T> T getConfigItem(ArtifactId artId);
@@ -151,8 +151,13 @@ public interface IAtsQueryService {
ArtifactToken getHistoricalArtifactOrNull(ArtifactId artifact, TransactionToken transaction, DeletionFlag deletionFlag);
/**
- * This should be use sparingly and in many cases, only in database conversions as code moves away from guid
+ * This method should be used sparingly. Use long ids instead.
*/
ArtifactToken getArtifactByGuid(String guid);
+ /**
+ * Search using comma deliminated long ids and/or ATS Ids
+ */
+ Collection<ArtifactToken> getArtifactsByIdsOrAtsIds(String searchStr);
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
index 68c2ba6787..ca4c7475a7 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
@@ -113,11 +113,11 @@ public class SearchWorkPackageOperationTest {
ais, includeChildrenAIs, activeOption);
Operations.executeWorkAndCheckStatus(operation);
Set<Artifact> resultArtifacts = operation.getResultArtifacts();
- Collection<Long> resultArtifactGuids = Artifacts.toIdsL(resultArtifacts);
+ Collection<Long> resultArtifactIds = Artifacts.toIdsL(resultArtifacts);
Assert.assertEquals(resultSize, expectedWpIds.size(), resultArtifacts.size());
for (Long expectedId : expectedWpIds) {
Assert.assertTrue("Expected id " + expectedId + " not found in results",
- resultArtifactGuids.contains(expectedId));
+ resultArtifactIds.contains(expectedId));
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsObjectTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsObjectTest.java
index 18fb8016a7..7afb86f29f 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsObjectTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsObjectTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
public class AtsObjectTest {
@Test
- public void testGetNameGuidId() {
+ public void testGetNameId() {
AtsObject obj = new AtsObject("hello", 456);
Assert.assertEquals("hello", obj.getName());
Assert.assertEquals(456, obj.getId().longValue());
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsColumnId.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsColumnId.java
index ea78904c6c..8626826dc7 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsColumnId.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsColumnId.java
@@ -55,7 +55,6 @@ public enum AtsColumnId implements IAtsColumnId {
WorkPackageId("ats.column.workPackageId"),
WorkPackageType("ats.column.workPackageType"),
WorkPackageProgram("ats.column.workPackageProgram"),
- WorkPackageGuid("ats.column.workPackageGuid"),
Implementers("ats.column.implementer"),;
private final String id;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionActivityColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionActivityColumn.java
index e602ad56c2..01efa8cb98 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionActivityColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionActivityColumn.java
@@ -33,7 +33,7 @@ public class InsertionActivityColumn extends AbstractServicesColumn {
}
/**
- * Set optional map to use as a cache of work item id (Long) or work package guid (String) to Insertion Activity
+ * Set optional map to use as a cache of work item id (Long) or work package id (String) to Insertion Activity
* artifact.
*/
public void setIdToInsertionActivityCache(Map<Object, ArtifactToken> idToInsertionActivity) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionColumn.java
index 5c748ca6fa..eb5fb267a8 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/InsertionColumn.java
@@ -34,7 +34,7 @@ public class InsertionColumn extends AbstractServicesColumn {
}
/**
- * Set optional map to use as a cache of work item id (Long) or work package guid (String) to Insertion artifact.
+ * Set optional map to use as a cache of work item id (Long) or work package id (String) to Insertion artifact.
*/
public void setIdToInsertionCache(Map<Object, ArtifactToken> idToInsertion) {
this.idToInsertion = idToInsertion;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
index a5a0da28b5..3e21a44dc0 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
@@ -23,8 +23,8 @@ import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
/**
- * Provide ATS Caching by id, guid and application tags. These are evacuating caches that will expire 15 minutes after
- * being cached.
+ * Provide ATS Caching by id and application tags. These are evacuating caches that will expire 15 minutes after being
+ * cached.
*
* @author Donald G. Dunne
*/
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/AtsColumnService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/AtsColumnService.java
index 2ab20a8455..7791d01154 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/AtsColumnService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/AtsColumnService.java
@@ -142,8 +142,6 @@ public class AtsColumnService implements IAtsColumnService {
column = new WorkPackageTypeColumn(atsApi.getEarnedValueServiceProvider(), atsApi);
} else if (id.equals(AtsColumnId.WorkPackageProgram.getId())) {
column = new WorkPackageProgramColumn(atsApi.getEarnedValueServiceProvider(), atsApi);
- } else if (id.equals(AtsColumnId.WorkPackageGuid.getId())) {
- column = new WorkPackageArtIdColumn(atsApi.getEarnedValueServiceProvider(), atsApi);
} else if (id.equals(AtsColumnId.State.getId())) {
column = new StateColumn(atsApi);
} else if (id.equals(AtsColumnId.Id.getId())) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/WorkPackageColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/WorkPackageColumn.java
index ea1e09f950..92596b9af5 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/WorkPackageColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/column/ev/WorkPackageColumn.java
@@ -42,11 +42,11 @@ public class WorkPackageColumn implements IWorkPackageUtility, IWorkPackageColum
}
/**
- * Set optional map to use as a cache of work item id (Long) or work package guid (String) to Insertion artifact.
+ * Set optional map to use as a cache of work item id (Long) or work package id (String) to Insertion artifact.
*/
@Override
- public void setIdToWorkPackageCache(Map<ArtifactId, ArtifactToken> guidToWorkPackage) {
- this.idToWorkPackage = guidToWorkPackage;
+ public void setIdToWorkPackageCache(Map<ArtifactId, ArtifactToken> idToWorkPackage) {
+ this.idToWorkPackage = idToWorkPackage;
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsQueryService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsQueryService.java
index c6a05ef6fc..1936446c27 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsQueryService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsQueryService.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.ItemDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
@@ -219,22 +220,6 @@ public abstract class AbstractAtsQueryService implements IAtsQueryService {
@SuppressWarnings("unchecked")
@Override
- public <T> T getConfigItem(String id) {
- T atsObject = null;
- if (Strings.isNumeric(id)) {
- atsObject = getCache().getAtsObject(Long.valueOf(id));
- if (atsObject == null) {
- ArtifactToken artifact = getArtifact(Long.valueOf(id));
- if (artifact != null && artifact instanceof IAtsConfigObject) {
- atsObject = (T) AtsObjects.getConfigObject(artifact, atsApi);
- }
- }
- }
- return atsObject;
- }
-
- @SuppressWarnings("unchecked")
- @Override
public <T> T getConfigItem(Long id) {
T atsObject = getCache().getAtsObject(id);
if (atsObject == null) {
@@ -277,4 +262,46 @@ public abstract class AbstractAtsQueryService implements IAtsQueryService {
return getArtifact(atsConfigObject.getId());
}
+ @Override
+ public ArtifactToken getArtifactByIdOrAtsId(String id) {
+ ArtifactToken art = null;
+ try {
+ if (Strings.isValid(id)) {
+ if (Strings.isNumeric(id)) {
+ art = getArtifact(Long.valueOf(id));
+ } else {
+ art = getArtifactByAtsId(id);
+ }
+ }
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing
+ }
+ return art;
+ }
+
+ @Override
+ public Collection<ArtifactToken> getArtifactsByIdsOrAtsIds(String searchStr) {
+ List<ArtifactToken> artifacts = new LinkedList<>();
+ for (String str : searchStr.split(",")) {
+ str = str.replaceAll("^ ", "");
+ str = str.replaceAll("$ ", "");
+ try {
+ if (Strings.isValid(str)) {
+ ArtifactToken art = null;
+ if (Strings.isNumeric(str)) {
+ art = getArtifact(Long.valueOf(str));
+ } else {
+ art = getArtifactByAtsId(str);
+ }
+ if (art != null) {
+ artifacts.add(art);
+ }
+ }
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing
+ }
+ }
+ return artifacts;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsObjects.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsObjects.java
index e243f92f2a..593377040a 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsObjects.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsObjects.java
@@ -43,12 +43,12 @@ public class AtsObjects {
return ids;
}
- public static List<String> toGuids(Collection<? extends IAtsObject> atsObjects) {
- List<String> guids = new ArrayList<>(atsObjects.size());
+ public static List<ArtifactId> toArtifactIds(Collection<? extends IAtsObject> atsObjects) {
+ List<ArtifactId> ids = new ArrayList<>(atsObjects.size());
for (IAtsObject atsObject : atsObjects) {
- guids.add(atsObject.getStoreObject().getGuid());
+ ids.add(atsObject.getStoreObject());
}
- return guids;
+ return ids;
}
public static List<String> toAtsIds(Collection<? extends IAtsWorkItem> workItem) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
index b2fe1c9499..f53ccc91b0 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
@@ -51,11 +51,11 @@ public class ConvertAtsConfigGuidAttributesOperations {
List<ArtifactId> neededAiRefIds = new LinkedList<>();
for (IAttribute<?> attr : atsApi.getAttributeResolver().getAttributes(art, ActionableItem)) {
String aiArtGuid = (String) attr.getValue();
- IAtsActionableItem ai = atsApi.getQueryService().getConfigItem(aiArtGuid);
+ ArtifactToken ai = atsApi.getQueryService().getArtifactByGuid(aiArtGuid);
if (ai == null) {
atsApi.getLogger().error("AI not found for aiArtGuid " + aiArtGuid + " for art " + art.toStringWithId());
} else if (!currentAiRefIds.contains(ai.getId())) {
- neededAiRefIds.add(ai.getStoreObject());
+ neededAiRefIds.add(ai);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
index f6a53e5612..bca536e2fc 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
@@ -227,7 +227,7 @@ public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
IAtsWorkItem workItem = null;
ArtifactToken artifact = null;
if (GUID.isValid(actionId)) {
- artifact = atsApi.getQueryService().getConfigItem(actionId);
+ artifact = atsApi.getQueryService().getArtifactByGuid(actionId);
} else if (Strings.isNumeric(actionId)) {
artifact = atsApi.getQueryService().getArtifact(Long.valueOf(actionId));
} else {
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
index 3dca6f99a7..7aa114f4ab 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
@@ -82,8 +82,8 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public List<IAtsWorkItem> reload(Collection<IAtsWorkItem> inWorkWorkflows) {
List<IAtsWorkItem> workItems = new ArrayList<>(inWorkWorkflows.size());
- List<String> guids = AtsObjects.toGuids(inWorkWorkflows);
- Iterator<ArtifactReadable> arts = getQuery().andGuids(guids).getResults().iterator();
+ List<ArtifactId> ids = AtsObjects.toArtifactIds(inWorkWorkflows);
+ Iterator<ArtifactReadable> arts = getQuery().andIds(ids).getResults().iterator();
while (arts.hasNext()) {
workItems.add(atsApi.getWorkItemService().getWorkItem(arts.next()));
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionUiResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionUiResource.java
index 5c9ac3a134..0da88953a5 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionUiResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionUiResource.java
@@ -84,7 +84,7 @@ public final class ActionUiResource {
}
/**
- * @param id (guid, atsId) of action to display
+ * @param id (id, atsId) of action to display
* @return html representation of the action
*/
@Path("{id}/details")
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/StateResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/StateResource.java
index ec2bf6bfc0..f38da01aa5 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/StateResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/StateResource.java
@@ -45,7 +45,7 @@ public final class StateResource {
/**
* @param form containing information to transition action
- * @param form.id (guid or atsId) of action to transition
+ * @param form.id (id or atsId) of action to transition
* @param form.operation - transition
* @param form.toState - name of state to transition to
* @param form.reason - reason if this transition is a cancel
@@ -56,7 +56,7 @@ public final class StateResource {
@Consumes("application/x-www-form-urlencoded")
public Object addOrUpdateAction(MultivaluedMap<String, String> form, @Context UriInfo uriInfo) throws Exception {
- String id = form.getFirst("guid");
+ String id = form.getFirst("id");
if (!Strings.isValid(id)) {
id = form.getFirst("atsId");
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/OpenWorkPackageByIdAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/OpenWorkPackageByIdAction.java
index ab894fe76b..138a9317b0 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/OpenWorkPackageByIdAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/OpenWorkPackageByIdAction.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -54,28 +53,20 @@ public class OpenWorkPackageByIdAction extends Action {
@Override
public void run() {
- EntryDialog dialog = new EntryDialog(getText(), "Enter Work Package guid, activity id or financial id");
+ EntryDialog dialog = new EntryDialog(getText(), "Enter Work Package id, activity id or financial id");
if (dialog.open() == Window.OK) {
final List<String> ids = new LinkedList<String>();
- final List<String> guids = new LinkedList<>();
for (String str : dialog.getEntry().split(",")) {
str = str.replaceAll("^\\s+", "");
str = str.replaceAll("\\s+$", "");
- if (Strings.isValid(str)) {
- if (GUID.isValid(str)) {
- guids.add(str);
- } else {
- ids.add(str);
- }
+ if (Strings.isNumeric(str)) {
+ ids.add(str);
}
Job searchWps = new Job(getText()) {
@Override
protected IStatus run(IProgressMonitor monitor) {
List<Artifact> results = new LinkedList<>();
- if (!guids.isEmpty()) {
- results.addAll(ArtifactQuery.getArtifactListFromIds(guids, AtsClientService.get().getAtsBranch()));
- }
if (!ids.isEmpty()) {
results.addAll(ArtifactQuery.getArtifactListFromAttributeValues(AtsAttributeTypes.ActivityId, ids,
AtsClientService.get().getAtsBranch(), 5));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/SearchWorkPackageOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/SearchWorkPackageOperation.java
index c8bda47428..90ebf12127 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/SearchWorkPackageOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/SearchWorkPackageOperation.java
@@ -24,12 +24,13 @@ import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.core.model.WorkPackage;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.search.AtsArtifactQuery;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
/**
* @author Donald G. Dunne
@@ -61,11 +62,11 @@ public class SearchWorkPackageOperation extends AbstractOperation {
throw new OseeArgumentException("ERROR", "Must provide Team Definitions or Actionable Items");
}
checkForCancelledStatus(monitor);
- List<String> guids = new ArrayList<>();
- addAllTeamDefGuids(monitor, teamDefs, includeChildrenTeamDefs, guids);
- addAllAisGuids(monitor, ais, includeChildrenAis, guids);
+ List<ArtifactId> ids = new ArrayList<>();
+ addAllTeamDefIds(monitor, teamDefs, includeChildrenTeamDefs, ids);
+ addAllAisIds(monitor, ais, includeChildrenAis, ids);
- for (Artifact teamOrAiArt : AtsArtifactQuery.getArtifactListFromIds(guids)) {
+ for (Artifact teamOrAiArt : ArtifactQuery.getArtifactListFrom(ids, AtsClientService.get().getAtsBranch())) {
for (Artifact workPkgArt : teamOrAiArt.getRelatedArtifacts(AtsRelationTypes.WorkPackage_WorkPackage)) {
boolean active = workPkgArt.getSoleAttributeValue(AtsAttributeTypes.Active, true);
if (activeWorkPkgs == Active.Both || active && activeWorkPkgs == Active.Active || !active && activeWorkPkgs == Active.InActive) {
@@ -77,21 +78,21 @@ public class SearchWorkPackageOperation extends AbstractOperation {
}
}
- private void addAllAisGuids(IProgressMonitor monitor, Collection<IAtsActionableItem> ais2, boolean includeChildrenAis2, List<String> guids) {
+ private void addAllAisIds(IProgressMonitor monitor, Collection<IAtsActionableItem> ais2, boolean includeChildrenAis2, List<ArtifactId> ids) {
for (IAtsActionableItem ai : ais2) {
- guids.add(ai.getStoreObject().getGuid());
+ ids.add(ai.getStoreObject());
if (includeChildrenAis2) {
- addAllAisGuids(monitor, ai.getChildrenActionableItems(), includeChildrenAis2, guids);
+ addAllAisIds(monitor, ai.getChildrenActionableItems(), includeChildrenAis2, ids);
checkForCancelledStatus(monitor);
}
}
}
- private void addAllTeamDefGuids(IProgressMonitor monitor, Collection<IAtsTeamDefinition> teamDefs2, boolean includeChildrenTeamDefs2, List<String> guids) {
+ private void addAllTeamDefIds(IProgressMonitor monitor, Collection<IAtsTeamDefinition> teamDefs2, boolean includeChildrenTeamDefs2, List<ArtifactId> ids) {
for (IAtsTeamDefinition teamDef : teamDefs2) {
- guids.add(teamDef.getStoreObject().getGuid());
+ ids.add(teamDef.getStoreObject());
if (includeChildrenTeamDefs2) {
- addAllTeamDefGuids(monitor, teamDef.getChildrenTeamDefinitions(), includeChildrenTeamDefs2, guids);
+ addAllTeamDefIds(monitor, teamDef.getChildrenTeamDefinitions(), includeChildrenTeamDefs2, ids);
checkForCancelledStatus(monitor);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
index 84c361eeb7..3e1ef4d85a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.branch.AtsBranchUtil;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.search.AtsArtifactQuery;
import org.eclipse.osee.ats.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.util.OseeInf;
@@ -55,7 +54,7 @@ public class CreateWorkingBranchFromTxBlam extends AbstractBlam {
String idNumber = pairs[0];
TransactionToken parentTransactionId = TransactionManager.getTransaction(Long.valueOf(pairs[1]));
try {
- Artifact art = AtsArtifactQuery.getArtifactFromId(idNumber);
+ Artifact art = (Artifact) AtsClientService.get().getQueryService().getArtifactByIdOrAtsId(idNumber);
if (art.isOfType(AtsArtifactTypes.TeamWorkflow)) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) art;
if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/AtsQuickSearchOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/AtsQuickSearchOperation.java
index 2615c8f6fd..60d22ab7ef 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/AtsQuickSearchOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/AtsQuickSearchOperation.java
@@ -10,23 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.ats.search;
-import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.world.IWorldEditorConsumer;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorOperation;
import org.eclipse.osee.ats.world.WorldEditorOperationProvider;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
@@ -64,31 +61,8 @@ class AtsQuickSearchOperation extends AbstractOperation implements WorldEditorOp
@Override
public Collection<Artifact> performSearch() {
allArtifacts.clear();
- for (String str : data.getSearchStr().split(", ")) {
- try {
- Artifact art = AtsArtifactQuery.getArtifactFromId(str);
- if (art != null) {
- allArtifacts.add(art);
- }
- } catch (ArtifactDoesNotExist ex) {
- // do nothing
- }
- }
- for (Artifact art : ArtifactQuery.getArtifactListFromAttributeKeywords(AtsClientService.get().getAtsBranch(),
- data.getSearchStr(), false, EXCLUDE_DELETED, false)) {
- // only ATS Artifacts
- if (art instanceof AbstractWorkflowArtifact) {
- AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) art;
- // default excludes canceled/completed
- if (data.isIncludeCompleteCancelled() == false) {
- if (!awa.isCompletedOrCancelled()) {
- allArtifacts.add(art);
- }
- } else {
- allArtifacts.add(art);
- }
- }
- }
+ allArtifacts.addAll(
+ Collections.castAll(AtsClientService.get().getQueryService().getArtifactsByIdsOrAtsIds(data.getSearchStr())));
return allArtifacts;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/internal/query/AtsQueryServiceImpl.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/internal/query/AtsQueryServiceImpl.java
index 40edb96a0b..5da16db069 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/internal/query/AtsQueryServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/internal/query/AtsQueryServiceImpl.java
@@ -363,4 +363,5 @@ public class AtsQueryServiceImpl extends AbstractAtsQueryService {
public ArtifactToken getArtifactByGuid(String guid) {
return ArtifactQuery.getArtifactFromId(guid, atsClient.getAtsBranch());
}
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/review/defect/ReviewDefectManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/review/defect/ReviewDefectManager.java
index 7176e53393..cc14af5f34 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/review/defect/ReviewDefectManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/review/defect/ReviewDefectManager.java
@@ -214,7 +214,7 @@ public class ReviewDefectManager {
public String getTable() {
StringBuilder builder = new StringBuilder();
builder.append(
- "<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Severity</TH>" + "<TH>Disposition</TH><TH>Injection</TH><TH>User</TH><TH>Date</TH><TH>Description</TH><TH>Location</TH>" + "<TH>Resolution</TH><TH>Guid</TH><TH>Completed</TH></THEAD></TR>");
+ "<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Severity</TH>" + "<TH>Disposition</TH><TH>Injection</TH><TH>User</TH><TH>Date</TH><TH>Description</TH><TH>Location</TH>" + "<TH>Resolution</TH><TH>Id</TH><TH>Completed</TH></THEAD></TR>");
for (ReviewDefectItem item : getDefectItems()) {
IAtsUser user = item.getUser();
builder.append("<TR>");

Back to the top