aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2011-11-09 13:48:49 (EST)
committerMichael Fiedler2011-11-09 14:07:10 (EST)
commit11c1085024a5be561e181258c4f4decaf08eec3e (patch)
tree79343f0711da51c70982e5b3fd79d0a6de729ddc
parent169b836aa1716a647da3ae0b90310951461c39fa (diff)
downloadorg.eclipse.lyo.server-11c1085024a5be561e181258c4f4decaf08eec3e.zip
org.eclipse.lyo.server-11c1085024a5be561e181258c4f4decaf08eec3e.tar.gz
org.eclipse.lyo.server-11c1085024a5be561e181258c4f4decaf08eec3e.tar.bz2
Bug 363339 - Bugzilla adapter gives back invalid XML for query responses
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java99
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java30
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java52
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/ResponseInfo.java58
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/utils/RdfUtils.java91
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_rdfxml.jsp65
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_rdfxml.jsp57
7 files changed, 269 insertions, 183 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 edc78ac..a786bf3 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
@@ -17,8 +17,11 @@
package org.eclipse.lyo.samples.bugzilla;
import java.io.IOException;
+import java.net.URI;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -38,8 +41,12 @@ 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.ResponseInfo;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
+import org.eclipse.lyo.samples.bugzilla.utils.RdfUtils;
+import thewebsemantic.Bean2RDF;
import thewebsemantic.RDF2Bean;
import com.hp.hpl.jena.rdf.model.Model;
@@ -51,7 +58,15 @@ import com.hp.hpl.jena.rdf.model.ModelFactory;
*/
public class ChangeRequestCollectionService extends HttpServlet {
private static final long serialVersionUID = -5280734755943517104L;
-
+ private static final Map<String, String> PREFIXES = new HashMap<String, String>();
+ static {
+ PREFIXES.put("oslc", "http://open-services.net/ns/core#");
+ PREFIXES.put("oslc_cm", "http://open-services.net/ns/cm#");
+ PREFIXES.put("dcterms", "http://purl.org/dc/terms/");
+ PREFIXES.put("foaf", "http://xmlns.com/foaf/0.1/");
+ PREFIXES.put("bugz", "http://www.bugzilla.org/rdf#");
+ }
+
public ChangeRequestCollectionService() {}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
@@ -139,17 +154,7 @@ public class ChangeRequestCollectionService extends HttpServlet {
}
try {
- final String dispatchTo;
- if (AcceptType.willAccept("text/html", request) && BugzillaInitializer.isProvideHtml()) {
- dispatchTo = "/cm/changerequest_collection_html.jsp";
-
- } else if (AcceptType.willAccept("application/rdf+xml", request)) {
- dispatchTo = "/cm/changerequest_collection_rdfxml.jsp";
-
- } else {
- response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
- return;
- }
+
BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(request);
ExtendedBugSearch bugSearch = new ExtendedBugSearch(
@@ -161,33 +166,59 @@ public class ChangeRequestCollectionService extends HttpServlet {
bugSearch.addQueryParam(ExtendedBugSearch.ExtendedSearchLimiter.OFFSET, (page * limit) + "");
bc.executeMethod(bugSearch);
List<Bug> results = bugSearch.getSearchResults();
- request.setAttribute("results", results);
- request.setAttribute("product", product);
- request.setAttribute("bugzillaUri", BugzillaInitializer.getBugzillaUri());
- request.setAttribute("queryUri",
- URLStrategy.getChangeRequestCollectionURL(product.getId())
- + "&oslc.paging=true");
-
- if (results.size() > limit) {
- results.remove(results.size() - 1); // remove that one extra bug
- request.setAttribute("nextPageUri",
- URLStrategy.getChangeRequestCollectionURL(product.getId())
- + "&amp;oslc.paging=true&amp;page=" + (page + 1));
- }
-
- for (Bug bug : results) {
- bug.getInternalState().put("oslc_uri", URLStrategy.getChangeRequestURL(bug.getID()));
- }
response.setHeader("OSLC-Core-Version", "2.0");
- final RequestDispatcher rd = request.getRequestDispatcher(dispatchTo);
- rd.forward(request, response);
- response.flushBuffer();
-
+
+ if (AcceptType.willAccept("text/html", request) && BugzillaInitializer.isProvideHtml()) {
+ request.setAttribute("results", results);
+
+ request.setAttribute("product", product);
+ request.setAttribute("bugzillaUri", BugzillaInitializer.getBugzillaUri());
+ request.setAttribute("queryUri",
+ URLStrategy.getChangeRequestCollectionURL(product.getId())
+ + "&oslc.paging=true");
+
+ if (results.size() > limit) {
+ results.remove(results.size() - 1); // remove that one extra bug
+ request.setAttribute("nextPageUri",
+ URLStrategy.getChangeRequestCollectionURL(product.getId())
+ + "&amp;oslc.paging=true&amp;page=" + (page + 1));
+ }
+
+ for (Bug bug : results) {
+ bug.getInternalState().put("oslc_uri", URLStrategy.getChangeRequestURL(bug.getID()));
+ }
+
+ final RequestDispatcher rd = request.getRequestDispatcher("/cm/changerequest_collection_html.jsp");
+ rd.forward(request, response);
+ response.flushBuffer();
+ } else if (AcceptType.willAccept("application/rdf+xml", request)) {
+ ResponseInfo responseInfo = new ResponseInfo();
+ responseInfo.setTitle("Bugzilla Query Result");
+ responseInfo.setNextPage(new URI(URLStrategy
+ .getChangeRequestCollectionURL(product.getId())
+ + "&oslc.paging=true&page=" + (page + 1)));
+ responseInfo.setUri(new URI(request.getRequestURL().append(request.getQueryString()).toString()));
+
+ QueryResult queryResult = new QueryResult();
+ queryResult.setUri(new URI(request.getRequestURL().toString()));
+ for (Bug bug : results) {
+ BugzillaChangeRequest changeRequest = BugzillaChangeRequest.fromBug(bug);
+ queryResult.getMembers().add(changeRequest);
+ }
+
+ Model m = RdfUtils.createModel();
+ Bean2RDF writer = new Bean2RDF(m);
+ writer.save(responseInfo);
+ writer.save(queryResult);
+ response.setHeader("Content-Type", "application/rdf+xml");
+ RdfUtils.writeModel(response, m, RdfUtils.JENA_LANG_ABBREVIATED_RDF_XML);
+ } else {
+ response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
+ }
} catch (Throwable e) {
throw new ServletException(e);
}
}
}
- \ No newline at end of file
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
index e4cde1a..1388b65 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
@@ -40,13 +40,12 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.ExtendedGetBug;
import org.eclipse.lyo.samples.bugzilla.resources.BugzillaChangeRequest;
import org.eclipse.lyo.samples.bugzilla.resources.Person;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
+import org.eclipse.lyo.samples.bugzilla.utils.RdfUtils;
-import thewebsemantic.Bean2RDF;
import thewebsemantic.RDF2Bean;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
-import com.hp.hpl.jena.vocabulary.RDF;
/**
@@ -114,13 +113,13 @@ public class ChangeRequestService extends HttpServlet {
} else if (AcceptType.willAccept("application/rdf+xml", request)) {
response.setHeader("OSLC-Core-Version", "2.0");
response.setHeader("Content-Type", "application/rdf+xml");
- sendRdfResponse(response, bug, "RDF/XML");
+ RdfUtils.sendRdfResponse(response, bug, RdfUtils.JENA_LANG_ABBREVIATED_RDF_XML);
return;
} else if (AcceptType.willAccept("text/turtle", request)) {
response.setHeader("OSLC-Core-Version", "2.0");
response.setHeader("Content-Type", "text/turtle");
- sendRdfResponse(response, bug, "TURTLE");
+ RdfUtils.sendRdfResponse(response, bug, RdfUtils.JENA_LANG_TURTLE);
return;
} else {
@@ -142,29 +141,6 @@ public class ChangeRequestService extends HttpServlet {
}
}
- private void sendRdfResponse(HttpServletResponse response, Bug bug,
- String lang) throws URISyntaxException, IOException {
- Model m = ModelFactory.createDefaultModel();
- m.setNsPrefixes(PREFIXES);
- Bean2RDF writer = new Bean2RDF(m);
- writer.save(BugzillaChangeRequest.fromBug(bug));
- removeUnnecessaryStatements(m);
- m.write(response.getOutputStream(), lang);
- response.flushBuffer();
- }
-
- /**
- * Remove some extra stuff Jenabean puts in the model that we don't want.
- *
- * @param model
- * the model
- */
- private void removeUnnecessaryStatements(Model model) {
- model.removeAll(model.createResource("http://thewebsemantic.com/javaclass"), null, null);
- model.removeAll(null, model.createProperty("http://thewebsemantic.com/javaclass"), null);
- model.removeAll(null, RDF.type, model.createResource("http://www.w3.org/2000/01/rdf-schema#Class"));
- }
-
protected void doPut(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.err.println("CR.doPUT - Accept: " + request.getHeader("Accept")
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
new file mode 100644
index 0000000..85cdd02
--- /dev/null
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/QueryResult.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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;
+ }
+}
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/ResponseInfo.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/ResponseInfo.java
new file mode 100644
index 0000000..29ebc9c
--- /dev/null
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/ResponseInfo.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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 thewebsemantic.Id;
+import thewebsemantic.Namespace;
+
+/**
+ * Encapsulates information about an OSLC query response.
+ *
+ * @author Samuel Padgett <spadgett@us.ibm.com>
+ */
+@Namespace("http://open-services.net/ns/core#")
+public class ResponseInfo extends OslcResource {
+ @Id
+ private URI uri;
+ private Integer totalCount;
+ private URI nextPage;
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public Integer getTotalCount() {
+ return totalCount;
+ }
+
+ public void setTotalCount(Integer totalCount) {
+ this.totalCount = totalCount;
+ }
+
+ public URI getNextPage() {
+ return nextPage;
+ }
+
+ public void setNextPage(URI nextPage) {
+ this.nextPage = nextPage;
+ }
+}
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/utils/RdfUtils.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/utils/RdfUtils.java
new file mode 100644
index 0000000..b810c33
--- /dev/null
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/utils/RdfUtils.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.utils;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import jbugz.base.Bug;
+
+import org.eclipse.lyo.samples.bugzilla.resources.BugzillaChangeRequest;
+
+import thewebsemantic.Bean2RDF;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.vocabulary.RDF;
+
+/**
+ * Utilities for working with RDF.
+ *
+ * @author Samuel Padgett <spadgett@us.ibm.com>
+ */
+public class RdfUtils {
+ private static final Map<String, String> PREFIXES = new HashMap<String, String>();
+ static {
+ PREFIXES.put("oslc", "http://open-services.net/ns/core#");
+ PREFIXES.put("oslc_cm", "http://open-services.net/ns/cm#");
+ PREFIXES.put("dcterms", "http://purl.org/dc/terms/");
+ PREFIXES.put("foaf", "http://xmlns.com/foaf/0.1/");
+ PREFIXES.put("bugz", "http://www.bugzilla.org/rdf#");
+ }
+
+ public static final String JENA_LANG_RDF_XML = "RDF/XML";
+ public static final String JENA_LANG_TURTLE = "TURTLE";
+ public static final String JENA_LANG_ABBREVIATED_RDF_XML = "RDF/XML-ABBREV";
+
+ public static Model createModel() {
+ Model m = ModelFactory.createDefaultModel();
+ m.setNsPrefixes(PREFIXES);
+ return m;
+ }
+
+ public static void writeModel(HttpServletResponse response, Model model, String lang)
+ throws IOException {
+ removeUnnecessaryStatements(model);
+ model.write(response.getOutputStream(), lang);
+ response.flushBuffer();
+ }
+
+ public static void sendRdfResponse(HttpServletResponse response, Bug bug,
+ String lang) throws URISyntaxException, IOException {
+ Model m = createModel();
+ Bean2RDF writer = new Bean2RDF(m);
+ writer.save(BugzillaChangeRequest.fromBug(bug));
+ writeModel(response, m, lang);
+ }
+
+ /**
+ * Remove some extra stuff Jenabean puts in the model that we don't want.
+ *
+ * @param model
+ * the model
+ */
+ public static void removeUnnecessaryStatements(Model model) {
+ model.removeAll(
+ model.createResource("http://thewebsemantic.com/javaclass"),
+ null, null);
+ model.removeAll(null,
+ model.createProperty("http://thewebsemantic.com/javaclass"),
+ null);
+ model.removeAll(null, RDF.type, model
+ .createResource("http://www.w3.org/2000/01/rdf-schema#Class"));
+ }
+}
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_rdfxml.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_rdfxml.jsp
deleted file mode 100644
index 4ab7600..0000000
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_rdfxml.jsp
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<%--
- 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
---%>
-<%@ page contentType="application/rdf+xml" language="java" %>
-<%@ page import="jbugz.base.Bug" %>
-<%@ page import="java.util.List" %>
-<%
- List<Bug> bugs = (List<Bug>)request.getAttribute("results");
- String queryUri = (String)request.getAttribute("queryUri");
- String nextPageUri = (String)request.getAttribute("nextPageUri");
-%>
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
- xmlns:dcterms="http://purl.org/dc/terms/"
- xmlns:foaf="http://http://xmlns.com/foaf/0.1/"
- xmlns:oslc="http://open-services.net/ns/core#"
- xmlns:oslc_cm="http://open-services.net/ns/cm#"
- xmlns:bugz="http://www.bugzilla.org/rdf#"
- >
-
- <oslc:ResponseInfo rdf:about="<%= queryUri %>">
- <dcterms:title>Query Results</dcterms:title>
- <% if (nextPageUri != null) { %><oslc:nextPage><%= nextPageUri %></oslc:nextPage><% } %>
- </oslc:ResponseInfo>
-
- <bugz:QueryResponse rdf:about="<%= queryUri %>">
-
- <% for (Bug bug : bugs) { %>
- <rdfs:member>
- <oslc_cm:ChangeRequest rdf:about="<%= bug.getInternalState().get("oslc_uri") %>">
- <rdf:type rdf:resource="http://open-services.net/ns/cm#ChangeRequest" />
- <dcterms:title><%= bug.getSummary() %></dcterms:title>
- <dcterms:identifier><%= bug.getID() %></dcterms:identifier>
- <dcterms:contributor>
- <foaf:Person>
- <foaf:name><%= bug.getInternalState().get("assigned_to") %></foaf:name>
- </foaf:Person>
- </dcterms:contributor>
- <oslc_cm:status><%= bug.getStatus() %></oslc_cm:status>
- <dcterms:modified><%= bug.getInternalState().get("last_change_time") %></dcterms:modified>
- <dcterms:created><%= bug.getInternalState().get("creation_time") %></dcterms:created>
- <bugz:product><%= bug.getProduct() %></bugz:product>
- <bugz:component><%= bug.getComponent() %></bugz:component>
- </oslc_cm:ChangeRequest>
- </rdfs:member>
- <% } %>
-
- </bugz:QueryResponse>
-
-</rdf:RDF>
-
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_rdfxml.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_rdfxml.jsp
deleted file mode 100644
index f29dc6c..0000000
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_rdfxml.jsp
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<%--
- 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
---%>
-<%@ page contentType="application/x-oslc-compact+xml" language="java"%>
-<%@ page import="jbugz.base.Bug" %>
-<%
- Bug bug = (Bug) request.getAttribute("bug");
- String bugUri = (String) request.getAttribute("bugUri");
-%>
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:dcterms="http://purl.org/dc/terms/"
- xmlns:oslc="http://open-services.net/ns/core#"
- xmlns:oslc_cm="http://open-services.net/ns/cm#"
- xmlns:bugz="http://www.bugzilla.org/rdf#"
- xmlns:foaf="http://http://xmlns.com/foaf/0.1/">
-
- <oslc_cm:ChangeRequest rdf:about="<%= bugUri %>">
- <rdf:type rdf:resource="http://open-services.net/ns/cm#ChangeRequest" />
-
- <dcterms:title><%= bug.getSummary() %></dcterms:title>
- <dcterms:identifier><%= bug.getID() %></dcterms:identifier>
- <dcterms:contributor>
- <foaf:Person>
- <foaf:name><%= bug.getInternalState().get("assigned_to") %></foaf:name>
- </foaf:Person>
- </dcterms:contributor>
-
- <oslc_cm:status><%= bug.getStatus() %></oslc_cm:status>
-
- <dcterms:modified><%= bug.getInternalState().get("last_change_time") %></dcterms:modified>
- <dcterms:created><%= bug.getInternalState().get("creation_time") %></dcterms:created>
-
- <bugz:product><%= bug.getProduct() %></bugz:product>
- <bugz:component><%= bug.getComponent() %></bugz:component>
- <bugz:version><%= bug.getVersion() %></bugz:version>
- <bugz:priority><%= bug.getPriority().name() %></bugz:priority>
-<%-- <bugz:platform><%= bug.getPlatform() %></bugz:platform>
- <bugz:opsys><%= bug.getOpsys() %></bugz:opsys>
- --%>
- </oslc_cm:ChangeRequest>
-
-</rdf:RDF>
-