Anonymous avatar Anonymous committed 82d73a3

- added REST resource providing javadoc collector ID and feedback URL custom field ID

Comments (0)

Files changed (2)

src/main/java/com/atlassian/confluence/plugins/feedback/model/JavadocCollector.java

+package com.atlassian.confluence.plugins.feedback.model;
+
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class JavadocCollector {
+    
+    @JsonProperty private String collectorId;
+    @JsonProperty private String urlCustomFieldId;
+
+    @JsonCreator
+    public JavadocCollector(@JsonProperty String collectorId,
+                            @JsonProperty String urlCustomFieldId) {
+        this.collectorId = collectorId;
+        this.urlCustomFieldId = urlCustomFieldId;
+    }
+
+    public String getCollectorId() {
+        return collectorId;
+    }
+
+    public void setCollectorId(String collectorId) {
+        this.collectorId = collectorId;
+    }
+
+    public String getUrlCustomFieldId() {
+        return urlCustomFieldId;
+    }
+
+    public void setUrlCustomFieldId(String urlCustomFieldId) {
+        this.urlCustomFieldId = urlCustomFieldId;
+    }
+}

src/main/java/com/atlassian/confluence/plugins/feedback/rest/resources/IssueCollectorResource.java

+package com.atlassian.confluence.plugins.feedback.rest.resources;
+
+import com.atlassian.confluence.plugins.feedback.model.JavadocCollector;
+import com.atlassian.plugins.rest.common.security.AnonymousAllowed;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+/**
+ * Provides bootstrap info for the Javadoc collector.
+ */
+@Path("/collector")
+public class IssueCollectorResource {
+
+    private final JavadocCollector collector;
+
+    public IssueCollectorResource() {
+        // hardcoded for now; in the future, this may need to be a
+        // pluginsettings-backed operation with a CRUD form.
+        // Right now, YAGNI.
+        collector = new JavadocCollector("41244fd4", "customfield_10680");
+    }
+
+    @AnonymousAllowed
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response getCollectorProperties() {
+        return Response.ok(collector).build();
+    }
+
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.