aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremah2013-04-01 11:57:11 (EDT)
committeremah2013-04-01 11:57:11 (EDT)
commit72ae833e81f26e5a1617e879cf5e6be9640ff30b (patch)
treebd194b7554937274c17e3ef250141fd6cbcd8432
parentb001624e3983bf2bf7145ca33a65c74408de1498 (diff)
downloadorg.eclipse.lyo.rio-72ae833e81f26e5a1617e879cf5e6be9640ff30b.zip
org.eclipse.lyo.rio-72ae833e81f26e5a1617e879cf5e6be9640ff30b.tar.gz
org.eclipse.lyo.rio-72ae833e81f26e5a1617e879cf5e6be9640ff30b.tar.bz2
Bug 404506 - Fix application/xml as a supported media type in the trsrefs/changes/84/11584/1
reference app Use the fine grained providers to add support for application/xml back. Also add text/turtle as a supported media type. Change-Id: I42cf1a007ac12eef8f2f9675ab8932c0d21b8e36 Signed-off-by: emah <ernest@ca.ibm.com>
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/BaseResource.java5
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/TRSResource.java8
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/webapp/WEB-INF/providers8
3 files changed, 16 insertions, 5 deletions
diff --git a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/BaseResource.java b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/BaseResource.java
index b78a93a..647f290 100644
--- a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/BaseResource.java
+++ b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/BaseResource.java
@@ -34,6 +34,7 @@ import org.apache.wink.common.annotations.Workspace;
import org.eclipse.lyo.core.trs.Base;
import org.eclipse.lyo.core.trs.TRSConstants;
import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
+import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
import org.eclipse.lyo.rio.trs.util.TRSUtil;
/**
@@ -72,7 +73,7 @@ public class BaseResource {
* paged Base resources of the Tracked Resource Set
*/
@GET
- @Produces({ "application/rdf+xml", MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.TEXT_TURTLE, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Base getBase() throws URISyntaxException{
URI requestURI = uriInfo.getRequestUri();
@@ -87,7 +88,7 @@ public class BaseResource {
*/
@GET
@Path("{page}")
- @Produces({ "application/rdf+xml", MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.TEXT_TURTLE, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Base getBasePage(@PathParam("page")Long page) throws URISyntaxException{
TRSUtil.updateTRSResourceURI(uriInfo.getBaseUri());
diff --git a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/TRSResource.java b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/TRSResource.java
index e9809ca..838eb35 100644
--- a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/TRSResource.java
+++ b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/resources/TRSResource.java
@@ -42,6 +42,7 @@ import org.eclipse.lyo.core.trs.EmptyChangeLog;
import org.eclipse.lyo.core.trs.TRSConstants;
import org.eclipse.lyo.core.trs.TrackedResourceSet;
import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
+import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
import org.eclipse.lyo.rio.trs.util.TRSUtil;
/**
@@ -80,8 +81,9 @@ public class TRSResource {
* page of the Change Log or EmptyChangeLog if no change logs pages exist
*/
@GET
- @Produces({ "application/rdf+xml", MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.TEXT_TURTLE, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public TrackedResourceSet getTrackedResourceSet() throws URISyntaxException{
+
// from uri find out which Inner container to access...
URI requestURI = uriInfo.getRequestUri();
@@ -106,7 +108,7 @@ public class TRSResource {
*/
@GET
@Path("changelog")
- @Produces({ "application/rdf+xml", MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.TEXT_TURTLE, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public AbstractChangeLog getChangeLog() throws URISyntaxException{
// from uri find out which Inner container to access...
URI requestURI = uriInfo.getRequestUri();
@@ -121,7 +123,7 @@ public class TRSResource {
*/
@GET
@Path("changelog/{page}")
- @Produces({ "application/rdf+xml", MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.TEXT_TURTLE, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public AbstractChangeLog getChangeLogPage(@PathParam("page") final Long page) throws URISyntaxException{
// from uri find out which Inner container to access...
URI requestURI = uriInfo.getRequestUri();
diff --git a/org.eclipse.lyo.rio.trs/src/main/webapp/WEB-INF/providers b/org.eclipse.lyo.rio.trs/src/main/webapp/WEB-INF/providers
index e117bc2..8f62715 100644
--- a/org.eclipse.lyo.rio.trs/src/main/webapp/WEB-INF/providers
+++ b/org.eclipse.lyo.rio.trs/src/main/webapp/WEB-INF/providers
@@ -10,6 +10,7 @@
# RDF/XML
org.eclipse.lyo.oslc4j.provider.jena.OslcRdfXmlProvider
+org.eclipse.lyo.oslc4j.provider.jena.OslcXmlProvider
org.eclipse.lyo.oslc4j.provider.jena.OslcCompactRdfProvider
org.eclipse.lyo.oslc4j.provider.jena.OslcSimpleRdfXmlArrayProvider
org.eclipse.lyo.oslc4j.provider.jena.OslcSimpleRdfXmlCollectionProvider
@@ -19,3 +20,10 @@ org.eclipse.lyo.oslc4j.provider.json4j.OslcCompactJsonProvider
org.eclipse.lyo.oslc4j.provider.json4j.OslcRdfJsonArrayProvider
org.eclipse.lyo.oslc4j.provider.json4j.OslcRdfJsonCollectionProvider
org.eclipse.lyo.oslc4j.provider.json4j.OslcRdfJsonProvider
+
+# Turtle
+org.eclipse.lyo.oslc4j.provider.jena.OslcTurtleProvider
+org.eclipse.lyo.oslc4j.provider.jena.OslcTurtleArrayProvider
+org.eclipse.lyo.oslc4j.provider.jena.OslcTurtleCollectionProvider
+org.eclipse.lyo.oslc4j.provider.jena.OslcSimpleTurtleArrayProvider
+org.eclipse.lyo.oslc4j.provider.jena.OslcSimpleTurtleCollectionProvider \ No newline at end of file