Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-08-08 15:18:07 -0400
committerAngel Avila2016-10-04 21:34:54 -0400
commit2dc5377dbeafb7e67f88eae47e7fe76753b3b5ba (patch)
tree2008293f81b9eca13039272ee5cf1f8443c9e802
parent02dbcb67ca6825f8cb81161ef51fc0a303123522 (diff)
downloadorg.eclipse.osee-2dc5377dbeafb7e67f88eae47e7fe76753b3b5ba.tar.gz
org.eclipse.osee-2dc5377dbeafb7e67f88eae47e7fe76753b3b5ba.tar.xz
org.eclipse.osee-2dc5377dbeafb7e67f88eae47e7fe76753b3b5ba.zip
refactor: Use ArtifactId with IAtsServices
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java13
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsConfigItemFactory.java5
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java29
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/ConfigItemFactory.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java16
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/IAtsServer.java4
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java53
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ConfigJsonWriter.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigPreferencePage.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java9
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java2
-rw-r--r--plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java8
19 files changed, 78 insertions, 140 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
index 7be48f071ae..e73c38be983 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
@@ -45,7 +45,7 @@ import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.logger.Log;
/**
@@ -53,6 +53,8 @@ import org.eclipse.osee.logger.Log;
*/
public interface IAtsServices extends IAtsConfigurationProvider, IWorkDefinitionStringProvider {
+ IOseeBranch getAtsBranch();
+
IRelationResolver getRelationResolver();
IAttributeResolver getAttributeResolver();
@@ -71,9 +73,9 @@ public interface IAtsServices extends IAtsConfigurationProvider, IWorkDefinition
ArtifactId getArtifact(Long uuid);
- ArtifactId getArtifact(ArtifactId artifact) throws OseeCoreException;
+ ArtifactId getArtifact(ArtifactId artifact);
- ArtifactId getArtifact(IAtsObject atsObject) throws OseeCoreException;
+ ArtifactId getArtifact(IAtsObject atsObject);
void setChangeType(IAtsObject atsObject, ChangeType changeType, IAtsChangeSet changes);
@@ -91,11 +93,9 @@ public interface IAtsServices extends IAtsConfigurationProvider, IWorkDefinition
IAtsConfigItemFactory getConfigItemFactory();
- ArtifactId getArtifact(IArtifactToken token);
-
IAtsStoreService getStoreService();
- <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz) throws OseeCoreException;
+ <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz);
Collection<ITransitionListener> getTransitionListeners();
@@ -146,7 +146,6 @@ public interface IAtsServices extends IAtsConfigurationProvider, IWorkDefinition
<T> T getConfigItem(String guid);
<T> T getConfigItem(Long uuid);
-
void setConfigValue(String key, String value);
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsConfigItemFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsConfigItemFactory.java
index 99d3110c1a2..a57c358fa10 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsConfigItemFactory.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsConfigItemFactory.java
@@ -68,8 +68,5 @@ public interface IAtsConfigItemFactory {
IAtsCountry getCountry(ArtifactId artifact);
- IAtsCountry getCountry(long uuid);
-
IAtsWorkPackage getWorkPackage(ArtifactId artifact);
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
index 691822015c5..c7d053eff2e 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
@@ -35,8 +35,8 @@ import org.eclipse.osee.ats.demo.api.DemoInsertionActivity;
import org.eclipse.osee.ats.demo.api.DemoProgram;
import org.eclipse.osee.ats.demo.api.DemoSubsystems;
import org.eclipse.osee.ats.demo.api.DemoUsers;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
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 24cf5dfc42a..227a68e5e3d 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
@@ -35,7 +35,6 @@ import org.eclipse.osee.ats.api.workflow.state.IAtsWorkStateFactory;
import org.eclipse.osee.ats.core.client.artifact.GoalArtifact;
import org.eclipse.osee.ats.core.client.artifact.SprintArtifact;
import org.eclipse.osee.ats.core.client.config.IAtsClientVersionService;
-import org.eclipse.osee.ats.core.client.internal.IArtifactProvider;
import org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactServiceProvider;
import org.eclipse.osee.ats.core.client.util.IArtifactMembersCache;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
@@ -43,41 +42,37 @@ import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.IAtsCacheProvider;
import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
import org.eclipse.osee.ats.core.workflow.TeamWorkflowProviders;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Donald G. Dunne
*/
-public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolverProvider, IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsCacheProvider, ITeamDefinitionFactory, IActionableItemFactory, IArtifactProvider, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
+public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolverProvider, IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsCacheProvider, ITeamDefinitionFactory, IActionableItemFactory, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
- Artifact getConfigArtifact(IAtsConfigObject atsConfigObject) throws OseeCoreException;
-
- /**
- * @return corresponding Artifact or null if not found
- */
@Override
- Artifact getArtifact(IArtifactToken token) throws OseeCoreException;
+ Artifact getArtifact(ArtifactId artifact);
+
+ Artifact getConfigArtifact(IAtsConfigObject atsConfigObject);
/**
* @return corresponding Artifact or null if not found
*/
@Override
- Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException;
+ Artifact getArtifact(IAtsObject atsObject);
- AbstractWorkflowArtifact getWorkflowArtifact(IAtsObject atsObject) throws OseeCoreException;
+ AbstractWorkflowArtifact getWorkflowArtifact(IAtsObject atsObject);
- List<Artifact> getConfigArtifacts(Collection<? extends IAtsObject> atsObjects) throws OseeCoreException;
+ List<Artifact> getConfigArtifacts(Collection<? extends IAtsObject> atsObjects);
void invalidateCache();
- void reloadWorkDefinitionCache(boolean pend) throws OseeCoreException;
+ void reloadWorkDefinitionCache(boolean pend);
void invalidateWorkDefinitionCache();
- void reloadAllCaches(boolean pend) throws OseeCoreException;
+ void reloadAllCaches(boolean pend);
void invalidateAllCaches();
@@ -94,7 +89,7 @@ public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolv
IAtsTeamDefinitionService getTeamDefinitionService();
@Override
- Artifact getArtifact(Long uuid) throws OseeCoreException;
+ Artifact getArtifact(Long uuid);
@Override
IAtsClientVersionService getVersionService();
@@ -108,7 +103,7 @@ public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolv
IVersionFactory getVersionFactory();
@Override
- Artifact getArtifactByGuid(String guid) throws OseeCoreException;
+ Artifact getArtifactByGuid(String guid);
Artifact getArtifactByAtsId(String id);
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 1afc0ece8ef..04cad59be1c 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
@@ -106,8 +106,8 @@ import org.eclipse.osee.ats.core.workflow.AtsWorkItemServiceImpl;
import org.eclipse.osee.ats.core.workflow.TeamWorkflowProviders;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
@@ -231,7 +231,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
workDefAdmin = new AtsWorkDefinitionAdminImpl(workDefCache, workDefService, attributeResolverService,
teamWorkflowProvidersLazy);
branchService = new AtsBranchServiceImpl(this, teamWorkflowProvidersLazy);
- reviewService = new AtsReviewServiceImpl(this, this);
+ reviewService = new AtsReviewServiceImpl(this);
atsLogFactory = AtsCoreFactory.newLogFactory();
atsStateFactory = AtsCoreFactory.newStateFactory(getServices(), atsLogFactory);
@@ -441,7 +441,10 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
*/
@Override
public Artifact getArtifact(ArtifactId artifact) throws OseeCoreException {
- return (Artifact) artifact;
+ if (artifact instanceof Artifact) {
+ return (Artifact) artifact;
+ }
+ return ArtifactQuery.getArtifactFromId(artifact, AtsUtilCore.getAtsBranch());
}
@Override
@@ -695,11 +698,6 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
}
@Override
- public Artifact getArtifact(IArtifactToken token) throws OseeCoreException {
- return getArtifact(token.getId());
- }
-
- @Override
public <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz) throws OseeCoreException {
return getCache().getByUuid(uuid, clazz);
}
@@ -773,8 +771,12 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
}
@Override
+ public IOseeBranch getAtsBranch() {
+ return AtsUtilCore.getAtsBranch();
+ }
+
+ @Override
public IAtsChangeSet createAtsChangeSet(String comment) {
return getStoreService().createAtsChangeSet(comment, getUserService().getCurrentUser());
}
-
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/ConfigItemFactory.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/ConfigItemFactory.java
index 5598c99ccd0..e38e7806fd0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/ConfigItemFactory.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/ConfigItemFactory.java
@@ -226,10 +226,4 @@ public class ConfigItemFactory extends AbstractConfigItemFactory {
}
return country;
}
-
- @Override
- public IAtsCountry getCountry(long uuid) {
- return getCountry(atsClient.getArtifact(uuid));
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java
deleted file mode 100644
index 4ce350b283a..00000000000
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * 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.client.internal;
-
-import org.eclipse.osee.ats.api.IAtsObject;
-import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * @author Donald G Dunne
- */
-public interface IArtifactProvider {
-
- Artifact getArtifact(ArtifactId artifact) throws OseeCoreException;
-
- Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException;
-}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
index ab8f5349df1..b3ce9eb50eb 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.IAtsClient;
-import org.eclipse.osee.ats.core.client.internal.IArtifactProvider;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.review.ValidateReviewManager;
@@ -36,20 +35,17 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public class AtsReviewServiceImpl implements IAtsReviewService {
- private final IArtifactProvider artifactProvider;
private final IAtsClient atsClient;
- public AtsReviewServiceImpl(IAtsClient atsClient, IArtifactProvider artifactProvider) {
+ public AtsReviewServiceImpl(IAtsClient atsClient) {
this.atsClient = atsClient;
- this.artifactProvider = artifactProvider;
}
@Override
public boolean isValidationReviewRequired(IAtsWorkItem workItem) throws OseeCoreException {
boolean required = false;
if (workItem.isTeamWorkflow()) {
- required =
- artifactProvider.getArtifact(workItem).getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, false);
+ required = atsClient.getArtifact(workItem).getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, false);
}
return required;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
index af458360980..71d822e8d38 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
@@ -23,7 +23,7 @@ import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
@@ -45,17 +45,11 @@ public class AtsUtilCore {
public static final String ATS_DEFAULT_ACTION_URL = "/ats/ui/action/UUID";
private static final Object lock = new Object();
- private volatile static BranchId atsBranch;
- private volatile static String atsConfigName;
+ private volatile static IOseeBranch atsBranch;
private static Map<Long, String> uuidToGuidMap = new HashMap<>(50);
private static Map<String, Long> guidToUuidMap = new HashMap<>(50);
- public static String getAtsConfigName() {
- getAtsBranch();
- return atsConfigName;
- }
-
- public static BranchId getAtsBranch() {
+ public static IOseeBranch getAtsBranch() {
synchronized (lock) {
if (atsBranch == null) {
// Preference store overrides all
@@ -77,7 +71,6 @@ public class AtsUtilCore {
// default is always common
if (atsBranch == null) {
atsBranch = CoreBranches.COMMON;
- atsConfigName = CoreBranches.COMMON.getName();
}
}
}
@@ -89,8 +82,7 @@ public class AtsUtilCore {
name = "unknown";
}
if (Strings.isValid(branchUuid) && branchUuid.matches("\\d+")) {
- atsBranch = TokenFactory.createBranch(Long.valueOf(branchUuid), name);
- atsConfigName = name;
+ atsBranch = IOseeBranch.create(Long.valueOf(branchUuid), name);
}
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/IAtsServer.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/IAtsServer.java
index be6fd8da0e1..7025b17fc9f 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/IAtsServer.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/IAtsServer.java
@@ -30,7 +30,6 @@ import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
import org.eclipse.osee.ats.core.config.IAtsCacheProvider;
import org.eclipse.osee.ats.rest.util.IArtifactProvider;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -79,9 +78,6 @@ public interface IAtsServer extends IAtsServices, IAtsNotifier, IAtsConfigItemFa
void addAtsDatabaseConversion(IAtsDatabaseConversion conversion);
- @Override
- ArtifactReadable getArtifact(IArtifactToken token);
-
CustomizeData getCustomizationByGuid(String customize_guid);
Collection<CustomizeData> getCustomizations(String namespace);
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 1e110e6e9f2..f6e4f7cd4b5 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.rest.internal;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -98,8 +99,8 @@ import org.eclipse.osee.ats.rest.internal.workitem.WorkItemFactory;
import org.eclipse.osee.ats.rest.util.ChangeTypeUtil;
import org.eclipse.osee.ats.rest.util.IAtsNotifierServer;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
@@ -114,6 +115,7 @@ import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.search.QueryBuilder;
+import org.eclipse.osee.orcs.search.QueryFactory;
/**
* @author Donald G Dunne
@@ -122,6 +124,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
public static String PLUGIN_ID = "org.eclipse.osee.ats.rest";
private OrcsApi orcsApi;
+ private QueryFactory query;
private Log logger;
private IAtsWorkItemFactory workItemFactory;
private IAtsWorkDefinitionService workDefService;
@@ -181,6 +184,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
public void setOrcsApi(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
+ query = orcsApi.getQueryFactory();
}
public void setWorkDefService(IAtsWorkDefinitionService workDefService) {
@@ -296,9 +300,10 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
if (atsObject.getStoreObject() != null) {
result = (ArtifactReadable) atsObject.getStoreObject();
} else {
- result = orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andUuid(
- atsObject.getId()).getResults().getAtMostOneOrNull();
+ result = query.fromBranch(getAtsBranch()).andUuid(atsObject.getId()).getResults().getAtMostOneOrNull();
}
+ } else {
+ result = query.fromBranch(getAtsBranch()).andId(artifact).getResults().getOneOrNull();
}
return result;
}
@@ -309,8 +314,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
if (atsObject.getStoreObject() != null) {
result = (ArtifactReadable) atsObject.getStoreObject();
} else {
- result = orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andUuid(
- atsObject.getId()).getResults().getAtMostOneOrNull();
+ result = query.fromBranch(getAtsBranch()).andUuid(atsObject.getId()).getResults().getAtMostOneOrNull();
}
return result;
}
@@ -334,8 +338,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
public ArtifactReadable getArtifactByGuid(String guid) throws OseeCoreException {
ArtifactReadable artifact = null;
try {
- artifact =
- orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andGuid(guid).getResults().getExactlyOne();
+ artifact = query.fromBranch(getAtsBranch()).andGuid(guid).getResults().getExactlyOne();
} catch (ItemDoesNotExist ex) {
// do nothing
}
@@ -346,8 +349,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
public ArtifactReadable getArtifactByAtsId(String id) {
ArtifactReadable artifact = null;
try {
- artifact = orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).and(AtsAttributeTypes.AtsId,
- id).getResults().getOneOrNull();
+ artifact = query.fromBranch(getAtsBranch()).and(AtsAttributeTypes.AtsId, id).getResults().getOneOrNull();
} catch (ItemDoesNotExist ex) {
// do nothing
}
@@ -422,15 +424,13 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public ArtifactReadable getArtifact(Long uuid) {
- return orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andUuid(
- new Long(uuid).intValue()).getResults().getOneOrNull();
+ return query.fromBranch(getAtsBranch()).andUuid(uuid).getResults().getOneOrNull();
}
@Override
public Collection<ArtifactReadable> getArtifacts(List<Long> uuids) {
Collection<ArtifactReadable> artifacts = new LinkedList<>();
- Iterator<ArtifactReadable> iterator =
- orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andUuids(uuids).getResults().iterator();
+ Iterator<ArtifactReadable> iterator = query.fromBranch(getAtsBranch()).andUuids(uuids).getResults().iterator();
while (iterator.hasNext()) {
artifacts.add(iterator.next());
}
@@ -453,15 +453,14 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public QueryBuilder getQuery() {
- return getOrcsApi().getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch());
+ return getOrcsApi().getQueryFactory().fromBranch(getAtsBranch());
}
@Override
public String getConfigValue(String key) {
String result = null;
- @SuppressWarnings("unchecked")
- ArtifactReadable atsConfig = orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andIds(
- AtsArtifactToken.AtsConfig).getResults().getAtMostOneOrNull();
+ ArtifactReadable atsConfig =
+ query.fromBranch(COMMON).andIds(AtsArtifactToken.AtsConfig).getResults().getAtMostOneOrNull();
if (atsConfig != null) {
for (Object obj : atsConfig.getAttributeValues(CoreAttributeTypes.GeneralStringData)) {
String str = (String) obj;
@@ -575,11 +574,6 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
}
@Override
- public ArtifactReadable getArtifact(IArtifactToken token) {
- return getArtifact(token.getId());
- }
-
- @Override
public <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz) throws OseeCoreException {
return getCache().getByUuid(uuid, clazz);
}
@@ -606,7 +600,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public ArtifactId getArtifactByName(IArtifactType artifactType, String name) {
- return orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andIsOfType(artifactType).andNameEquals(
+ return query.fromBranch(getAtsBranch()).andIsOfType(artifactType).andNameEquals(
name).getResults().getAtMostOneOrNull();
}
@@ -644,9 +638,8 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public CustomizeData getCustomizationByGuid(String customize_guid) {
CustomizeData cust = null;
- ArtifactReadable customizeStoreArt =
- orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).and(CoreAttributeTypes.XViewerCustomization,
- customize_guid, QueryOption.CONTAINS_MATCH_OPTIONS).getResults().getAtMostOneOrNull();
+ ArtifactReadable customizeStoreArt = query.fromBranch(getAtsBranch()).and(CoreAttributeTypes.XViewerCustomization,
+ customize_guid, QueryOption.CONTAINS_MATCH_OPTIONS).getResults().getAtMostOneOrNull();
if (customizeStoreArt != null) {
for (String custXml : getAttributeResolver().getAttributesToStringList(customizeStoreArt,
CoreAttributeTypes.XViewerCustomization)) {
@@ -669,7 +662,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
private List<ArtifactId> getGlobalCustomizeArts() {
List<ArtifactId> customizationArts = new ArrayList<>();
- for (ArtifactId artifact : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON).andIsOfType(
+ for (ArtifactId artifact : query.fromBranch(CoreBranches.COMMON).andIsOfType(
CoreArtifactTypes.XViewerGlobalCustomization).getResults()) {
customizationArts.add(artifact);
}
@@ -727,4 +720,8 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
return logger;
}
-}
+ @Override
+ public IOseeBranch getAtsBranch() {
+ return AtsUtilCore.getAtsBranch();
+ }
+} \ No newline at end of file
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 c8ddbbf23e2..fd00d9be808 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
@@ -278,7 +278,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
@Override
public Response storeWorkDef(JaxAtsWorkDef jaxWorkDef) {
TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON,
- atsServer.getArtifact(AtsCoreUsers.SYSTEM_USER.getId()), "Store Work Definition " + jaxWorkDef.getName());
+ atsServer.getArtifact(AtsCoreUsers.SYSTEM_USER), "Store Work Definition " + jaxWorkDef.getName());
ArtifactReadable workDefArt = orcsApi.getQueryFactory().fromBranch(AtsUtilCore.getAtsBranch()).andIsOfType(
AtsArtifactTypes.WorkDefinition).andNameEquals(jaxWorkDef.getName()).getResults().getAtMostOneOrNull();
if (workDefArt == null) {
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 5935b0c97d1..62ae9f65145 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
@@ -209,7 +209,7 @@ public class ConfigJsonWriter implements MessageBodyWriter<IAtsConfigObject> {
writer.writeEndObject();
}
writer.writeEndArray();
- ArtifactReadable teamArt = atsServer.getArtifact(team.getId());
+ ArtifactReadable teamArt = atsServer.getArtifact(team);
ArtifactReadable backlogArt =
teamArt.getRelated(AtsRelationTypes.AgileTeamToBacklog_Backlog).getAtMostOneOrNull();
writer.writeStringField("Backlog Uuid", backlogArt != null ? String.valueOf(backlogArt.getId()) : "");
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
index dbf9dbc67c2..c13f9e83ed1 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
@@ -318,10 +318,4 @@ public class ConfigItemFactory extends AbstractConfigItemFactory {
}
return country;
}
-
- @Override
- public IAtsCountry getCountry(long uuid) {
- return getCountry(atsServer.getArtifact(uuid));
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigPreferencePage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigPreferencePage.java
index 6cece1b3c18..363daf295a2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigPreferencePage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigPreferencePage.java
@@ -85,7 +85,7 @@ public class AtsConfigPreferencePage extends PreferencePage implements IWorkbenc
private void updateConfigurationField() {
configText.setEditable(true);
- configText.setText(AtsUtilCore.getAtsConfigName());
+ configText.setText(AtsUtilCore.getAtsBranch().getName());
configText.setEditable(false);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index edf500576cf..891b5ac6a98 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -718,7 +718,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
private List<Long> getInvalidUuids(List<Long> uuids) throws OseeCoreException {
List<Long> badUuids = new ArrayList<>();
for (Long uuid : uuids) {
- if (AtsClientService.get().getArtifact(uuid.longValue()) == null) {
+ if (AtsClientService.get().getArtifact(uuid) == null) {
badUuids.add(uuid);
}
}
@@ -773,9 +773,10 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
"Error: [%s][%d][%s] has Parent Branch Uuid attribute set to Archived Branch [%s] named [%s]",
name.getName(), name.getId(), name, parentBranchUuid, branch));
} else if (!BranchManager.getType(branch).isBaselineBranch()) {
- results.log("validateBranchUuid", String.format(
- "Error: [%s][%d][%s] has Parent Branch Uuid attribute [%s][%s] that is a [%s] branch; should be a BASELINE branch",
- name.getName(), name.getId(), name, BranchManager.getType(branch).name(), parentBranchUuid, branch));
+ results.log("validateBranchUuid",
+ String.format(
+ "Error: [%s][%d][%s] has Parent Branch Uuid attribute [%s][%s] that is a [%s] branch; should be a BASELINE branch",
+ name.getName(), name.getId(), name, BranchManager.getType(branch).name(), parentBranchUuid, branch));
}
} catch (BranchDoesNotExist ex) {
results.log("validateBranchUuid",
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
index 28128bc9812..289dfc3ddb3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
@@ -233,7 +233,7 @@ public class NavigateView extends ViewPart implements IXNavigateEventListener, I
private String getWhoAmI() {
try {
String userName = AtsClientService.get().getUserService().getCurrentUser().getName();
- return String.format("[%s] - [%s]", AtsUtilCore.getAtsConfigName(), userName);
+ return String.format("[%s] - [%s]", AtsUtilCore.getAtsBranch().getName(), userName);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
return "Exception: " + ex.getLocalizedMessage();
diff --git a/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
index 67b84e40819..63164ae1690 100644
--- a/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.osee.ats.core.users,
org.eclipse.osee.ats.core.util,
org.eclipse.osee.ats.rest,
+ org.eclipse.osee.ats.rest.util,
org.eclipse.osee.define.report.api,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
index 1ac19f729cc..b8dfeb744be 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
@@ -102,12 +102,12 @@ public class SafetyWorkflowEventHandler implements EventHandler {
private ArtifactReadable getAssociatedWorkflowArt(BranchId branchId) {
ArtifactReadable toReturn = null;
BranchReadable branch = queryFactory.branchQuery().andIds(branchId).getResults().getExactlyOne();
- ArtifactId workflowUuid = branch.getAssociatedArtifact();
+ ArtifactId workflowId = branch.getAssociatedArtifact();
try {
- toReturn = atsServer.getQuery().andUuid(workflowUuid.getId()).andIsOfType(
+ toReturn = atsServer.getQuery().andId(workflowId).andIsOfType(
AtsArtifactTypes.TeamWorkflow).getResults().getExactlyOne();
} catch (Exception ex) {
- throw new OseeCoreException(ex, "Exception in getAssociatedWorkflowArt: %s", workflowUuid);
+ throw new OseeCoreException(ex, "Exception in getAssociatedWorkflowArt: %s", workflowId);
}
return toReturn;
}
@@ -115,7 +115,7 @@ public class SafetyWorkflowEventHandler implements EventHandler {
private IAtsTeamWorkflow getSafetyWorkflow(ArtifactReadable workflowArt) {
Conditions.checkNotNull(workflowArt, "work flow artifact");
IAtsTeamWorkflow safetyWorkflow = null;
- ArtifactReadable safetyActionableItemArt = atsServer.getArtifact(AtsArtifactToken.SafetyActionableItem.getId());
+ ArtifactReadable safetyActionableItemArt = atsServer.getArtifact(AtsArtifactToken.SafetyActionableItem);
IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(workflowArt);
IAtsActionableItem actionableItem = atsServer.getConfigItemFactory().getActionableItem(safetyActionableItemArt);
for (IAtsTeamWorkflow sibling : atsServer.getActionFactory().getSiblingTeamWorkflows(teamWf)) {

Back to the top