aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2011-11-10 10:46:09 (EST)
committerMichael Fiedler2012-01-10 15:21:56 (EST)
commit594d0a46d82b64e4565eb8dc4f9ae5696ed3f895 (patch)
tree7a895a55a4d1fc2a1edf1d8d072b0fd9c0d84df8
parent4effec0b3987b23fd5a1ab9fc968841548cdf56e (diff)
downloadorg.eclipse.lyo.server-594d0a46d82b64e4565eb8dc4f9ae5696ed3f895.zip
org.eclipse.lyo.server-594d0a46d82b64e4565eb8dc4f9ae5696ed3f895.tar.gz
org.eclipse.lyo.server-594d0a46d82b64e4565eb8dc4f9ae5696ed3f895.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/QueryResult.java52
2 files changed, 6 insertions, 55 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 938d4da..8a9b141 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
@@ -39,7 +39,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;
@@ -194,8 +194,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/QueryResult.java
deleted file mode 100644
index 85cdd02..0000000
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
- *
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- *
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.lyo.samples.bugzilla.resources;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import thewebsemantic.Id;
-import thewebsemantic.Namespace;
-import thewebsemantic.RdfProperty;
-import thewebsemantic.RdfType;
-
-/**
- * An OSLC query response.
- *
- * @author Samuel Padgett <spadgett@us.ibm.com>
- */
-@Namespace("http://www.w3.org/2000/01/rdf-schema#")
-@RdfType("Description")
-public class QueryResult {
- @Id
- private URI uri;
-
- public URI getUri() {
- return uri;
- }
-
- public void setUri(URI uri) {
- this.uri = uri;
- }
-
- @RdfProperty("http://www.w3.org/2000/01/rdf-schema#member")
- private Collection<ChangeRequest> members = new ArrayList<ChangeRequest>();
-
- public Collection<ChangeRequest> getMembers() {
- return members;
- }
-}