Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-09-03 16:55:28 -0400
committerRoberto Escobar2014-09-05 18:23:52 -0400
commit4b39f62387cc56ab3acfd5157a8af30f409facde (patch)
treefae1ae02da849ed5da4c5afbf7b366bb0363db87
parent7f1342574cc2711e00250d283c1cf29c6c5dce1c (diff)
downloadorg.eclipse.osee-4b39f62387cc56ab3acfd5157a8af30f409facde.tar.gz
org.eclipse.osee-4b39f62387cc56ab3acfd5157a8af30f409facde.tar.xz
org.eclipse.osee-4b39f62387cc56ab3acfd5157a8af30f409facde.zip
bug[ats_ATS104424]: Remove ats.rest dependency on framework.core.server
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java2
-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/src/org/eclipse/osee/ats/core/cpa/CpaFactory.java2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsWorkItemServiceImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF15
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/build/report/BuildTraceReport.java17
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/cpa/CpaResource.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCpaOpenPcrWidget.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java1
11 files changed, 53 insertions, 44 deletions
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 b4f6e76f95..bb39046f7d 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
@@ -116,4 +116,6 @@ public interface IAtsClient extends IAttributeResolverProvider, IAtsReviewServic
IAtsUtilService getUtilService();
+ String getConfigValue(String key);
+
}
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 69f70dec1a..5af0e01900 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
@@ -19,6 +19,7 @@ import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.ev.IAtsEarnedValueService;
import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
@@ -75,10 +76,12 @@ import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
import org.eclipse.osee.ats.core.config.IVersionFactory;
import org.eclipse.osee.ats.core.util.AtsCoreFactory;
import org.eclipse.osee.ats.core.util.AtsSequenceProvider;
+import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionAdminImpl;
import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -86,6 +89,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
/**
* @author Donald G. Dunne
@@ -487,4 +491,20 @@ public class AtsClientImpl implements IAtsClient {
return utilService;
}
+ @Override
+ public String getConfigValue(String key) {
+ String result = null;
+ Artifact atsConfig = ArtifactQuery.getArtifactFromToken(AtsArtifactToken.AtsConfig, AtsUtilCore.getAtsBranch());
+ if (atsConfig != null) {
+ for (Object obj : atsConfig.getAttributeValues(CoreAttributeTypes.GeneralStringData)) {
+ String str = (String) obj;
+ if (str.startsWith(key)) {
+ result = str.replaceFirst(key + "=", "");
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/cpa/CpaFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/cpa/CpaFactory.java
index 15b88b643a..6fd55fe3e7 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/cpa/CpaFactory.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/cpa/CpaFactory.java
@@ -22,7 +22,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
public class CpaFactory {
private static final Map<String, Object> idToStoreObject = new HashMap<String, Object>(500);
- public static final String CPA_BASEPATH_KEY = "ats.cpa.basepath";
+ public static final String CPA_BASEPATH_KEY = "CpaBasepath";
public static CpaProgram get(IAtsProgram program) {
return getProgram(program, null);
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
index efb7c8df06..ad1a53e3da 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
@@ -136,7 +136,7 @@ public class AtsServerImpl implements IAtsServer {
configItemFactory = new ConfigItemFactory(logger, this);
notifyService = new AtsNotificationServiceImpl();
- workItemService = new AtsWorkItemServiceImpl(this, workItemFactory, this);
+ workItemService = new AtsWorkItemServiceImpl(this, this);
branchService = new AtsBranchServiceImpl(orcsApi);
reviewService = new AtsReviewServiceImpl(this, workItemService);
workDefCacheProvider = new AtsWorkDefinitionCacheProvider(workDefService);
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsWorkItemServiceImpl.java
index 349cf25afa..6cef274d49 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsWorkItemServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsWorkItemServiceImpl.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
-import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateType;
@@ -41,13 +40,11 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
*/
public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
- private final IAtsWorkItemFactory workItemFactory;
private final IArtifactProvider artifactProvider;
private final IAtsServer atsServer;
- public AtsWorkItemServiceImpl(IAtsServer atsServer, IAtsWorkItemFactory workItemFactory, IArtifactProvider artifactProvider) {
+ public AtsWorkItemServiceImpl(IAtsServer atsServer, IArtifactProvider artifactProvider) {
this.atsServer = atsServer;
- this.workItemFactory = workItemFactory;
this.artifactProvider = artifactProvider;
}
diff --git a/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
index 4dfb8fd2b1..4d0e9d673d 100644
--- a/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
@@ -16,31 +16,20 @@ Import-Package: com.google.gson;version="2.1.0",
org.apache.commons.lang,
org.eclipse.osee.ats.api,
org.eclipse.osee.ats.api.ai,
- org.eclipse.osee.ats.api.commit,
org.eclipse.osee.ats.api.config,
org.eclipse.osee.ats.api.cpa,
org.eclipse.osee.ats.api.data,
- org.eclipse.osee.ats.api.notify,
- org.eclipse.osee.ats.api.program,
- org.eclipse.osee.ats.api.review,
org.eclipse.osee.ats.api.team,
org.eclipse.osee.ats.api.user,
org.eclipse.osee.ats.api.util,
- org.eclipse.osee.ats.api.version,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
- org.eclipse.osee.ats.api.workflow.log,
org.eclipse.osee.ats.api.workflow.state,
org.eclipse.osee.ats.api.workflow.transition,
- org.eclipse.osee.ats.core,
- org.eclipse.osee.ats.core.column,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.core.cpa,
- org.eclipse.osee.ats.core.model.impl,
org.eclipse.osee.ats.core.users,
org.eclipse.osee.ats.core.util,
- org.eclipse.osee.ats.core.workdef,
- org.eclipse.osee.ats.core.workflow.log,
org.eclipse.osee.ats.core.workflow.state,
org.eclipse.osee.ats.core.workflow.transition,
org.eclipse.osee.ats.impl,
@@ -51,14 +40,10 @@ Import-Package: com.google.gson;version="2.1.0",
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
- org.eclipse.osee.framework.core.model.cache,
- org.eclipse.osee.framework.core.server,
org.eclipse.osee.framework.core.util,
- org.eclipse.osee.framework.database,
org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
- org.eclipse.osee.framework.logging,
org.eclipse.osee.jaxrs,
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
index 2940e81953..da5342bb94 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
@@ -26,7 +26,6 @@ import org.eclipse.osee.ats.rest.internal.resources.TeamResource;
import org.eclipse.osee.ats.rest.internal.resources.UserResource;
import org.eclipse.osee.ats.rest.internal.resources.VersionResource;
import org.eclipse.osee.ats.rest.internal.util.JaxRsExceptionMapper;
-import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
import org.eclipse.osee.framework.jdk.core.type.ResourceRegistry;
import org.eclipse.osee.logger.Log;
@@ -44,7 +43,6 @@ public class AtsApplication extends Application {
private IAtsServer atsServer;
private OrcsApi orcsApi;
private Log logger;
- private IApplicationServerManager appServerMgr;
public void setOrcsApi(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
@@ -58,10 +56,6 @@ public class AtsApplication extends Application {
this.atsServer = atsServer;
}
- public void setAppServerMgr(IApplicationServerManager appServerMgr) {
- this.appServerMgr = appServerMgr;
- }
-
public void start() {
IResourceRegistry registry = new ResourceRegistry();
AtsResourceTokens.register(registry);
@@ -77,11 +71,11 @@ public class AtsApplication extends Application {
singletons.add(new TeamResource(orcsApi));
singletons.add(new VersionResource(orcsApi));
singletons.add(new ConfigResource(atsServer, orcsApi, logger, registry));
- singletons.add(new CpaResource(orcsApi, atsServer, appServerMgr));
+ singletons.add(new CpaResource(orcsApi, atsServer));
singletons.add(new UserResource(atsServer.getUserService()));
singletons.add(new AtsUiResource(registry, orcsApi));
- System.out.println("ATS - Application started - " + appServerMgr.getServerUri());
+ System.out.println("ATS - Application started - " + System.getProperty("OseeApplicationServer"));
}
public void stop() {
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/build/report/BuildTraceReport.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/build/report/BuildTraceReport.java
index 44583e2747..54078fc963 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/build/report/BuildTraceReport.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/build/report/BuildTraceReport.java
@@ -38,7 +38,6 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.server.OseeServerProperties;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -61,14 +60,24 @@ public class BuildTraceReport {
private static final Pair<String, String> EMPTY_PAIR = new Pair<String, String>("", "");
+ private int getPort(UriInfo uriInfo) {
+ URI baseUri = uriInfo.getAbsolutePath();
+ return baseUri.getPort();
+ }
+
public void getBuildArchive(OutputStream output, OrcsApi orcsApi, Log logger, String fileName, String programId, String buildId, String programName, String buildName, UriInfo uriInfo) {
ByteArrayOutputStream tableStream = new ByteArrayOutputStream();
final ZipOutputStream zout = new ZipOutputStream(output);
- int serverPort = OseeServerProperties.getOseeApplicationServerPort();
- String supportFilesUrl =
- uriInfo.getBaseUriBuilder().path(BuildTraceReportResource.RESOURCE_BASE).host("localhost").port(serverPort).build().toString();
+ UriBuilder uriBuilder =
+ uriInfo.getBaseUriBuilder().path(BuildTraceReportResource.RESOURCE_BASE).host("localhost");
+
+ int port = getPort(uriInfo);
+ if (port > -1) {
+ uriBuilder.port(port);
+ }
+ String supportFilesUrl = uriBuilder.build().toString();
ArchiveCollector dataCollector = new ArchiveCollector(supportFilesUrl, logger);
createTraceReport(buildId, programName, buildName, AtsElementData.ARCHIVE_REPORT_TEMPLATE, tableStream,
dataCollector, orcsApi, logger);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/cpa/CpaResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/cpa/CpaResource.java
index b2fcac0e4c..997e4b1de7 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/cpa/CpaResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/cpa/CpaResource.java
@@ -49,8 +49,6 @@ import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.ats.impl.util.AtsUtilServer;
import org.eclipse.osee.framework.core.enums.Operator;
-import org.eclipse.osee.framework.core.server.IApplicationServerManager;
-import org.eclipse.osee.framework.database.core.OseeInfo;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
@@ -72,12 +70,11 @@ public final class CpaResource {
private final OrcsApi orcsApi;
private final IAtsServer atsServer;
- private final IApplicationServerManager appServerMgr;
+ private static String cpaBasepath;
- public CpaResource(OrcsApi orcsApi, IAtsServer atsServer, IApplicationServerManager appServerMgr) {
+ public CpaResource(OrcsApi orcsApi, IAtsServer atsServer) {
this.orcsApi = orcsApi;
this.atsServer = atsServer;
- this.appServerMgr = appServerMgr;
}
@GET
@@ -154,7 +151,10 @@ public final class CpaResource {
}
public String getCpaBasePath() {
- return OseeInfo.getCachedValue(CpaFactory.CPA_BASEPATH_KEY);
+ if (cpaBasepath == null) {
+ cpaBasepath = atsServer.getConfigValue(CpaFactory.CPA_BASEPATH_KEY);
+ }
+ return cpaBasepath;
}
@GET
@@ -163,11 +163,12 @@ public final class CpaResource {
public Response getDecision(@PathParam("uuid") String uuid, @QueryParam("pcrSystem") String pcrSystem) throws Exception {
URI uri = null;
if (pcrSystem == null) {
- uri =
- UriBuilder.fromUri(appServerMgr.getServerUri()).path("ats").path("action").path(uuid).path("state").build();
+ String actionUrl = atsServer.getConfigValue("ActionUrl");
+ actionUrl = actionUrl.replaceFirst("UUID", uuid);
+ uri = UriBuilder.fromUri(actionUrl).build();
} else {
IAtsCpaService service = AtsCpaServices.getService(pcrSystem);
- uri = service.getLocation(appServerMgr.getServerUri(), uuid);
+ uri = service.getLocation(UriBuilder.fromUri(getCpaBasePath()).build(), uuid);
}
return Response.seeOther(uri).build();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCpaOpenPcrWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCpaOpenPcrWidget.java
index 3dbb1d954d..3a6dc65d22 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCpaOpenPcrWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCpaOpenPcrWidget.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.ats.util.widgets;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.cpa.CpaFactory;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.util.Result;
-import org.eclipse.osee.framework.database.core.OseeInfo;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -33,7 +33,7 @@ public class XCpaOpenPcrWidget extends XHyperlinkLabel implements IArtifactWidge
}
protected String getCpaBasepath() {
- return OseeInfo.getCachedValue(CpaFactory.CPA_BASEPATH_KEY);
+ return AtsClientService.get().getConfigValue(CpaFactory.CPA_BASEPATH_KEY);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
index 75122990b4..1b96d0cdc7 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
@@ -92,6 +92,7 @@ public class ApplicationServerManager implements IApplicationServerManager {
dataStore = new ApplicationServerDataStore(getLogger(), getDatabaseService());
serverInfo = createOseeServerInfo(getLogger(), dataStore, defaultVersions);
+ System.setProperty("OseeApplicationServer", serverInfo.getUri().toString());
timer = new Timer();
timer.schedule(new TimerTask() {

Back to the top