Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-06-16 23:52:23 +0000
committerdonald.g.dunne2017-07-18 17:49:47 +0000
commit9e7798002986ae572a2070a763296651c1563b98 (patch)
tree4208559871b0e18f711c7733e997b4d3a5c8559d
parente2f12c8592b2d933fecb9da568be122c4a65a45f (diff)
downloadorg.eclipse.osee-9e7798002986ae572a2070a763296651c1563b98.tar.gz
org.eclipse.osee-9e7798002986ae572a2070a763296651c1563b98.tar.xz
org.eclipse.osee-9e7798002986ae572a2070a763296651c1563b98.zip
bug[ats_ATS402006]: ATS config objects not loading prior to use
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigEndpointApi.java18
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java76
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxActionableItem.java61
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxAtsObject.java9
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxNewAtsConfigObject.java1
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxTeamDefinition.java76
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxVersion.java32
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java12
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java8
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java7
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/AtsUserTest.java12
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java7
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DbInitTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java54
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsConfigurationsService.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java13
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/ArtifactResolverImpl.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java14
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/SprintOrderColumn.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/TypeColumn.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java108
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java12
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java347
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/Versions.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsConfigQueryImpl.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java5
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java12
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java291
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java33
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java7
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ArtifactResolverImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java7
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java11
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemJsonWriter.java2
-rw-r--r--plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java34
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java23
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java4
53 files changed, 1186 insertions, 194 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigEndpointApi.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigEndpointApi.java
index efccbdb0c3..e5695286b7 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigEndpointApi.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigEndpointApi.java
@@ -31,11 +31,29 @@ import org.eclipse.osee.framework.jdk.core.type.ViewModel;
@Path("config")
public interface AtsConfigEndpointApi {
+ /**
+ * @return cached copy of AtsConfigurations that is reloaded every 5 minutes. Use getFromDb() for latest copy from
+ * database.
+ */
@GET
@Produces(MediaType.APPLICATION_JSON)
public AtsConfigurations get();
/**
+ * @return non-cached copy of AtsConfigurations read straight from database. Can take 30ish seconds to load. Use
+ * get() for quick access to cached copy.
+ */
+ @GET
+ @Path("fromdb")
+ @Produces(MediaType.APPLICATION_JSON)
+ public AtsConfigurations getFromDb();
+
+ @GET
+ @Path("clearcache")
+ @Produces(MediaType.APPLICATION_JSON)
+ public AtsConfigurations clearCaches();
+
+ /**
* @return html5 action entry page
*/
@GET
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
index 97d7582ae9..f10a48bbbd 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
@@ -33,9 +33,14 @@ public class AtsConfigurations implements IWorkDefinitionStringProvider {
private ColorColumns colorColumns = new ColorColumns();
List<JaxAtsUser> users = new ArrayList<>();
List<Long> atsAdmins = new ArrayList<>();
- List<Long> atsConfigIds = new ArrayList<>();
+ Long topActionableItem;
+ Long topTeamDefinition;
+ List<JaxVersion> versions = new ArrayList<>();
private Collection<String> validStateNames = new ArrayList<>();
private Map<String, String> workDefIdToWorkDef = new HashMap<>();
+ private Map<Long, JaxActionableItem> idToAi = new HashMap<>();
+ private Map<Long, JaxTeamDefinition> idToTeamDef = new HashMap<>();
+ private Map<Long, JaxVersion> idToVersion = new HashMap<>();
public List<AtsConfiguration> getConfigs() {
return configs;
@@ -65,19 +70,6 @@ public class AtsConfigurations implements IWorkDefinitionStringProvider {
this.users = users;
}
- public String getAtsConfigIdsStr() {
- return Collections.toString(",", atsConfigIds);
- }
-
- @JsonIgnore
- public List<Long> getAtsConfigIds() {
- return atsConfigIds;
- }
-
- public void setAtsConfigIdsStr(String atsConfigIdsStr) {
- parseStringOfLongs(this.atsConfigIds, atsConfigIdsStr);
- }
-
public Collection<String> getValidStateNames() {
return validStateNames;
}
@@ -120,4 +112,60 @@ public class AtsConfigurations implements IWorkDefinitionStringProvider {
this.workDefIdToWorkDef = workDefIdToWorkDef;
}
+ public Map<Long, JaxActionableItem> getIdToAi() {
+ return idToAi;
+ }
+
+ public void setIdToAi(Map<Long, JaxActionableItem> idToAi) {
+ this.idToAi = idToAi;
+ }
+
+ public Map<Long, JaxTeamDefinition> getIdToTeamDef() {
+ return idToTeamDef;
+ }
+
+ public void setIdToTeamDef(Map<Long, JaxTeamDefinition> idToTeamDef) {
+ this.idToTeamDef = idToTeamDef;
+ }
+
+ public Map<Long, JaxVersion> getIdToVersion() {
+ return idToVersion;
+ }
+
+ public void setIdToVersion(Map<Long, JaxVersion> idToVersion) {
+ this.idToVersion = idToVersion;
+ }
+
+ public Long getTopActionableItem() {
+ return topActionableItem;
+ }
+
+ public void setTopActionableItem(Long topActionableItem) {
+ this.topActionableItem = topActionableItem;
+ }
+
+ public Long getTopTeamDefinition() {
+ return topTeamDefinition;
+ }
+
+ public void setTopTeamDefinition(Long topTeamDefinition) {
+ this.topTeamDefinition = topTeamDefinition;
+ }
+
+ public void addTeamDef(JaxTeamDefinition teamDef) {
+ idToTeamDef.put(teamDef.getUuid(), teamDef);
+ }
+
+ public void addAi(JaxActionableItem ai) {
+ idToAi.put(ai.getUuid(), ai);
+ }
+
+ public void addVersion(JaxVersion version) {
+ idToVersion.put(version.getUuid(), version);
+ }
+
+ public void addWorkDefinition(String id, String workDefStr) {
+ workDefIdToWorkDef.put(id, workDefStr);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxActionableItem.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxActionableItem.java
new file mode 100644
index 0000000000..a06e03f500
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxActionableItem.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.ser.std.ToStringSerializer;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class JaxActionableItem extends JaxAtsConfigObject {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ Long parentId;
+ @JsonSerialize(using = ToStringSerializer.class)
+ Long teamDefId;
+ List<Long> children = new ArrayList<>();
+
+ public JaxActionableItem() {
+ // for jax-rs
+ }
+
+ public Long getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId) {
+ this.parentId = parentId;
+ }
+
+ public Long getTeamDefId() {
+ return teamDefId;
+ }
+
+ public void setTeamDefId(Long teamDefId) {
+ this.teamDefId = teamDefId;
+ }
+
+ public List<Long> getChildren() {
+ return children;
+ }
+
+ public void setChildren(List<Long> children) {
+ this.children = children;
+ }
+
+ public void addChild(JaxActionableItem child) {
+ children.add(child.getUuid());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxAtsObject.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxAtsObject.java
index dbaba40a9a..3a21d1d42e 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxAtsObject.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxAtsObject.java
@@ -25,6 +25,7 @@ public class JaxAtsObject {
private String name;
@JsonSerialize(using = ToStringSerializer.class)
private Long uuid;
+ private String guid;
private boolean active;
private String description;
@@ -114,4 +115,12 @@ public class JaxAtsObject {
this.description = description;
}
+ public String getGuid() {
+ return guid;
+ }
+
+ public void setGuid(String guid) {
+ this.guid = guid;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxNewAtsConfigObject.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxNewAtsConfigObject.java
index aa2bfc2733..cafa247c9e 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxNewAtsConfigObject.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxNewAtsConfigObject.java
@@ -17,4 +17,5 @@ import javax.xml.bind.annotation.XmlRootElement;
*/
@XmlRootElement
public class JaxNewAtsConfigObject extends JaxAtsObject {
+ // do nothing
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxTeamDefinition.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxTeamDefinition.java
new file mode 100644
index 0000000000..adc0ece0f8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxTeamDefinition.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.ser.std.ToStringSerializer;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class JaxTeamDefinition extends JaxAtsConfigObject {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ Long parentId;
+ List<Long> ais = new ArrayList<>();
+ List<Long> versions = new ArrayList<>();
+ List<Long> children = new ArrayList<>();
+
+ public JaxTeamDefinition() {
+ }
+
+ public Long getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId) {
+ this.parentId = parentId;
+ }
+
+ public List<Long> getAis() {
+ return ais;
+ }
+
+ public void setAis(List<Long> ais) {
+ this.ais = ais;
+ }
+
+ public List<Long> getVersions() {
+ return versions;
+ }
+
+ public void setVersions(List<Long> versions) {
+ this.versions = versions;
+ }
+
+ public List<Long> getChildren() {
+ return children;
+ }
+
+ public void setChildren(List<Long> children) {
+ this.children = children;
+ }
+
+ public void addChild(JaxTeamDefinition child) {
+ children.add(child.getUuid());
+ }
+
+ public void addVersion(Long version) {
+ versions.add(version);
+ }
+
+ public void addAi(Long aiId) {
+ ais.add(aiId);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxVersion.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxVersion.java
new file mode 100644
index 0000000000..5c6720241e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/JaxVersion.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.config;
+
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.ser.std.ToStringSerializer;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class JaxVersion extends JaxAtsConfigObject {
+
+ @JsonSerialize(using = ToStringSerializer.class)
+ Long teamDefId;
+
+ public Long getTeamDefId() {
+ return teamDefId;
+ }
+
+ public void setTeamDefId(Long teamDefId) {
+ this.teamDefId = teamDefId;
+ }
+
+}
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 5a639bfa96..4fb18c1e6b 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
@@ -51,6 +51,8 @@ public interface IAtsUserService {
List<? extends IAtsUser> getUsers();
+ List<? extends IAtsUser> getUsersFromDb();
+
IAtsUser getUserByAccountId(Long accountId);
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
index c0fa533cff..e8cdfa33da 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
@@ -58,4 +58,6 @@ public interface IRelationResolver {
int getRelatedCount(ArtifactToken artifact, RelationTypeSide relationTypeSide);
+ Collection<Long> getRelatedIds(ArtifactId artifact, RelationTypeSide relationTypeSide);
+
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
index 2fb945c39d..a743dbe6d6 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
@@ -498,16 +498,16 @@ public class AtsTestUtil {
delete(changes, actionArt3);
delete(changes, actionArt4);
if (verArt1 != null) {
- delete(changes, (Artifact) verArt1.getStoreObject());
+ delete(changes, AtsClientService.get().getArtifact(verArt1));
}
if (verArt2 != null) {
- delete(changes, (Artifact) verArt2.getStoreObject());
+ delete(changes, AtsClientService.get().getArtifact(verArt2));
}
if (verArt3 != null) {
- delete(changes, (Artifact) verArt3.getStoreObject());
+ delete(changes, AtsClientService.get().getArtifact(verArt3));
}
if (verArt4 != null) {
- delete(changes, (Artifact) verArt4.getStoreObject());
+ delete(changes, AtsClientService.get().getArtifact(verArt4));
}
if (!changes.isEmpty()) {
changes.execute();
@@ -521,8 +521,8 @@ public class AtsTestUtil {
SkynetTransaction transaction = TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(),
AtsTestUtil.class.getSimpleName() + " - cleanup config");
for (IAtsConfigObject config : Arrays.asList(teamDef, testAi, testAi2, testAi3, testAi4)) {
- if (config != null && config.getStoreObject() instanceof Artifact) {
- Artifact art = (Artifact) config.getStoreObject();
+ if (config != null) {
+ Artifact art = AtsClientService.get().getArtifact(config);
art.deleteAndPersist(transaction);
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
index 02a5425507..763cbe6615 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
@@ -82,7 +82,7 @@ public class AutoAddActionToGoalTest {
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
changes.execute();
@@ -114,7 +114,7 @@ public class AutoAddActionToGoalTest {
GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromTeamDef", changes);
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
changes.execute();
@@ -143,7 +143,7 @@ public class AutoAddActionToGoalTest {
IAtsChangeSet changes = AtsClientService.get().createChangeSet(getClass().getSimpleName());
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
Artifact testAI2Art = AtsClientService.get().getArtifact(AtsTestUtil.getTestAi2());
@@ -186,7 +186,7 @@ public class AutoAddActionToGoalTest {
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
changes.execute();
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
index 0266d5ab0e..523b918914 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
@@ -67,7 +67,7 @@ public class AtsBranchServiceImplTest {
changes.setSoleAttributeValue(teamDef, AtsAttributeTypes.BaselineBranchUuid, SAW_Bld_1.getIdString());
// clear versions to config item is from teamDef
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
changes.execute();
Collection<Object> commitObjs =
@@ -88,7 +88,8 @@ public class AtsBranchServiceImplTest {
IAtsVersion version1 = AtsTestUtil.getVerArt1();
IAtsVersion version2 = AtsTestUtil.getVerArt2();
- changes.setRelation(version1.getStoreObject(), AtsRelationTypes.ParallelVersion_Child, version2.getStoreObject());
+ changes.setRelation(AtsClientService.get().getArtifact(version1), AtsRelationTypes.ParallelVersion_Child,
+ AtsClientService.get().getArtifact(version2));
AtsClientService.get().getVersionService().setTargetedVersion(teamArt, version1, changes);
changes.execute();
@@ -109,7 +110,7 @@ public class AtsBranchServiceImplTest {
changes.setSoleAttributeValue(teamDef, AtsAttributeTypes.BaselineBranchUuid, SAW_Bld_1.getIdString());
// clear versions to config item is from teamDef
for (IAtsVersion version : teamDef.getVersions()) {
- changes.deleteArtifact(version.getStoreObject());
+ changes.deleteArtifact(AtsClientService.get().getArtifact(version));
}
changes.execute();
//Test TxRecords
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
index 6031c39c9d..51e9a48564 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -124,7 +123,7 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
peerArt.isDirty());
Assert.assertEquals(PeerToPeerReviewState.Prepare.getName(), peerArt.getCurrentStateName());
Assert.assertEquals("Joe Smith", peerArt.getStateMgr().getAssigneesStr());
- Assert.assertEquals(((Artifact) AtsTestUtil.getTestAi().getStoreObject()).getGuid(),
+ Assert.assertEquals(AtsClientService.get().getArtifact(AtsTestUtil.getTestAi()).getGuid(),
peerArt.getSoleAttributeValue(AtsAttributeTypes.ActionableItem));
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/AtsUserTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/AtsUserTest.java
index e16b6d41a4..72b34919ce 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/AtsUserTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/AtsUserTest.java
@@ -21,18 +21,18 @@ import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
/**
* @author Donald G. Dunne
*/
public class AtsUserTest {
- private IAtsUser atsUser;
- private User user;
+ private static IAtsUser atsUser;
+ private static User user;
- @Before
- public void setUp() throws OseeCoreException {
+ @BeforeClass
+ public static void setUp() throws OseeCoreException {
user = UserManager.getUser();
atsUser = AtsClientService.get().getUserService().getCurrentUser();
}
@@ -48,7 +48,7 @@ public class AtsUserTest {
}
@org.junit.Test
- public void testGetEmail() throws OseeCoreException {
+ public void testGetEmail() throws Exception {
Assert.assertEquals(user.getEmail(), atsUser.getEmail());
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
index 86bf9783ee..c571aaeb87 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
@@ -52,7 +52,6 @@ import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.ws.AWorkspace;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -411,9 +410,9 @@ public class TransitionManagerTest {
Assert.assertTrue(results.isEmpty());
// validate that can't transition without targeted version when team def rule is set
- ((Artifact) teamArt.getTeamDefinition().getStoreObject()).addAttributeFromString(AtsAttributeTypes.RuleDefinition,
- RuleDefinitionOption.RequireTargetedVersion.name());
- ((Artifact) teamArt.getTeamDefinition().getStoreObject()).persist(getClass().getSimpleName());
+ AtsClientService.get().getArtifact(teamArt.getTeamDefinition()).addAttributeFromString(
+ AtsAttributeTypes.RuleDefinition, RuleDefinitionOption.RequireTargetedVersion.name());
+ AtsClientService.get().getArtifact(teamArt.getTeamDefinition()).persist(getClass().getSimpleName());
results.clear();
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.contains(teamArt, TransitionResult.MUST_BE_TARGETED_FOR_VERSION));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DbInitTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DbInitTest.java
index ee9e013d67..b24b439bb7 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DbInitTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DbInitTest.java
@@ -66,7 +66,8 @@ public class DbInitTest {
ClientSessionManager.releaseSession();
ClientSessionManager.getSession();
UserManager.releaseUser();
- AtsClientService.get().getUserService().releaseUser();
+ AtsClientService.getConfigEndpoint().clearCaches();
+ AtsClientService.get().getUserService().reloadCache();
if (UserManager.getUser().getUserId().equals("bootstrap")) {
throw new OseeStateException("Should not be bootstrap user here");
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
index 8ed05922a7..97ee3b51ad 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
@@ -93,6 +93,7 @@ public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolv
@Override
Artifact getArtifactByGuid(String guid);
+ @Override
Artifact getArtifactByAtsId(String id);
IArtifactMembersCache<GoalArtifact> getGoalMembersCache();
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java
index 37783a6653..d22ea6dff8 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java
@@ -96,7 +96,7 @@ public class AtsBranchUtil {
"Committed branch already exists. Can not create another working branch once changes have been committed.");
}
BranchId parentBranch = AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(teamArt);
- if (parentBranch == null) {
+ if (parentBranch == null || parentBranch.isInvalid()) {
return new Result(
"Parent Branch can not be determined.\n\nPlease specify " + "parent branch through Version Artifact or Team Definition Artifact.\n\n" + "Contact your team lead to configure this.");
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 3673489a97..fc5adcf5ce 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -25,6 +25,8 @@ import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.agile.IAgileService;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.config.JaxActionableItem;
+import org.eclipse.osee.ats.api.config.JaxTeamDefinition;
import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.notify.AtsNotificationCollector;
@@ -60,8 +62,10 @@ import org.eclipse.osee.ats.core.client.util.IArtifactMembersCache;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.ChangeTypeUtil;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionListeners;
+import org.eclipse.osee.ats.core.config.ActionableItem2;
import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
+import org.eclipse.osee.ats.core.config.TeamDefinition2;
import org.eclipse.osee.ats.core.util.ActionFactory;
import org.eclipse.osee.ats.core.util.AtsCoreFactory;
import org.eclipse.osee.ats.core.util.AtsCoreServiceImpl;
@@ -132,8 +136,8 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
queryService = new AtsQueryServiceImpl(this, jdbcService);
actionableItemManager = new ActionableItemManager(attributeResolverService, storeService, this);
- actionFactory = new ActionFactory(workItemFactory, getSequenceProvider(), actionableItemManager,
- attributeResolverService, stateFactory, getServices());
+ actionFactory = new ActionFactory(workItemFactory, actionableItemManager, attributeResolverService, stateFactory,
+ getServices());
taskService = new AtsTaskService(this);
eventService = new AtsEventServiceImpl();
@@ -156,7 +160,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public Artifact getConfigArtifact(IAtsConfigObject atsConfigObject) throws OseeCoreException {
- return (Artifact) atsConfigObject.getStoreObject();
+ return AtsClientService.get().getArtifact(atsConfigObject);
}
@Override
@@ -214,26 +218,34 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public void reloadConfigCache(boolean pend) {
+ final IAtsServices client = this;
Runnable reload = new Runnable() {
@Override
public void run() {
try {
- List<Integer> ids = new LinkedList<>();
- for (Long id : configProvider.getConfigurations().getAtsConfigIds()) {
- ids.add(id.intValue());
- }
- List<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(ids, getAtsBranch());
- for (Artifact artifact : artifacts) {
- IAtsConfigObject configObj = configItemFactory.getConfigObject(artifact);
- if (configObj != null) {
- atsCache.cacheAtsObject(configObj);
- }
- }
+ cacheActionableItems(configProvider.getConfigurations().getIdToAi().get(
+ configProvider.getConfigurations().getTopActionableItem()));
+ cacheTeamDefinitions(configProvider.getConfigurations().getIdToTeamDef().get(
+ configProvider.getConfigurations().getTopTeamDefinition()));
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
+
+ private void cacheTeamDefinitions(JaxTeamDefinition jaxTeamDef) {
+ atsCache.cacheAtsObject(new TeamDefinition2(getLogger(), client, jaxTeamDef));
+ for (Long childId : jaxTeamDef.getChildren()) {
+ cacheTeamDefinitions(configProvider.getConfigurations().getIdToTeamDef().get(childId));
+ }
+ }
+
+ private void cacheActionableItems(JaxActionableItem jaxAi) {
+ atsCache.cacheAtsObject(new ActionableItem2(getLogger(), client, jaxAi));
+ for (Long child : jaxAi.getChildren()) {
+ cacheActionableItems(configProvider.getConfigurations().getIdToAi().get(child));
+ }
+ }
};
if (pend) {
reload.run();
@@ -303,7 +315,19 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
public Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException {
Artifact results = null;
if (atsObject.getStoreObject() != null) {
- results = (Artifact) atsObject.getStoreObject();
+ if (atsObject.getStoreObject() instanceof Artifact) {
+ results = (Artifact) atsObject.getStoreObject();
+ } else {
+ results = AtsClientService.get().getArtifact(atsObject.getId());
+ if (results != null) {
+ atsObject.setStoreObject(results);
+ }
+ }
+ } else {
+ results = getArtifact(atsObject.getId());
+ if (results != null) {
+ atsObject.setStoreObject(results);
+ }
}
return results;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsConfigurationsService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsConfigurationsService.java
index d58495c52f..a071c7bb5f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsConfigurationsService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsConfigurationsService.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.config.IAtsConfigurationProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.user.IUserArtLoader;
import org.eclipse.osee.ats.api.user.JaxAtsUser;
-import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.skynet.core.UserManager;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
index 92a1a226aa..4b7ec5e528 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
@@ -87,12 +87,12 @@ public class AtsStoreService implements IAtsStoreService {
@Override
public boolean isDeleted(IAtsObject atsObject) {
- return ((Artifact) atsObject.getStoreObject()).isDeleted();
+ return AtsClientService.get().getArtifact(atsObject).isDeleted();
}
@Override
public String getGuid(IAtsObject atsObject) {
- return ((Artifact) atsObject.getStoreObject()).getGuid();
+ return AtsClientService.get().getArtifact(atsObject).getGuid();
}
/**
@@ -114,7 +114,7 @@ public class AtsStoreService implements IAtsStoreService {
@Override
public boolean isAttributeTypeValid(IAtsObject atsObject, AttributeTypeId attributeType) {
- return isAttributeTypeValid(atsObject.getStoreObject(), attributeType);
+ return isAttributeTypeValid(AtsClientService.get().getArtifact(atsObject), attributeType);
}
@Override
@@ -182,12 +182,12 @@ public class AtsStoreService implements IAtsStoreService {
@Override
public IArtifactType getArtifactType(IAtsObject atsObject) {
- return getArtifactType(atsObject.getStoreObject());
+ return getArtifactType(AtsClientService.get().getArtifact(atsObject));
}
@Override
public boolean isOfType(IAtsObject atsObject, IArtifactType artifactType) {
- return isOfType(atsObject.getStoreObject(), artifactType);
+ return isOfType(AtsClientService.get().getArtifact(atsObject), artifactType);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
index a836fa012d..b978709800 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
@@ -86,7 +86,7 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
AtsClientService.get().getAttributeResolver(), this);
}
}
- transaction.addArtifact((Artifact) atsObject.getStoreObject());
+ transaction.addArtifact(AtsClientService.get().getArtifact(atsObject));
}
for (ArtifactId artifact : artifacts) {
if (artifact instanceof Artifact) {
@@ -104,7 +104,7 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
}
for (IAtsObject atsObject : deleteAtsObjects) {
- ((Artifact) atsObject.getStoreObject()).deleteAndPersist(transaction);
+ AtsClientService.get().getArtifact(atsObject).deleteAndPersist(transaction);
}
TransactionId transactionRecord = transaction.execute();
for (IExecuteListener listener : listeners) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
index 77674c5931..e3dde85a8a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
@@ -64,7 +65,7 @@ public class AtsUserServiceClientImpl extends AbstractAtsUserService implements
@Override
public User getOseeUser(IAtsUser atsUser) throws OseeCoreException {
User oseeUser = null;
- if (atsUser.getStoreObject() != null) {
+ if (atsUser.getStoreObject() instanceof User) {
oseeUser = (User) atsUser.getStoreObject();
} else {
oseeUser = getOseeUserById(atsUser.getUserId());
@@ -205,4 +206,14 @@ public class AtsUserServiceClientImpl extends AbstractAtsUserService implements
return user;
}
+ @Override
+ public List<IAtsUser> getUsersFromDb() {
+ List<IAtsUser> users = new ArrayList<>();
+ for (ArtifactId userArt : ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.User, CoreBranches.COMMON)) {
+ JaxAtsUser atsUser = createFromArtifact((Artifact) userArt);
+ users.add(atsUser);
+ }
+ return users;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/ArtifactResolverImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/ArtifactResolverImpl.java
index 5ba631c32a..fdcd5e68a3 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/ArtifactResolverImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/ArtifactResolverImpl.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IArtifactResolver;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IArtifactType;
@@ -86,7 +87,7 @@ public class ArtifactResolverImpl implements IArtifactResolver {
public boolean isOfType(IAtsObject atsObject, IArtifactType artifactType) {
Assert.isNotNull(atsObject, "ATS Object can not be null");
Assert.isNotNull(artifactType, "Artifact Type can not be null");
- return isOfType(atsObject.getStoreObject(), artifactType);
+ return isOfType(AtsClientService.get().getArtifact(atsObject), artifactType);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
index 6bdfa965e2..0bedc9fb4a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
@@ -93,7 +93,11 @@ public class AtsRelationResolverServiceImpl extends AbstractRelationResolverServ
IAtsObject atsObject = (IAtsObject) object;
if (atsObject.getStoreObject() instanceof Artifact) {
useArt = (Artifact) atsObject.getStoreObject();
+ } else {
+ useArt = atsClient.getArtifact(atsObject.getId());
}
+ } else if (object instanceof ArtifactId) {
+ useArt = atsClient.getArtifact(((ArtifactId) object).getId());
}
return useArt;
}
@@ -203,4 +207,14 @@ public class AtsRelationResolverServiceImpl extends AbstractRelationResolverServ
return art.getRelatedArtifactsCount(relationTypeSide);
}
+ @Override
+ public Collection<Long> getRelatedIds(ArtifactId artifact, RelationTypeSide relationTypeSide) {
+ List<Long> related = new LinkedList<>();
+ Artifact art = getArtifact(artifact);
+ for (Artifact rel : art.getRelatedArtifacts(relationTypeSide)) {
+ related.add(rel.getId());
+ }
+ return related;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
index af428af18b..6a927f653f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
@@ -118,8 +118,9 @@ public class TeamWorkFlowArtifact extends AbstractWorkflowArtifact implements IA
return super.getEditorTitle();
}
- public void setTeamDefinition(IAtsTeamDefinition tda) throws OseeCoreException {
- this.setSoleAttributeValue(AtsAttributeTypes.TeamDefinition, ((Artifact) tda.getStoreObject()).getGuid());
+ public void setTeamDefinition(IAtsTeamDefinition teamDef) throws OseeCoreException {
+ this.setSoleAttributeValue(AtsAttributeTypes.TeamDefinition,
+ AtsClientService.get().getArtifact(teamDef).getGuid());
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/SprintOrderColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/SprintOrderColumn.java
index 016a375c91..b14ce20099 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/SprintOrderColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/SprintOrderColumn.java
@@ -37,8 +37,9 @@ public class SprintOrderColumn extends AbstractServicesColumn {
Collection<ArtifactToken> items = services.getRelationResolver().getRelatedArtifacts(sprintArt,
AtsRelationTypes.AgileSprintToItem_AtsItem);
int x = 1;
+ ArtifactToken artifact = services.getArtifact(atsObject);
for (ArtifactId item : items) {
- if (item.equals(atsObject.getStoreObject())) {
+ if (item.equals(artifact)) {
result = String.valueOf(x);
break;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/TypeColumn.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/TypeColumn.java
index 0a4a045d51..3553bc4ede 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/TypeColumn.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/TypeColumn.java
@@ -31,7 +31,7 @@ public class TypeColumn extends AbstractServicesColumn {
} else if (services.getAgileService().isBacklog(atsObject)) {
return "Backlog";
} else {
- return atsObject.getStoreObject().getArtifactType().getName();
+ return services.getStoreService().getArtifactType(atsObject).getName();
}
}
return "(Deleted)";
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java
new file mode 100644
index 0000000000..213fdbe766
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.config.JaxActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.model.impl.AtsConfigObject;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.logger.Log;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItem2 extends AtsConfigObject implements IAtsActionableItem {
+
+ private final JaxActionableItem jaxAI;
+
+ public ActionableItem2(Log logger, IAtsServices services, JaxActionableItem jaxAI) {
+ super(logger, services, ArtifactToken.valueOf(jaxAI.getUuid(), jaxAI.getGuid(), jaxAI.getName(),
+ services.getAtsBranch(), AtsArtifactTypes.ActionableItem));
+ this.jaxAI = jaxAI;
+ }
+
+ @Override
+ public String getTypeName() {
+ return "Actionable Item";
+ }
+
+ @Override
+ public Collection<String> getRules() throws OseeCoreException {
+ Collection<String> rules = new ArrayList<>();
+ try {
+ rules = services.getAttributeResolver().getAttributeValues(artifact, AtsAttributeTypes.RuleDefinition);
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getting rules");
+ }
+ return rules;
+ }
+
+ @Override
+ public boolean hasRule(String rule) throws OseeCoreException {
+ return getRules().contains(rule);
+ }
+
+ @Override
+ public Collection<IAtsActionableItem> getChildrenActionableItems() {
+ List<IAtsActionableItem> children = new LinkedList<>();
+ for (Long childId : jaxAI.getChildren()) {
+ children.add(new ActionableItem2(logger, services, services.getConfigurations().getIdToAi().get(childId)));
+ }
+ return children;
+ }
+
+ @Override
+ public IAtsActionableItem getParentActionableItem() {
+ IAtsActionableItem parent = null;
+ try {
+ if (jaxAI.getParentId() != null) {
+ parent = services.getConfigItemFactory().getActionableItem(services.getArtifact(jaxAI.getParentId()));
+ }
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getParentActionableItem");
+ }
+ return parent;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinition() {
+ IAtsTeamDefinition teamDef = null;
+ try {
+ if (jaxAI.getTeamDefId() != null) {
+ teamDef = services.getConfigItemFactory().getTeamDef(services.getArtifact(jaxAI.getTeamDefId()));
+ }
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getTeamDefinition");
+ }
+ return teamDef;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinitionInherited() {
+ return TeamDefinitions.getImpactedTeamDef(this);
+ }
+
+ @Override
+ public boolean isAllowUserActionCreation() {
+ return services.getAttributeResolver().getSoleAttributeValue(artifact, AtsAttributeTypes.AllowUserActionCreation,
+ true);
+ }
+
+}
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 1ab0da54f5..c5916f0d77 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
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.config.IAtsCache;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -74,9 +75,10 @@ public class AtsCache implements IAtsCache {
@Override
public void cacheAtsObject(IAtsObject atsObject) {
Conditions.checkNotNull(atsObject, "atsObject");
- if (atsObject.getStoreObject() != null) {
- guidToAtsObjectCache.put(atsObject.getStoreObject().getGuid(), atsObject);
- uuidToArtifactIdCache.put(atsObject.getId(), atsObject.getStoreObject());
+ ArtifactToken storeObject = services.getArtifact(atsObject.getStoreObject());
+ if (storeObject != null) {
+ guidToAtsObjectCache.put(storeObject.getGuid(), atsObject);
+ uuidToArtifactIdCache.put(atsObject.getId(), storeObject);
}
uuidToAtsObjectCache.put(atsObject.getId(), atsObject);
}
@@ -131,8 +133,8 @@ public class AtsCache implements IAtsCache {
@Override
public void deCacheAtsObject(IAtsObject atsObject) {
Conditions.checkNotNull(atsObject, "atsObject");
- if (atsObject.getStoreObject() != null) {
- guidToAtsObjectCache.invalidate(atsObject.getStoreObject().getGuid());
+ if (services.getArtifact(atsObject) != null) {
+ guidToAtsObjectCache.invalidate(services.getArtifact(atsObject).getGuid());
}
uuidToAtsObjectCache.invalidate(atsObject.getId());
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java
new file mode 100644
index 0000000000..3262380789
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.api.IAtsServices;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.config.JaxTeamDefinition;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.version.VersionLockedType;
+import org.eclipse.osee.ats.api.version.VersionReleaseType;
+import org.eclipse.osee.ats.core.model.impl.AtsConfigObject;
+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.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.logger.Log;
+
+/**
+ * @author Donald G Dunne
+ */
+public class TeamDefinition2 extends AtsConfigObject implements IAtsTeamDefinition {
+
+ private final JaxTeamDefinition jaxTeamDef;
+
+ public TeamDefinition2(Log logger, IAtsServices services, JaxTeamDefinition jaxTeamDef) {
+ super(logger, services, ArtifactToken.valueOf(jaxTeamDef.getUuid(), jaxTeamDef.getGuid(), jaxTeamDef.getName(),
+ services.getAtsBranch(), AtsArtifactTypes.ActionableItem));
+ this.jaxTeamDef = jaxTeamDef;
+ }
+
+ @Override
+ public String getTypeName() {
+ return "Team Definition";
+ }
+
+ @Override
+ public Collection<IAtsActionableItem> getActionableItems() {
+ List<IAtsActionableItem> children = new LinkedList<>();
+ for (Long aiId : jaxTeamDef.getAis()) {
+ children.add(new ActionableItem2(logger, services, services.getConfigurations().getIdToAi().get(aiId)));
+ }
+ return children;
+ }
+
+ @Override
+ public IAtsTeamDefinition getParentTeamDef() {
+ IAtsTeamDefinition parent = null;
+ try {
+ Collection<ArtifactToken> related =
+ services.getRelationResolver().getRelated(artifact, CoreRelationTypes.Default_Hierarchical__Parent);
+ if (!related.isEmpty()) {
+ parent = services.getConfigItemFactory().getTeamDef(related.iterator().next());
+ }
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getParentTeamDef");
+ }
+ return parent;
+ }
+
+ @Override
+ public Collection<IAtsTeamDefinition> getChildrenTeamDefinitions() {
+ Set<IAtsTeamDefinition> children = new HashSet<>();
+ try {
+ for (ArtifactId childArt : services.getRelationResolver().getRelated(artifact,
+ CoreRelationTypes.Default_Hierarchical__Child)) {
+ IAtsTeamDefinition childTeamDef = services.getConfigItemFactory().getTeamDef(childArt);
+ if (childTeamDef != null) {
+ children.add(childTeamDef);
+ }
+ }
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getChildrenTeamDefinitions");
+ }
+ return children;
+ }
+
+ @Override
+ public Collection<IAtsUser> getLeads(Collection<IAtsActionableItem> actionableItems) {
+ Set<IAtsUser> leads = new HashSet<>();
+ for (IAtsActionableItem aia : actionableItems) {
+ if (this.equals(aia.getTeamDefinitionInherited())) {
+ // If leads are specified for this aia, add them
+ Collection<IAtsUser> leads2 = aia.getLeads();
+ if (leads2.size() > 0) {
+ leads.addAll(leads2);
+ } else {
+ if (aia.getTeamDefinitionInherited() != null) {
+ Collection<IAtsUser> leads3 = aia.getTeamDefinitionInherited().getLeads();
+ leads.addAll(leads3);
+ }
+ }
+ }
+ }
+ if (leads.isEmpty()) {
+ Collection<IAtsUser> leads2 = getLeads();
+ leads.addAll(leads2);
+ }
+ return leads;
+ }
+
+ @Override
+ public Collection<IAtsUser> getMembers() {
+ return getRelatedUsers(AtsRelationTypes.TeamMember_Member);
+ }
+
+ @Override
+ public Collection<IAtsUser> getMembersAndLeads() {
+ Set<IAtsUser> results = new HashSet<>();
+ results.addAll(getLeads());
+ results.addAll(getMembers());
+ return results;
+ }
+
+ @Override
+ public Collection<IAtsUser> getPrivilegedMembers() {
+ return getRelatedUsers(AtsRelationTypes.PrivilegedMember_Member);
+ }
+
+ @Override
+ public boolean isAllowCommitBranch() {
+ boolean set = false;
+ try {
+ set =
+ services.getAttributeResolver().getSoleAttributeValue(artifact, AtsAttributeTypes.AllowCommitBranch, false);
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error is allow commit branch");
+ }
+ return set;
+ }
+
+ @Override
+ public Result isAllowCommitBranchInherited() {
+ if (!isAllowCommitBranch()) {
+ return new Result(false, "Team Definition [" + this + "] not configured to allow branch commit.");
+ }
+ if (getBaselineBranchId().isInvalid()) {
+ return new Result(false, "Parent Branch not configured for Team Definition [" + this + "]");
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public boolean isAllowCreateBranch() {
+ boolean set = false;
+ try {
+ set =
+ services.getAttributeResolver().getSoleAttributeValue(artifact, AtsAttributeTypes.AllowCreateBranch, false);
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error get allow create branch");
+ }
+ return set;
+ }
+
+ @Override
+ public Result isAllowCreateBranchInherited() {
+ if (!isAllowCreateBranch()) {
+ return new Result(false, "Branch creation disabled for Team Definition [" + this + "]");
+ }
+ if (getBaselineBranchId().isInvalid()) {
+ return new Result(false, "Parent Branch not configured for Team Definition [" + this + "]");
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public BranchId getBaselineBranchId() {
+ return BranchId.valueOf((String) getAttributeValue(AtsAttributeTypes.BaselineBranchUuid, "0"));
+ }
+
+ @Override
+ public BranchId getTeamBranchId() {
+ BranchId branch = getBaselineBranchId();
+ if (branch.isValid()) {
+ return branch;
+ } else {
+ IAtsTeamDefinition parentTeamDef = getParentTeamDef();
+ if (parentTeamDef instanceof TeamDefinition2) {
+ return parentTeamDef.getTeamBranchId();
+ }
+ }
+ return BranchId.SENTINEL;
+ }
+
+ @Override
+ public String getCommitFullDisplayName() {
+ return getName();
+ }
+
+ @Override
+ public boolean isTeamUsesVersions() throws OseeCoreException {
+ return getTeamDefinitionHoldingVersions() != null;
+ }
+
+ @Override
+ public IAtsVersion getNextReleaseVersion() {
+ IAtsVersion result = null;
+ for (IAtsVersion version : getVersions()) {
+ if (version.isNextVersion()) {
+ result = version;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinitionHoldingVersions() throws OseeCoreException {
+ IAtsTeamDefinition teamDef = null;
+ if (getVersions().size() > 0) {
+ teamDef = this;
+ } else {
+ IAtsTeamDefinition parentTda = getParentTeamDef();
+ if (parentTda != null) {
+ teamDef = parentTda.getTeamDefinitionHoldingVersions();
+ }
+ }
+ return teamDef;
+ }
+
+ @Override
+ public IAtsVersion getVersion(String name) {
+ IAtsVersion result = null;
+ for (IAtsVersion version : getVersions()) {
+ if (version.getName().equals(name)) {
+ result = version;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersions() {
+ Set<IAtsVersion> results = new HashSet<>();
+ try {
+ for (ArtifactId verArt : services.getRelationResolver().getRelated(artifact,
+ AtsRelationTypes.TeamDefinitionToVersion_Version)) {
+ IAtsVersion version = services.getConfigItemFactory().getVersion(verArt);
+ results.add(version);
+ }
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getting versions");
+ }
+ return results;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersions(VersionReleaseType releaseType, VersionLockedType lockedType) {
+ return org.eclipse.osee.framework.jdk.core.util.Collections.setIntersection(getVersionsReleased(releaseType),
+ getVersionsLocked(lockedType));
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsFromTeamDefHoldingVersions(VersionReleaseType releaseType, VersionLockedType lockedType) throws OseeCoreException {
+ IAtsTeamDefinition teamDef = getTeamDefinitionHoldingVersions();
+ if (teamDef == null) {
+ return new ArrayList<IAtsVersion>();
+ }
+ return teamDef.getVersions(releaseType, lockedType);
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsLocked(VersionLockedType lockType) {
+ ArrayList<IAtsVersion> versions = new ArrayList<>();
+ for (IAtsVersion version : getVersions()) {
+ if (version.isVersionLocked() && (lockType == VersionLockedType.Locked || lockType == VersionLockedType.Both)) {
+ versions.add(version);
+ } else if (!version.isVersionLocked() && lockType == VersionLockedType.UnLocked || lockType == VersionLockedType.Both) {
+ versions.add(version);
+ }
+ }
+ return versions;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsReleased(VersionReleaseType releaseType) {
+ ArrayList<IAtsVersion> versions = new ArrayList<>();
+ for (IAtsVersion version : getVersions()) {
+ if (version.isReleased() && (releaseType == VersionReleaseType.Released || releaseType == VersionReleaseType.Both)) {
+ versions.add(version);
+ } else if (!version.isReleased() && releaseType == VersionReleaseType.UnReleased || releaseType == VersionReleaseType.Both) {
+ versions.add(version);
+ }
+ }
+ return versions;
+ }
+
+ @Override
+ public String getWorkflowDefinition() {
+ return getAttributeValue(AtsAttributeTypes.WorkflowDefinition, "");
+ }
+
+ @Override
+ public String getRelatedTaskWorkDefinition() {
+ return getAttributeValue(AtsAttributeTypes.RelatedTaskWorkDefinition, "");
+ }
+
+ @Override
+ public String getRelatedPeerWorkDefinition() {
+ return getAttributeValue(AtsAttributeTypes.RelatedPeerWorkflowDefinition, "");
+ }
+
+ @Override
+ public Collection<String> getRules() {
+ Collection<String> rules = new ArrayList<>();
+ try {
+ rules = services.getAttributeResolver().getAttributeValues(artifact, AtsAttributeTypes.RuleDefinition);
+ } catch (OseeCoreException ex) {
+ getLogger().error(ex, "Error getting rules");
+ }
+ return rules;
+ }
+
+ @Override
+ public boolean hasRule(String rule) {
+ boolean result = false;
+ for (String rule2 : getRules()) {
+ if (rule.equals(rule2)) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/Versions.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/Versions.java
index 3b6795f77c..5fc22a6c72 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/Versions.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/Versions.java
@@ -55,7 +55,7 @@ public class Versions {
public static List<IAtsVersion> getParallelVersions(IAtsVersion version, IAtsServices services) {
List<IAtsVersion> parallelVersions = new ArrayList<>();
- for (ArtifactId parallelVersion : services.getRelationResolver().getRelated(version.getStoreObject(),
+ for (ArtifactId parallelVersion : services.getRelationResolver().getRelated(services.getArtifact(version),
AtsRelationTypes.ParallelVersion_Child)) {
IAtsVersion parallelVer = services.getConfigItemFactory().getVersion(parallelVersion);
parallelVersions.add(parallelVer);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsConfigQueryImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsConfigQueryImpl.java
index e121df438d..54e4343154 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsConfigQueryImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/query/AbstractAtsConfigQueryImpl.java
@@ -19,7 +19,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
-import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.config.WorkType;
@@ -191,7 +190,7 @@ public abstract class AbstractAtsConfigQueryImpl implements IAtsConfigQuery {
if (configObject == null) {
OseeLog.log(AbstractAtsConfigQueryImpl.class, Level.SEVERE, "Null found in results");
} else {
- items.add((T) configObject.getStoreObject());
+ items.add((T) services.getArtifact(configObject));
}
}
// filter on original artifact types
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
index 9d2d07c127..b7d0f3c2f8 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
@@ -135,10 +135,6 @@ public abstract class AbstractAtsUserService implements IAtsUserService {
return getUserById(userToken.getUserId());
}
- public void releaseUser(IAtsUser newUser) {
- currentUser = null;
- }
-
@Override
public abstract String getCurrentUserId();
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
index c69e3cf9e6..c4700d1c07 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
@@ -33,7 +33,6 @@ import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.api.util.ISequenceProvider;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
@@ -67,16 +66,14 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
public class ActionFactory implements IAtsActionFactory {
private final IAtsWorkItemFactory workItemFactory;
- private final ISequenceProvider sequenceProvider;
private final IAtsActionableItemService actionableItemManager;
private final IAttributeResolver attrResolver;
private final IAtsStateFactory stateFactory;
private final IAtsServices services;
private IAtsTeamDefinition topTeamDefinition;
- public ActionFactory(IAtsWorkItemFactory workItemFactory, ISequenceProvider sequenceProvider, IAtsActionableItemService actionableItemManager, IAttributeResolver attrResolver, IAtsStateFactory stateFactory, IAtsServices atsServices) {
+ public ActionFactory(IAtsWorkItemFactory workItemFactory, IAtsActionableItemService actionableItemManager, IAttributeResolver attrResolver, IAtsStateFactory stateFactory, IAtsServices atsServices) {
this.workItemFactory = workItemFactory;
- this.sequenceProvider = sequenceProvider;
this.actionableItemManager = actionableItemManager;
this.attrResolver = attrResolver;
this.stateFactory = stateFactory;
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
index 584e71fafd..1692b3d812 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
@@ -132,6 +132,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
relationResolver = new AtsRelationResolverServiceImpl(this);
((AtsAttributeResolverServiceImpl) attributeResolverService).setOrcsApi(orcsApi);
+ ((AtsAttributeResolverServiceImpl) attributeResolverService).setServices(this);
workDefService.setWorkDefinitionStringProvider(this);
logFactory = AtsCoreFactory.newLogFactory();
@@ -141,8 +142,8 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
queryService = new AtsQueryServiceImpl(this, jdbcService);
actionableItemManager = new ActionableItemManager(attributeResolverService, storeService, this);
- actionFactory = new ActionFactory(workItemFactory, getSequenceProvider(), actionableItemManager,
- attributeResolverService, stateFactory, getServices());
+ actionFactory = new ActionFactory(workItemFactory, actionableItemManager, attributeResolverService, stateFactory,
+ getServices());
agileService = new AgileService(logger, this);
taskService = new AtsTaskService(this);
@@ -171,7 +172,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
result = (ArtifactReadable) artifact;
} else if (artifact instanceof IAtsObject) {
IAtsObject atsObject = (IAtsObject) artifact;
- if (atsObject.getStoreObject() != null) {
+ if (atsObject.getStoreObject() instanceof ArtifactReadable) {
result = (ArtifactReadable) atsObject.getStoreObject();
} else {
result = orcsApi.getQueryFactory().fromBranch(getAtsBranch()).andUuid(
@@ -186,11 +187,14 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public ArtifactReadable getArtifact(IAtsObject atsObject) throws OseeCoreException {
ArtifactReadable result = null;
- if (atsObject.getStoreObject() != null) {
+ if (atsObject.getStoreObject() instanceof ArtifactReadable) {
result = (ArtifactReadable) atsObject.getStoreObject();
} else {
result = orcsApi.getQueryFactory().fromBranch(getAtsBranch()).andUuid(
atsObject.getId()).getResults().getAtMostOneOrNull();
+ if (result != null) {
+ atsObject.setStoreObject(result);
+ }
}
return result;
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
index 544fe77290..6a7b6886b4 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
@@ -10,15 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.ats.rest.internal.config;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
-import java.util.concurrent.TimeUnit;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
@@ -31,15 +29,20 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.config.AtsAttributeValueColumn;
import org.eclipse.osee.ats.api.config.AtsConfigEndpointApi;
import org.eclipse.osee.ats.api.config.AtsConfiguration;
import org.eclipse.osee.ats.api.config.AtsConfigurations;
import org.eclipse.osee.ats.api.config.AtsViews;
import org.eclipse.osee.ats.api.config.ColumnAlign;
+import org.eclipse.osee.ats.api.config.JaxActionableItem;
+import org.eclipse.osee.ats.api.config.JaxTeamDefinition;
+import org.eclipse.osee.ats.api.config.JaxVersion;
import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.user.JaxAtsUser;
import org.eclipse.osee.ats.api.workdef.JaxAtsWorkDef;
@@ -72,80 +75,234 @@ import org.eclipse.osee.orcs.transaction.TransactionBuilder;
public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
private final OrcsApi orcsApi;
- private final IAtsServer atsServer;
+ private final IAtsServices services;
private final Log logger;
+ private AtsConfigurations atsConfigurations;
+ private final Collection<Long> teamDefIds = new LinkedList<>();
+ private final Collection<Long> aiIds = new LinkedList<>();
- public AtsConfigEndpointImpl(IAtsServer atsServer, OrcsApi orcsApi, Log logger) {
- this.atsServer = atsServer;
+ public AtsConfigEndpointImpl(IAtsServices services, OrcsApi orcsApi, Log logger) {
+ this.services = services;
this.orcsApi = orcsApi;
this.logger = logger;
+ startAtsConfigurationsReloader();
}
- private final Supplier<AtsConfigurations> configurationsCache =
- Suppliers.memoizeWithExpiration(getConfigurationsSupplier(), 5, TimeUnit.MINUTES);
-
- private Supplier<AtsConfigurations> getConfigurationsSupplier() {
- return new Supplier<AtsConfigurations>() {
+ private void startAtsConfigurationsReloader() {
+ Thread thread = new Thread("ATS Configuration Re-Loader") {
@Override
- public AtsConfigurations get() {
- ResultSet<ArtifactReadable> artifacts =
- orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andTypeEquals(
- AtsArtifactTypes.Configuration).getResults();
- // load ats branch configurations
- AtsConfigurations configs = new AtsConfigurations();
- for (ArtifactReadable art : artifacts) {
- AtsConfiguration config = new AtsConfiguration();
- configs.getConfigs().add(config);
- config.setName(art.getName());
- config.setUuid(art.getId());
- config.setBranchUuid(
- Long.valueOf(art.getSoleAttributeValue(AtsAttributeTypes.AtsConfiguredBranch, "0L")));
- config.setIsDefault(art.getSoleAttributeValue(AtsAttributeTypes.Default, false));
- }
- UpdateAtsConfiguration update = new UpdateAtsConfiguration(atsServer);
- AtsViews views = update.getConfigViews();
- // load views
- configs.setViews(views);
- // load color column config
- configs.setColorColumns(update.getColorColumns());
- // load valid state names
- configs.setValidStateNames(update.getValidStateNames());
- // load users
- for (IAtsUser user : atsServer.getUserService().getUsers()) {
- configs.getUsers().add((JaxAtsUser) user);
- }
- // load admins
- ArtifactReadable atsAdminArt = orcsApi.getQueryFactory().fromBranch(atsServer.getAtsBranch()).andIds(
- AtsArtifactToken.AtsAdmin).getResults().getAtMostOneOrNull();
- if (atsAdminArt != null) {
- for (ArtifactReadable member : atsAdminArt.getRelated(CoreRelationTypes.Users_User)) {
- configs.getAtsAdmins().add(member.getId());
+ public void run() {
+ AtsConfigurations configs = getAtsConfigurationsFromDb();
+ atsConfigurations = configs;
+ }
+ };
+ thread.start();
+ }
+
+ private AtsConfigurations getAtsConfigurationsFromDb() {
+ teamDefIds.clear();
+ aiIds.clear();
+ ResultSet<ArtifactReadable> artifacts = orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andTypeEquals(
+ AtsArtifactTypes.Configuration).getResults();
+ // load ats branch configurations
+ AtsConfigurations configs = new AtsConfigurations();
+ for (ArtifactReadable art : artifacts) {
+ AtsConfiguration config = new AtsConfiguration();
+ configs.getConfigs().add(config);
+ config.setName(art.getName());
+ config.setUuid(art.getId());
+ config.setBranchUuid(Long.valueOf(art.getSoleAttributeValue(AtsAttributeTypes.AtsConfiguredBranch, "0L")));
+ config.setIsDefault(art.getSoleAttributeValue(AtsAttributeTypes.Default, false));
+ }
+ UpdateAtsConfiguration update = new UpdateAtsConfiguration((IAtsServer) services);
+ AtsViews views = update.getConfigViews();
+ // load views
+ configs.setViews(views);
+ // load color column config
+ configs.setColorColumns(update.getColorColumns());
+ // load valid state names
+ configs.setValidStateNames(update.getValidStateNames());
+ // load users
+ for (IAtsUser user : services.getUserService().getUsersFromDb()) {
+ configs.getUsers().add((JaxAtsUser) user);
+ }
+ // load admins
+ ArtifactReadable atsAdminArt = orcsApi.getQueryFactory().fromBranch(services.getAtsBranch()).andIds(
+ AtsArtifactToken.AtsAdmin).getResults().getAtMostOneOrNull();
+ if (atsAdminArt != null) {
+ for (ArtifactReadable member : atsAdminArt.getRelated(CoreRelationTypes.Users_User)) {
+ configs.getAtsAdmins().add(member.getId());
+ }
+ }
+
+ Map<Long, ArtifactReadable> idToArtifact = new HashMap<>();
+
+ @SuppressWarnings("unused")
+ List<ArtifactReadable> configArts =
+ orcsApi.getQueryFactory().fromBranch(services.getAtsBranch()).andIsOfType(AtsArtifactTypes.TeamDefinition,
+ AtsArtifactTypes.Version, AtsArtifactTypes.ActionableItem).getResults().getList();
+
+ // load ats config objects
+ for (ArtifactReadable configArtId : orcsApi.getQueryFactory().fromBranch(services.getAtsBranch()).andIsOfType(
+ AtsArtifactTypes.TeamDefinition, AtsArtifactTypes.Version, AtsArtifactTypes.ActionableItem).getResults()) {
+ if (services.getStoreService().isOfType(configArtId, AtsArtifactTypes.TeamDefinition)) {
+ JaxTeamDefinition teamDef = createJaxTeamDefinition(configArtId);
+ configs.addTeamDef(teamDef);
+ } else if (services.getStoreService().isOfType(configArtId, AtsArtifactTypes.ActionableItem)) {
+ JaxActionableItem ai = createJaxActionableItem(configArtId);
+ configs.addAi(ai);
+ } else if (services.getStoreService().isOfType(configArtId, AtsArtifactTypes.Version)) {
+ JaxVersion version = createJaxVersion(configArtId);
+ configs.addVersion(version);
+ }
+ idToArtifact.put(configArtId.getId(), configArtId);
+ }
+
+ // load team def tree
+ JaxTeamDefinition topJaxTeamDef =
+ addTeamDefinitionChildrenWIthRecurse(AtsArtifactToken.TopTeamDefinition.getId(), idToArtifact, configs);
+ configs.setTopTeamDefinition(topJaxTeamDef.getUuid());
+
+ // load actionable items tree
+ JaxActionableItem topJaxAi =
+ addActionableItemChildrenWIthRecurse(AtsArtifactToken.TopActionableItem.getId(), idToArtifact, configs);
+ configs.setTopActionableItem(topJaxAi.getUuid());
+
+ // load work definitions
+ for (ArtifactToken workDefArt : orcsApi.getQueryFactory().fromBranch(services.getAtsBranch()).andIsOfType(
+ AtsArtifactTypes.WorkDefinition).getResults()) {
+ String workDefStr =
+ services.getAttributeResolver().getSoleAttributeValueAsString(workDefArt, AtsAttributeTypes.DslSheet, "");
+ configs.addWorkDefinition(workDefArt.getName(), workDefStr);
+ }
+ return configs;
+ }
+
+ private JaxActionableItem addActionableItemChildrenWIthRecurse(Long aiId, Map<Long, ArtifactReadable> idToArtifact, AtsConfigurations configs) {
+ ArtifactReadable aiArt = idToArtifact.get(aiId);
+ if (aiArt != null && aiArt.isOfType(AtsArtifactTypes.ActionableItem)) {
+ JaxActionableItem jaxAi = configs.getIdToAi().get(aiId);
+ for (Long childId : aiArt.getChildrentIds()) {
+ if (isActionableItemId(childId)) {
+ JaxActionableItem child = addActionableItemChildrenWIthRecurse(childId, idToArtifact, configs);
+ if (child != null) {
+ child.setParentId(aiId);
+ jaxAi.addChild(child);
}
}
- // load ats config object ids
- for (ArtifactId configArtId : orcsApi.getQueryFactory().fromBranch(atsServer.getAtsBranch()).andIsOfType(
- AtsArtifactTypes.TeamDefinition, AtsArtifactTypes.Version,
- AtsArtifactTypes.ActionableItem).getResultsAsLocalIds()) {
- configs.getAtsConfigIds().add(configArtId.getId());
- }
- // load work definitions
- for (ArtifactToken workDefArt : orcsApi.getQueryFactory().fromBranch(atsServer.getAtsBranch()).andIsOfType(
- AtsArtifactTypes.WorkDefinition).getResults()) {
- String workDefStr = atsServer.getAttributeResolver().getSoleAttributeValueAsString(workDefArt,
- AtsAttributeTypes.DslSheet, "");
- configs.getWorkDefIdToWorkDef().put(workDefArt.getName(), workDefStr);
+ }
+ return jaxAi;
+ }
+ return null;
+ }
+
+ private JaxTeamDefinition addTeamDefinitionChildrenWIthRecurse(Long teamDefId, Map<Long, ArtifactReadable> idToArtifact, AtsConfigurations configs) {
+ ArtifactReadable teamDef = idToArtifact.get(teamDefId);
+ if (teamDef != null && teamDef.isOfType(AtsArtifactTypes.TeamDefinition)) {
+ JaxTeamDefinition jaxTeamDef = configs.getIdToTeamDef().get(teamDefId);
+ for (Long childId : teamDef.getChildrentIds()) {
+ if (isTeamDefinitionId(childId)) {
+ JaxTeamDefinition child = addTeamDefinitionChildrenWIthRecurse(childId, idToArtifact, configs);
+ if (child != null) {
+ child.setParentId(teamDefId);
+ jaxTeamDef.addChild(child);
+ }
}
- return configs;
}
+ // add team to version ids
+ for (Long versionId : services.getRelationResolver().getRelatedIds(teamDef,
+ AtsRelationTypes.TeamDefinitionToVersion_Version)) {
+ jaxTeamDef.addVersion(versionId);
+ JaxVersion version = configs.getIdToVersion().get(versionId);
+ version.setTeamDefId(teamDefId);
+ }
+ // add team to ai ids
+ for (Long aiId : services.getRelationResolver().getRelatedIds(teamDef,
+ AtsRelationTypes.TeamActionableItem_ActionableItem)) {
+ jaxTeamDef.addAi(aiId);
+ JaxActionableItem jai = configs.getIdToAi().get(aiId);
+ jai.setTeamDefId(teamDefId);
+ }
+ return jaxTeamDef;
+ }
+ return null;
+ }
- };
+ private boolean isTeamDefinitionId(Long childId) {
+ if (teamDefIds.isEmpty()) {
+ for (ArtifactId art : services.getQueryService().createQuery(AtsArtifactTypes.TeamDefinition).getItemIds()) {
+ teamDefIds.add(art.getId());
+ }
+ }
+ return teamDefIds.contains(childId);
+ }
+
+ private boolean isActionableItemId(Long childId) {
+ if (aiIds.isEmpty()) {
+ for (ArtifactId art : services.getQueryService().createQuery(AtsArtifactTypes.ActionableItem).getItemIds()) {
+ aiIds.add(art.getId());
+ }
+ }
+ return aiIds.contains(childId);
+ }
+
+ private JaxVersion createJaxVersion(ArtifactReadable verArt) {
+ JaxVersion jaxVersion = new JaxVersion();
+ jaxVersion.setName(verArt.getName());
+ jaxVersion.setUuid(verArt.getId());
+ jaxVersion.setGuid(verArt.getGuid());
+ jaxVersion.setActive(verArt.getSoleAttributeValue(AtsAttributeTypes.Active, true));
+ return jaxVersion;
+ }
+
+ private JaxActionableItem createJaxActionableItem(ArtifactReadable aiArt) {
+ JaxActionableItem jaxAi = new JaxActionableItem();
+ jaxAi.setName(aiArt.getName());
+ jaxAi.setUuid(aiArt.getId());
+ jaxAi.setGuid(aiArt.getGuid());
+ jaxAi.setDescription(aiArt.getSoleAttributeValue(AtsAttributeTypes.Description, ""));
+ jaxAi.setActive(aiArt.getSoleAttributeValue(AtsAttributeTypes.Active, true));
+ return jaxAi;
+ }
+
+ private JaxTeamDefinition createJaxTeamDefinition(ArtifactReadable teamDefArt) {
+ JaxTeamDefinition jaxTeamDef = new JaxTeamDefinition();
+ jaxTeamDef.setName(teamDefArt.getName());
+ jaxTeamDef.setUuid(teamDefArt.getId());
+ jaxTeamDef.setGuid(teamDefArt.getGuid());
+ jaxTeamDef.setActive(teamDefArt.getSoleAttributeValue(AtsAttributeTypes.Active, true));
+ for (ArtifactToken ai : services.getRelationResolver().getRelated(teamDefArt,
+ AtsRelationTypes.TeamActionableItem_ActionableItem)) {
+ jaxTeamDef.getAis().add(ai.getId());
+ }
+ return jaxTeamDef;
+ }
+
+ @Override
+ @GET
+ @Path("clearcache")
+ @Produces(MediaType.APPLICATION_JSON)
+ public AtsConfigurations clearCaches() {
+ atsConfigurations = null;
+ return get();
}
@GET
@Produces(MediaType.APPLICATION_JSON)
@Override
public AtsConfigurations get() {
- return configurationsCache.get();
+ if (atsConfigurations == null) {
+ atsConfigurations = getAtsConfigurationsFromDb();
+ }
+ return atsConfigurations;
+ }
+
+ @GET
+ @Path("fromdb")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Override
+ public AtsConfigurations getFromDb() {
+ return getAtsConfigurationsFromDb();
}
@GET
@@ -168,7 +325,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
Conditions.checkNotNullOrEmpty(newBranchName, "newBranchName");
String userId = form.getFirst("userId");
Conditions.checkNotNullOrEmpty(userId, "UserId");
- ArtifactId user = atsServer.getUserService().getUserById(userId).getStoreObject();
+ ArtifactId user = services.getUserService().getUserById(userId).getStoreObject();
if (user == null) {
logger.error("User by id [%s] does not exist", userId);
}
@@ -256,7 +413,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
config.setUuid(((ArtifactReadable) configArt).getId());
tx.createAttribute(configArt, AtsAttributeTypes.AtsConfiguredBranch, String.valueOf(newBranchUuid));
XResultData rd = new XResultData();
- UpdateAtsConfiguration update = new UpdateAtsConfiguration(atsServer);
+ UpdateAtsConfiguration update = new UpdateAtsConfiguration((IAtsServer) services);
// Get or create Configs folder
ArtifactId configsFolderArt = update.getOrCreateConfigsFolder(userArt, rd);
@@ -273,7 +430,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
@Override
public Response createUpdateConfig() {
XResultData resultData = new XResultData(false);
- UpdateAtsConfiguration update = new UpdateAtsConfiguration(atsServer);
+ UpdateAtsConfiguration update = new UpdateAtsConfiguration((IAtsServer) services);
update.createUpdateConfig(resultData);
if (resultData.isEmpty()) {
resultData.log("Nothing to update");
@@ -286,25 +443,27 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
@Override
public Response storeWorkDef(JaxAtsWorkDef jaxWorkDef) {
TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON,
- atsServer.getArtifact(AtsCoreUsers.SYSTEM_USER), "Store Work Definition " + jaxWorkDef.getName());
- ArtifactReadable workDefArt = orcsApi.getQueryFactory().fromBranch(atsServer.getAtsBranch()).andIsOfType(
+ services.getArtifact(AtsCoreUsers.SYSTEM_USER), "Store Work Definition " + jaxWorkDef.getName());
+ ArtifactReadable workDefArt = orcsApi.getQueryFactory().fromBranch(services.getAtsBranch()).andIsOfType(
AtsArtifactTypes.WorkDefinition).andNameEquals(jaxWorkDef.getName()).getResults().getAtMostOneOrNull();
if (workDefArt == null) {
workDefArt = (ArtifactReadable) tx.createArtifact(AtsArtifactTypes.WorkDefinition, jaxWorkDef.getName());
}
tx.setSoleAttributeValue(workDefArt, AtsAttributeTypes.DslSheet, jaxWorkDef.getWorkDefDsl());
if (workDefArt.getParent() == null) {
- ArtifactReadable workDefFolder = atsServer.getArtifact(AtsArtifactToken.WorkDefinitionsFolder);
+ ArtifactReadable workDefFolder =
+ (ArtifactReadable) services.getArtifact(AtsArtifactToken.WorkDefinitionsFolder);
tx.addChildren(workDefFolder, workDefArt);
}
tx.commit();
- atsServer.getWorkDefAdmin().clearCaches();
+ ((IAtsServer) services).getWorkDefAdmin().clearCaches();
return Response.ok().build();
}
@Override
public List<AtsAttributeValueColumn> generateAttrTypeViews() throws Exception {
Map<String, AttributeTypeToken> idToToken = new HashMap<>();
+ IAtsServer atsServer = (IAtsServer) services;
for (AttributeTypeToken attrType : atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().getAll()) {
idToToken.put(attrType.getName(), attrType);
}
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 0f74fdeed4..ce54b0e7ef 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.ats.rest.internal.config;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -25,8 +27,6 @@ import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
/**
* @author Donald G. Dunne
@@ -54,7 +54,7 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
return atsAdminArt.areRelated(CoreRelationTypes.User_Grouping__Members, (ArtifactReadable) user.getStoreObject());
}
- private final Supplier<List<IAtsUser>> usersCache =
+ private Supplier<List<IAtsUser>> usersCache =
Suppliers.memoizeWithExpiration(getConfigurationsSupplier(), 5, TimeUnit.MINUTES);
private Supplier<List<IAtsUser>> getConfigurationsSupplier() {
@@ -62,10 +62,7 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
@Override
public List<IAtsUser> get() {
List<IAtsUser> users = new ArrayList<>();
- for (ArtifactId art : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andIsOfType(
- CoreArtifactTypes.User).getResults()) {
- ArtifactReadable userArt = (ArtifactReadable) art;
- JaxAtsUser atsUser = createFromArtifact(userArt);
+ for (IAtsUser atsUser : getUsersFromDb()) {
userIdToAtsUser.put(atsUser.getUserId(), atsUser);
nameToAtsUser.put(atsUser.getName(), atsUser);
users.add(atsUser);
@@ -79,8 +76,8 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
JaxAtsUser atsUser = new JaxAtsUser();
atsUser.setName(userArt.getName());
atsUser.setStoreObject(userArt);
- atsUser.setUserId(userArt.getSoleAttributeValue(CoreAttributeTypes.UserId, ""));
- atsUser.setEmail(userArt.getSoleAttributeValue(CoreAttributeTypes.Email, ""));
+ atsUser.setUserId(userArt.getSoleAttributeAsString(CoreAttributeTypes.UserId, ""));
+ atsUser.setEmail(userArt.getSoleAttributeAsString(CoreAttributeTypes.Email, ""));
atsUser.setActive(userArt.getSoleAttributeValue(CoreAttributeTypes.Active, true));
atsUser.setUuid(userArt.getId());
return atsUser;
@@ -92,6 +89,24 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
}
@Override
+ public List<IAtsUser> getUsersFromDb() {
+ List<IAtsUser> users = new ArrayList<>();
+ for (ArtifactId art : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andIsOfType(
+ CoreArtifactTypes.User).getResults()) {
+ ArtifactReadable userArt = (ArtifactReadable) art;
+ JaxAtsUser atsUser = createFromArtifact(userArt);
+ users.add(atsUser);
+ }
+ return users;
+ }
+
+ @Override
+ public void reloadCache() {
+ usersCache = Suppliers.memoizeWithExpiration(getConfigurationsSupplier(), 5, TimeUnit.MINUTES);
+ super.reloadCache();
+ }
+
+ @Override
protected IAtsUser loadUserFromDbByUserId(String userId) {
ArtifactReadable userArt =
orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andIsOfType(CoreArtifactTypes.User).and(
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java
index 11787856d2..a63000089a 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java
@@ -17,6 +17,7 @@ import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.agile.IAgileFeatureGroup;
import org.eclipse.osee.ats.api.agile.IAgileSprint;
import org.eclipse.osee.ats.api.agile.IAgileTeam;
@@ -99,7 +100,7 @@ public class ConfigJsonWriter implements MessageBodyWriter<IAtsConfigObject> {
public static void addProgramObject(IAtsServer atsServer, IAtsObject atsObject, Annotation[] annotations, JsonGenerator writer, boolean identityView, AttributeTypes attributeTypes) throws IOException, JsonGenerationException, JsonProcessingException {
ArtifactReadable artifact = (ArtifactReadable) atsObject.getStoreObject();
writer.writeStartObject();
- writer.writeNumberField("uuid", getUuid(atsObject));
+ writer.writeNumberField("uuid", getUuid(atsObject, atsServer));
writer.writeStringField("Name", atsObject.getName());
writer.writeStringField("Description", atsObject.getDescription());
@@ -254,10 +255,10 @@ public class ConfigJsonWriter implements MessageBodyWriter<IAtsConfigObject> {
writer.writeEndObject();
}
- public static Long getUuid(IAtsObject atsObject) {
+ public static Long getUuid(IAtsObject atsObject, IAtsServices services) {
long uuid = atsObject.getId();
if (uuid <= 0L) {
- uuid = ((ArtifactReadable) atsObject.getStoreObject()).getId();
+ uuid = ((ArtifactReadable) services.getArtifact(atsObject)).getId();
}
return uuid;
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
index a2c9c902ea..f8bd98df53 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
@@ -101,10 +101,8 @@ public class UpdateAtsConfiguration {
private void createUpdateConfigAttributes(ArtifactReadable configArt, ArtifactReadable userArt, XResultData rd) throws OseeCoreException {
try {
- int x = 1;
AtsViews databaseViews = getConfigViews();
for (String viewsJson : getViewsJsonStrings()) {
- String comment = "Create Update Config Attributes - " + x++;
AtsViews atsViews = gson.fromJson(viewsJson, AtsViews.class);
// merge any new default view items to current database view items
List<AtsAttributeValueColumn> toAdd = new LinkedList<>();
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ArtifactResolverImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ArtifactResolverImpl.java
index 075cb0d16d..edbbff7aab 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ArtifactResolverImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ArtifactResolverImpl.java
@@ -89,7 +89,7 @@ public class ArtifactResolverImpl implements IArtifactResolver {
public boolean isOfType(IAtsObject atsObject, IArtifactType artifactType) {
Assert.isNotNull(atsObject, "ATS Object can not be null");
Assert.isNotNull(artifactType, "Artifact Type can not be null");
- return isOfType(atsObject.getStoreObject(), artifactType);
+ return isOfType(services.getArtifact(atsObject), artifactType);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
index 7159f17546..3fd5b18e69 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
@@ -16,6 +16,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
@@ -40,6 +41,7 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
private OrcsApi orcsApi;
private Log logger;
+ private IAtsServices services;
public void setLogger(Log logger) {
this.logger = logger;
@@ -50,11 +52,11 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
}
private ArtifactReadable getArtifact(IAtsObject atsObject) {
- return (ArtifactReadable) atsObject.getStoreObject();
+ return (ArtifactReadable) services.getArtifact(atsObject);
}
private ArtifactReadable getArtifact(ArtifactId artifact) {
- return (ArtifactReadable) artifact;
+ return (ArtifactReadable) services.getArtifact(artifact);
}
public void start() throws OseeCoreException {
@@ -270,4 +272,8 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
return getAttributes(workItem.getStoreObject());
}
+ public void setServices(IAtsServices services) {
+ this.services = services;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
index 8c5f1d496f..4e55d9a03f 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
@@ -206,7 +206,12 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
if (object instanceof ArtifactReadable) {
artifact = (ArtifactReadable) object;
} else if (object instanceof IAtsObject) {
- artifact = (ArtifactReadable) ((IAtsObject) object).getStoreObject();
+ IAtsObject atsObject = (IAtsObject) object;
+ if (atsObject.getStoreObject() instanceof ArtifactReadable) {
+ artifact = (ArtifactReadable) atsObject.getStoreObject();
+ } else {
+ artifact = atsServer.getArtifact(atsObject.getId());
+ }
}
return artifact;
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
index c88cb57176..76c160586d 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
@@ -149,6 +149,8 @@ public class AtsRelationResolverServiceImpl extends AbstractRelationResolverServ
if (atsObject.getStoreObject() instanceof ArtifactReadable) {
useArt = (ArtifactReadable) atsObject.getStoreObject();
}
+ } else if (object instanceof ArtifactId) {
+ useArt = atsServer.getArtifact(((ArtifactId) object).getId());
}
return useArt;
}
@@ -201,4 +203,13 @@ public class AtsRelationResolverServiceImpl extends AbstractRelationResolverServ
return art.getRelatedCount(relationTypeSide);
}
+ @Override
+ public Collection<Long> getRelatedIds(ArtifactId artifact, RelationTypeSide relationTypeSide) {
+ List<Long> related = new LinkedList<>();
+ ArtifactReadable art = getArtifact(artifact);
+ for (ArtifactReadable rel : art.getRelated(relationTypeSide)) {
+ related.add(rel.getId());
+ }
+ return related;
+ }
}
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 08407773df..aacf2e3ca1 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,12 +82,12 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public boolean isDeleted(IAtsObject atsObject) {
- return ((ArtifactReadable) atsObject.getStoreObject()).isDeleted();
+ return atsServer.getArtifact(atsObject).isDeleted();
}
@Override
public String getGuid(IAtsObject atsObject) {
- return ((ArtifactReadable) atsObject.getStoreObject()).getGuid();
+ return atsServer.getArtifact(atsObject).getGuid();
}
/**
@@ -128,7 +128,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public boolean isOfType(ArtifactId artifact, ArtifactTypeId... artifactType) {
- return ((ArtifactReadable) artifact).isOfType(artifactType);
+ return atsServer.getArtifact(artifact).isOfType(artifactType);
}
@Override
@@ -174,7 +174,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public IArtifactType getArtifactType(IAtsObject atsObject) {
- return getArtifactType(atsObject.getStoreObject());
+ return getArtifactType(atsServer.getArtifact(atsObject.getStoreObject()));
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemJsonWriter.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemJsonWriter.java
index 58ddd798da..35f0065b92 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemJsonWriter.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemJsonWriter.java
@@ -100,7 +100,7 @@ public class WorkItemJsonWriter implements MessageBodyWriter<IAtsWorkItem> {
protected static void addWorkItem(IAtsServer atsServer, IAtsWorkItem config, Annotation[] annotations, JsonGenerator writer, boolean identityView, AttributeTypes attributeTypes) throws IOException, JsonGenerationException, JsonProcessingException {
ArtifactReadable action = (ArtifactReadable) config.getStoreObject();
writer.writeStartObject();
- writer.writeNumberField("uuid", ConfigJsonWriter.getUuid(config));
+ writer.writeNumberField("uuid", ConfigJsonWriter.getUuid(config, atsServer));
writer.writeStringField("Name", config.getName());
String atsId = action.getSoleAttributeValue(AtsAttributeTypes.AtsId, "");
writer.writeStringField("AtsId", atsId);
diff --git a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
index 92ec16941c..6b6166efc3 100644
--- a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -226,6 +226,7 @@ Import-Package: com.google.common.cache,
org.eclipse.osee.framework.ui.ws,
org.eclipse.osee.jaxrs.client,
org.eclipse.osee.jdbc,
+ org.eclipse.osee.logger,
org.eclipse.osee.orcs.rest.client,
org.eclipse.osee.orcs.rest.model,
org.eclipse.osee.orcs.rest.model.search.artifact,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
index cdb573a385..a60f67afc3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
@@ -14,6 +14,7 @@ package org.eclipse.osee.ats.actions.wizard;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
@@ -23,9 +24,12 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.config.JaxActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.client.IAtsClient;
+import org.eclipse.osee.ats.core.config.ActionableItem2;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.help.ui.AtsHelpContext;
@@ -149,9 +153,16 @@ public class NewActionPage1 extends WizardPage {
treeViewer.getViewer().setLabelProvider(new AtsObjectLabelProvider());
try {
if (selectableAis == null) {
- List<IAtsActionableItem> topLevelActionableItems =
- ActionableItems.getTopLevelActionableItems(Active.Active, AtsClientService.get());
- treeViewer.getViewer().setInput(topLevelActionableItems);
+ List<IAtsActionableItem> activeActionableItemTree = new LinkedList<>();
+ IAtsClient atsClient = AtsClientService.get();
+ for (Long aiId : atsClient.getConfigurations().getIdToAi().get(
+ atsClient.getConfigurations().getTopActionableItem()).getChildren()) {
+ JaxActionableItem jai = atsClient.getConfigurations().getIdToAi().get(aiId);
+ if (jai.isActive()) {
+ activeActionableItemTree.add(new ActionableItem2(atsClient.getLogger(), atsClient, jai));
+ }
+ }
+ treeViewer.getViewer().setInput(activeActionableItemTree);
} else {
treeViewer.getViewer().setInput(selectableAis);
}
@@ -218,8 +229,14 @@ public class NewActionPage1 extends WizardPage {
if (checked.isEmpty()) {
descriptionLabel.setText("");
} else {
- IAtsActionableItem aia = (IAtsActionableItem) checked.iterator().next();
- descriptionLabel.setText(aia.getDescription());
+ Object obj = checked.iterator().next();
+ if (obj instanceof IAtsActionableItem) {
+ IAtsActionableItem ai = (IAtsActionableItem) obj;
+ descriptionLabel.setText(ai.getDescription());
+ } else if (obj instanceof JaxActionableItem) {
+ JaxActionableItem jai = (JaxActionableItem) obj;
+ descriptionLabel.setText(jai.getDescription());
+ }
}
}
}
@@ -231,7 +248,12 @@ public class NewActionPage1 extends WizardPage {
public Set<IAtsActionableItem> getSelectedIAtsActionableItems() {
Set<IAtsActionableItem> selected = new HashSet<>();
for (Object obj : treeViewer.getChecked()) {
- selected.add((IAtsActionableItem) obj);
+ if (obj instanceof IAtsActionableItem) {
+ selected.add((IAtsActionableItem) obj);
+ } else if (obj instanceof JaxActionableItem) {
+ JaxActionableItem jai = (JaxActionableItem) obj;
+ selected.add(AtsClientService.get().getConfigItem(jai.getUuid()));
+ }
}
return selected;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
index 2b5b7a13e1..181aeba82d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
@@ -121,7 +121,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
} else {
processedFromAis.add(fromAiArt);
}
- Artifact parentAiArt = (Artifact) parentAi.getStoreObject();
+ Artifact parentAiArt = AtsClientService.get().getArtifact(parentAi);
// Get or create new team definition
Artifact newAiArt = duplicateTeamDefinitionOrActionableItem(changes, fromAiArt);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
index 8815cf9fd0..24be92f799 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
@@ -20,9 +20,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.framework.core.enums.Active;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Donald G. Dunne
@@ -67,9 +65,6 @@ public class AITreeContentProvider implements ITreeContentProvider {
@Override
public boolean hasChildren(Object element) {
- if (element instanceof Artifact) {
- return ((Artifact) element).getRelatedArtifactsCount(CoreRelationTypes.Default_Hierarchical__Child) > 0;
- }
return getChildren(element).length > 0;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
index 6f17622579..b061ce97bd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
@@ -363,8 +363,8 @@ public class ImportAIsAndTeamDefinitionsToDb {
IAtsChangeSet changes = AtsClientService.get().createChangeSet(getClass().getSimpleName());
if (parent == null) {
if (isTeamDef) {
- parent = (Artifact) TeamDefinitions.getTopTeamDefinition(
- AtsClientService.get().getQueryService()).getStoreObject();
+ parent = AtsClientService.get().getArtifact(
+ TeamDefinitions.getTopTeamDefinition(AtsClientService.get().getQueryService()));
} else {
parent = (Artifact) ActionableItems.getTopActionableItem(AtsClientService.get());
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index e8b5358375..ddb862273b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -21,11 +21,11 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
@@ -39,6 +39,7 @@ import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.internal.artifact.Artifact;
import org.eclipse.osee.orcs.core.internal.attribute.Attribute;
import org.eclipse.osee.orcs.core.internal.proxy.ExternalArtifactManager;
+import org.eclipse.osee.orcs.core.internal.relation.Relation;
import org.eclipse.osee.orcs.core.internal.relation.RelationManager;
import org.eclipse.osee.orcs.core.internal.relation.RelationNode;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -326,4 +327,24 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
return getProxiedObject().getModificationType();
}
+ @Override
+ public Collection<Long> getChildrentIds() {
+ return getRelatedIds(CoreRelationTypes.Default_Hierarchical__Child);
+ }
+
+ @Override
+ public Collection<Long> getRelatedIds(RelationTypeSide relationTypeSide) {
+ List<Long> childIds = new ArrayList<>();
+ for (Relation relation : getRelationManager().getRelations(getSession(), getProxiedObject(),
+ DeletionFlag.EXCLUDE_DELETED)) {
+ boolean relIsSideA = relationTypeSide.getSide().isSideA();
+ boolean thisOnCorrectSide =
+ (relIsSideA && relation.getArtIdB() == getId().intValue()) || (!relIsSideA && relation.getArtIdA() == getId().intValue());
+ if (thisOnCorrectSide && relation.getRelationType().matches(relationTypeSide)) {
+ childIds.add(Long.valueOf(relation.getArtIdB()));
+ }
+ }
+ return childIds;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 8b41cf29d2..e4c6e991b2 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -102,4 +102,8 @@ public interface ArtifactReadable extends ArtifactToken, HasTransaction, OrcsRea
ResultSet<RelationReadable> getRelations(RelationTypeSide relationTypeSide);
+ Collection<Long> getChildrentIds();
+
+ Collection<Long> getRelatedIds(RelationTypeSide relationTypeSide);
+
}

Back to the top