summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2017-12-15 14:25:13 -0500
committermegumi.telles2017-12-15 14:27:10 -0500
commit269f5c54032461638ee1a0850e998b8170c7c2b4 (patch)
treed8265d1a88a333f7765ff4cbe137928706504c57
parentdb465fb2a0944f937552c404eb16e2fa221c780c (diff)
downloadorg.eclipse.osee-269f5c54032461638ee1a0850e998b8170c7c2b4.tar.gz
org.eclipse.osee-269f5c54032461638ee1a0850e998b8170c7c2b4.tar.xz
org.eclipse.osee-269f5c54032461638ee1a0850e998b8170c7c2b4.zip
feature: Add getApplicabilityTokensForArts endpoint
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ViewApplicabilityColumn.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/ApplicabilityEndpoint.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ApplicabilityEndpointImpl.java12
3 files changed, 18 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ViewApplicabilityColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ViewApplicabilityColumn.java
index 22a24e8d83..42243ad1dc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ViewApplicabilityColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ViewApplicabilityColumn.java
@@ -82,7 +82,7 @@ public class ViewApplicabilityColumn extends XViewerColumn implements IXViewerPr
BranchId branch = artifacts.iterator().next().getBranch();
ApplicabilityEndpoint applEndpoint = ServiceUtil.getOseeClient().getApplicabilityEndpoint(branch);
List<Pair<ArtifactId, ApplicabilityToken>> applicabilities =
- applEndpoint.getApplicabilityTokensForArts(artifacts);
+ applEndpoint.getApplicabilityTokens(artifacts);
for (Pair<ArtifactId, ApplicabilityToken> pair : applicabilities) {
preComputedValueMap.put(pair.getFirst().getId(), pair.getSecond().getName());
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/ApplicabilityEndpoint.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/ApplicabilityEndpoint.java
index 51f738785d..cf3d5895a4 100644
--- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/ApplicabilityEndpoint.java
+++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/ApplicabilityEndpoint.java
@@ -95,10 +95,16 @@ public interface ApplicabilityEndpoint {
ApplicabilityToken getApplicabilityToken(@PathParam("artId") ArtifactId artId);
@PUT
+ @Path("artifacts")
@Consumes({MediaType.APPLICATION_JSON})
@Produces(MediaType.APPLICATION_JSON)
List<Pair<ArtifactId, ApplicabilityToken>> getApplicabilityTokensForArts(Collection<? extends ArtifactId> artIds);
+ @PUT
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces(MediaType.APPLICATION_JSON)
+ List<Pair<ArtifactId, ApplicabilityToken>> getApplicabilityTokens(Collection<? extends ArtifactId> artIds);
+
@GET
@Path("tokenMap")
@Produces({MediaType.APPLICATION_JSON})
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ApplicabilityEndpointImpl.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ApplicabilityEndpointImpl.java
index 23dfcf065f..adf486df53 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ApplicabilityEndpointImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ApplicabilityEndpointImpl.java
@@ -133,6 +133,15 @@ public class ApplicabilityEndpointImpl implements ApplicabilityEndpoint {
}
@Override
+ public List<Pair<ArtifactId, ApplicabilityToken>> getApplicabilityTokensForArts(Collection<? extends ArtifactId> artIds) {
+ List<Pair<ArtifactId, ApplicabilityToken>> artToApplicToken = new ArrayList<>();
+ for (ArtifactId artId : artIds) {
+ artToApplicToken.add(new Pair<ArtifactId, ApplicabilityToken>(artId, getApplicabilityToken(artId)));
+ }
+ return artToApplicToken;
+ }
+
+ @Override
public Collection<ApplicabilityToken> getApplicabilityTokenMap() {
return orcsApi.getQueryFactory().applicabilityQuery().getApplicabilityTokens(branch).values();
}
@@ -161,7 +170,7 @@ public class ApplicabilityEndpointImpl implements ApplicabilityEndpoint {
}
@Override
- public List<Pair<ArtifactId, ApplicabilityToken>> getApplicabilityTokensForArts(Collection<? extends ArtifactId> artIds) {
+ public List<Pair<ArtifactId, ApplicabilityToken>> getApplicabilityTokens(Collection<? extends ArtifactId> artIds) {
return orcsApi.getQueryFactory().applicabilityQuery().getApplicabilityTokens(artIds, branch);
}
@@ -285,4 +294,5 @@ public class ApplicabilityEndpointImpl implements ApplicabilityEndpoint {
return getAffectedBranches(timeInjectionMs, timeRemovalMs, applicabilityIds);
}
+
} \ No newline at end of file