aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2011-11-10 10:46:09 (EST)
committerMichael Fiedler2011-11-10 18:42:57 (EST)
commit44febb6cd14d26524078f705e470b8d363038817 (patch)
tree37fa88c44af18bbd589446f5ef112f8021438fa3
parentf3c23878654fa7f5719e9982fbd9bb537e577814 (diff)
downloadorg.eclipse.lyo.server-44febb6cd14d26524078f705e470b8d363038817.zip
org.eclipse.lyo.server-44febb6cd14d26524078f705e470b8d363038817.tar.gz
org.eclipse.lyo.server-44febb6cd14d26524078f705e470b8d363038817.tar.bz2
Bug 363485 - [Bugzilla] Fix query response resource type and URI
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java9
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResponse.java (renamed from org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java)6
2 files changed, 9 insertions, 6 deletions
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
index c36d269..f07d33f 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
@@ -41,7 +41,7 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.ExtendedBugSearch;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
import org.eclipse.lyo.samples.bugzilla.resources.BugzillaChangeRequest;
import org.eclipse.lyo.samples.bugzilla.resources.Person;
-import org.eclipse.lyo.samples.bugzilla.resources.QueryResult;
+import org.eclipse.lyo.samples.bugzilla.resources.QueryResponse;
import org.eclipse.lyo.samples.bugzilla.resources.ResponseInfo;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
import org.eclipse.lyo.samples.bugzilla.utils.RdfUtils;
@@ -202,8 +202,11 @@ public class ChangeRequestCollectionService extends HttpServlet {
responseInfo.setUri(new URI(request.getRequestURL().append('?')
.append(request.getQueryString()).toString()));
- QueryResult queryResult = new QueryResult();
- queryResult.setUri(new URI(request.getRequestURL().toString()));
+ QueryResponse queryResult = new QueryResponse();
+ // This must match the query capability base.
+ queryResult.setUri(new URI(request.getRequestURL()
+ .append("?productId=").append(product.getId())
+ .toString()));
for (Bug bug : results) {
BugzillaChangeRequest changeRequest = BugzillaChangeRequest.fromBug(bug);
queryResult.getMembers().add(changeRequest);
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResponse.java
index 85cdd02..61819d0 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResponse.java
@@ -29,9 +29,9 @@ import thewebsemantic.RdfType;
*
* @author Samuel Padgett <spadgett@us.ibm.com>
*/
-@Namespace("http://www.w3.org/2000/01/rdf-schema#")
-@RdfType("Description")
-public class QueryResult {
+@Namespace("http://www.bugzilla.org/rdf#")
+@RdfType("QueryResponse")
+public class QueryResponse {
@Id
private URI uri;