Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-26 17:29:57 +0000
committerRyan D. Brooks2016-09-28 14:43:59 +0000
commit76179d008dac9d0d8fb8c6616a3d84ed2507ae59 (patch)
tree874b680f74c225539aab54aaf5cd909e643523b0
parent1ceeb372c42b969f151a909a329bc31645e901ea (diff)
downloadorg.eclipse.osee-76179d008dac9d0d8fb8c6616a3d84ed2507ae59.tar.gz
org.eclipse.osee-76179d008dac9d0d8fb8c6616a3d84ed2507ae59.tar.xz
org.eclipse.osee-76179d008dac9d0d8fb8c6616a3d84ed2507ae59.zip
feature[ats_ATS315180]: Improve WorldResource to show all customizations on get
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/world/WorldResource.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/world/WorldResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/world/WorldResource.java
index f720e757acd..8291c079637 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/world/WorldResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/world/WorldResource.java
@@ -45,7 +45,9 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
public class WorldResource {
private final IAtsServer atsServer;
- public final static String NAMESPACE = "org.eclipse.osee.ats.WorldXViewer";
+ public final static List<String> namespaces =
+ Arrays.asList("org.eclipse.osee.ats.WorldXViewer", "org.eclipse.osee.ats.BacklogXViewer",
+ "org.eclipse.osee.ats.SprintXViewer", "org.eclipse.osee.ats.GoalXViewer", "org.eclipse.osee.ats.TaskXViewer");
public WorldResource(IAtsServer atsServer) {
this.atsServer = atsServer;
@@ -53,24 +55,24 @@ public class WorldResource {
@GET
@Path("cust/global")
- @Produces(MediaType.TEXT_PLAIN)
- public String getCustomizationsGlobal() throws Exception {
- StringBuilder sb = new StringBuilder();
- for (CustomizeData customization : atsServer.getCustomizationsGlobal(NAMESPACE)) {
- sb.append(customization.toString() + "\n");
+ @Produces(MediaType.APPLICATION_JSON)
+ public Collection<CustomizeData> getCustomizationsGlobal() throws Exception {
+ List<CustomizeData> datas = new LinkedList<>();
+ for (String namespace : namespaces) {
+ datas.addAll(atsServer.getCustomizationsGlobal(namespace));
}
- return sb.toString();
+ return datas;
}
@GET
@Path("cust")
- @Produces(MediaType.TEXT_PLAIN)
- public String getCustomizations() throws Exception {
- StringBuilder sb = new StringBuilder();
- for (CustomizeData customization : atsServer.getCustomizations(NAMESPACE)) {
- sb.append(customization.toString() + "\n");
+ @Produces(MediaType.APPLICATION_JSON)
+ public Collection<CustomizeData> getCustomizations() throws Exception {
+ List<CustomizeData> datas = new LinkedList<>();
+ for (String namespace : namespaces) {
+ datas.addAll(atsServer.getCustomizations(namespace));
}
- return sb.toString();
+ return datas;
}
@GET

Back to the top