aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsaad2013-07-25 10:48:38 (EDT)
committerSamuel Padgett2013-07-25 11:31:12 (EDT)
commit6ebd1eae5ae2cb23f7749a9a3bb067dd826bee50 (patch)
tree998598417f7ea146d8b56274952e33809ac6530f
parent94c6881de4abf3de9acd9c277467077fd91c0b35 (diff)
downloadorg.eclipse.lyo.core-6ebd1eae5ae2cb23f7749a9a3bb067dd826bee50.zip
org.eclipse.lyo.core-6ebd1eae5ae2cb23f7749a9a3bb067dd826bee50.tar.gz
org.eclipse.lyo.core-6ebd1eae5ae2cb23f7749a9a3bb067dd826bee50.tar.bz2
Adds extended properties to response info class and totalCount to Json outputs. Conflicts: org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java Change-Id: Iff5328d60607c58b28005988323109aaaec78ded Signed-off-by: csaad <csaad@br.ibm.com> Also-by: Samuel Padgett <spadgett@us.ibm.com>
-rw-r--r--org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/FilteredResource.java4
-rw-r--r--org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfo.java10
-rw-r--r--org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoArray.java6
-rw-r--r--org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoCollection.java6
-rw-r--r--org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java13
-rw-r--r--org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java36
-rw-r--r--org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java9
-rw-r--r--org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java1
-rw-r--r--org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java1
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java16
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java57
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java11
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java3
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java3
14 files changed, 99 insertions, 77 deletions
diff --git a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/FilteredResource.java b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/FilteredResource.java
index 3bd11ab..ad4b4aa 100644
--- a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/FilteredResource.java
+++ b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/FilteredResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -22,7 +22,7 @@ import java.util.Map;
* Wrapper for resources to pass in properties map to filter output
* to a subset of the resource's properties
*/
-public class FilteredResource<T extends Object>
+public class FilteredResource<T extends Object> extends AbstractResource
{
public
FilteredResource(
diff --git a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfo.java b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfo.java
index 80a282f..b6a3ff8 100644
--- a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfo.java
+++ b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -30,7 +30,7 @@ public abstract class ResponseInfo<T extends Object>
ResponseInfo(
T resource,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
String nextPage
)
{
@@ -44,7 +44,7 @@ public abstract class ResponseInfo<T extends Object>
ResponseInfo(
T resource,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
URI nextPage
)
{
@@ -52,12 +52,12 @@ public abstract class ResponseInfo<T extends Object>
nextPage == null ? null : nextPage.toString());
}
- public int
+ public Integer
totalCount() { return totalCount; }
public String
nextPage() { return nextPage; }
- private final int totalCount;
+ private final Integer totalCount;
private final String nextPage;
}
diff --git a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoArray.java b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoArray.java
index c98cf36..c848bc2 100644
--- a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoArray.java
+++ b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoArray.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -29,7 +29,7 @@ public class ResponseInfoArray<T extends Object> extends ResponseInfo<T[]>
ResponseInfoArray(
T[] array,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
String nextPage
)
{
@@ -40,7 +40,7 @@ public class ResponseInfoArray<T extends Object> extends ResponseInfo<T[]>
ResponseInfoArray(
T[] array,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
URI nextPage
)
{
diff --git a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoCollection.java b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoCollection.java
index 302d92d..4bb5216 100644
--- a/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoCollection.java
+++ b/org.eclipse.lyo.oslc4j.core/src/org/eclipse/lyo/oslc4j/core/model/ResponseInfoCollection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -30,7 +30,7 @@ public class ResponseInfoCollection<T extends Object> extends ResponseInfo<Colle
ResponseInfoCollection(
Collection<T> collection,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
String nextPage
)
{
@@ -41,7 +41,7 @@ public class ResponseInfoCollection<T extends Object> extends ResponseInfo<Colle
ResponseInfoCollection(
Collection<T> collection,
Map<String, Object> properties,
- int totalCount,
+ Integer totalCount,
URI nextPage
)
{
diff --git a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java
index a0c4084..d4ea137 100644
--- a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java
@@ -41,6 +41,8 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcNotQueryResult;
import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape;
import org.eclipse.lyo.oslc4j.core.model.Error;
import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfo;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfoArray;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
@@ -130,8 +132,7 @@ public abstract class AbstractOslcRdfXmlProvider
final Map<String, Object> properties,
final String descriptionURI,
final String responseInfoURI,
- final String nextPageURI,
- final Integer totalCount)
+ final ResponseInfo<?> responseInfo)
throws WebApplicationException
{
final String serializationLanguage = getSerializationLanguage(baseMediaType);
@@ -140,8 +141,7 @@ public abstract class AbstractOslcRdfXmlProvider
{
final Model model = JenaModelHelper.createJenaModel(descriptionURI,
responseInfoURI,
- nextPageURI,
- totalCount,
+ responseInfo,
objects,
properties);
RDFWriter writer = null;
@@ -226,12 +226,13 @@ public abstract class AbstractOslcRdfXmlProvider
null :
(Integer)httpServletRequest.getAttribute(OSLC4JConstants.OSLC4J_TOTAL_COUNT);
+ ResponseInfo<?> responseInfo = new ResponseInfoArray<Object>(null, properties, totalCount, nextPageURI);
+
try
{
final Model model = JenaModelHelper.createJenaModel(descriptionURI,
responseInfoURI,
- nextPageURI,
- totalCount,
+ responseInfo,
objects,
properties);
RDFWriter writer = null;
diff --git a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java
index fa431f6..12beb2e 100644
--- a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java
+++ b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java
@@ -84,6 +84,7 @@ import org.eclipse.lyo.oslc4j.core.model.IReifiedResource;
import org.eclipse.lyo.oslc4j.core.model.IResource;
import org.eclipse.lyo.oslc4j.core.model.InheritedMethodAnnotationHelper;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfo;
import org.eclipse.lyo.oslc4j.core.model.TypeFactory;
import org.eclipse.lyo.oslc4j.core.model.ValueType;
import org.eclipse.lyo.oslc4j.core.model.XMLLiteral;
@@ -148,8 +149,7 @@ public final class JenaModelHelper
OslcCoreApplicationException
{
return createJenaModel(null,
- null,
- null,
+ null,
null,
objects,
null);
@@ -157,8 +157,7 @@ public final class JenaModelHelper
static Model createJenaModel(final String descriptionAbout,
final String responseInfoAbout,
- final String nextPageAbout,
- final Integer totalCount,
+ final ResponseInfo<?> responseInfo,
final Object[] objects,
final Map<String, Object> properties)
throws DatatypeConfigurationException,
@@ -171,7 +170,7 @@ public final class JenaModelHelper
final Map<String, String> namespaceMappings = new HashMap<String, String>();
Resource descriptionResource = null;
-
+
if (descriptionAbout != null)
{
descriptionResource = model.createResource(descriptionAbout);
@@ -181,15 +180,26 @@ public final class JenaModelHelper
final Resource responseInfoResource = model.createResource(responseInfoAbout,
model.createProperty(OslcConstants.TYPE_RESPONSE_INFO));
- responseInfoResource.addProperty(model.createProperty(OslcConstants.OSLC_CORE_NAMESPACE,
- PROPERTY_TOTAL_COUNT),
- String.valueOf(totalCount == null ? objects.length : totalCount));
-
- if (nextPageAbout != null)
+ if (responseInfo != null)
{
- responseInfoResource.addProperty(model.createProperty(OslcConstants.OSLC_CORE_NAMESPACE,
- PROPERTY_NEXT_PAGE),
- model.createResource(nextPageAbout));
+ responseInfoResource.addProperty(model.createProperty(OslcConstants.OSLC_CORE_NAMESPACE,
+ PROPERTY_TOTAL_COUNT),
+ String.valueOf(responseInfo.totalCount() == null ? objects.length : responseInfo.totalCount()));
+
+ if (responseInfo.nextPage() != null)
+ {
+ responseInfoResource.addProperty(model.createProperty(OslcConstants.OSLC_CORE_NAMESPACE,
+ PROPERTY_NEXT_PAGE),
+ model.createResource(responseInfo.nextPage()));
+ }
+
+ Map<IExtendedResource,Resource> visitedResources = new HashMap<IExtendedResource,Resource>();
+ handleExtendedProperties(ResponseInfo.class,
+ model,
+ responseInfoResource,
+ (IExtendedResource) responseInfo,
+ properties,
+ visitedResources);
}
}
}
diff --git a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java
index cc20595..67f2fd6 100644
--- a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java
@@ -152,8 +152,7 @@ public class OslcRdfXmlProvider
Map<String, Object> properties = null;
String descriptionURI = null;
String responseInfoURI = null;
- String nextPageURI = null;
- Integer totalCount = null;
+ ResponseInfo<?> responseInfo = null;
if (object instanceof FilteredResource<?>)
{
@@ -187,8 +186,7 @@ public class OslcRdfXmlProvider
objects = collection.toArray(new Object[collection.size()]);
}
- nextPageURI = ((ResponseInfo<?>)filteredResource).nextPage();
- totalCount = ((ResponseInfo<?>)filteredResource).totalCount();
+ responseInfo = (ResponseInfo<?>)filteredResource;
}
else
{
@@ -220,8 +218,7 @@ public class OslcRdfXmlProvider
properties,
descriptionURI,
responseInfoURI,
- nextPageURI,
- totalCount);
+ responseInfo);
}
@Override
diff --git a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java
index b24267e..e47ece0 100644
--- a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java
@@ -61,7 +61,6 @@ public class OslcSimpleRdfXmlArrayProvider
null,
null,
null,
- null,
null);
}
} \ No newline at end of file
diff --git a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java
index a7e0f6a..c0bbed6 100644
--- a/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.jena/src/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java
@@ -62,7 +62,6 @@ public class OslcSimpleRdfXmlCollectionProvider
null,
null,
null,
- null,
null);
}
} \ No newline at end of file
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java
index b0d4f5b..b83d837 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -40,6 +40,8 @@ import org.eclipse.lyo.oslc4j.core.OSLC4JConstants;
import org.eclipse.lyo.oslc4j.core.OSLC4JUtils;
import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape;
import org.eclipse.lyo.oslc4j.core.model.Error;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfo;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfoArray;
public abstract class AbstractOslcRdfJsonProvider
{
@@ -139,12 +141,17 @@ public abstract class AbstractOslcRdfJsonProvider
final String nextPageURI = isClientSide ?
null :
(String)httpServletRequest.getAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE);
+ final Integer totalCount = isClientSide ?
+ null :
+ (Integer)httpServletRequest.getAttribute(OSLC4JConstants.OSLC4J_TOTAL_COUNT);
+
+ ResponseInfo<?> responseInfo = new ResponseInfoArray<Object>(null, properties, totalCount, nextPageURI);
try
{
jsonObject = JsonHelper.createJSON(descriptionURI,
responseInfoURI,
- nextPageURI,
+ responseInfo,
objects,
properties);
@@ -167,8 +174,7 @@ public abstract class AbstractOslcRdfJsonProvider
final Map<String, Object> properties,
final String descriptionURI,
final String responseInfoURI,
- final String nextPageURI,
- final Integer totalCount)
+ final ResponseInfo<?> responseInfo)
throws WebApplicationException
{
final JSONObject jsonObject;
@@ -177,7 +183,7 @@ public abstract class AbstractOslcRdfJsonProvider
{
jsonObject = JsonHelper.createJSON(descriptionURI,
responseInfoURI,
- nextPageURI,
+ responseInfo,
objects,
properties);
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
index 93f29b8..f8ddce8 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
@@ -81,6 +81,7 @@ import org.eclipse.lyo.oslc4j.core.model.IReifiedResource;
import org.eclipse.lyo.oslc4j.core.model.IResource;
import org.eclipse.lyo.oslc4j.core.model.InheritedMethodAnnotationHelper;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
+import org.eclipse.lyo.oslc4j.core.model.ResponseInfo;
import org.eclipse.lyo.oslc4j.core.model.TypeFactory;
import org.eclipse.lyo.oslc4j.core.model.XMLLiteral;
@@ -147,7 +148,7 @@ public final class JsonHelper
public static JSONObject createJSON(final String descriptionAbout,
final String responseInfoAbout,
- final String nextPageAbout,
+ final ResponseInfo<?> responseInfo,
final Object[] objects,
final Map<String, Object> properties)
throws DatatypeConfigurationException,
@@ -213,29 +214,43 @@ public final class JsonHelper
responseInfoJSONObject.put(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_ABOUT,
responseInfoAbout);
- responseInfoJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_TOTAL_COUNT,
- objects.length);
+
- if (nextPageAbout != null)
+ if (responseInfo != null)
{
- responseInfoJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_NEXT_PAGE,
- nextPageAbout);
+
+ responseInfoJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_TOTAL_COUNT,
+ responseInfo.totalCount() == null ? objects.length : responseInfo.totalCount());
+
+ if (responseInfo.nextPage() != null)
+ {
+ responseInfoJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_NEXT_PAGE,
+ responseInfo.nextPage());
+ }
+
+ final JSONArray responseInfoTypesJSONArray = new JSONArray();
+
+ final JSONObject responseInfoTypeJSONObject = new JSONObject();
+
+ responseInfoTypeJSONObject.put(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_RESOURCE,
+ OslcConstants.TYPE_RESPONSE_INFO);
+
+ responseInfoTypesJSONArray.add(responseInfoTypeJSONObject);
+
+ responseInfoJSONObject.put(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_TYPE,
+ responseInfoTypesJSONArray);
+
+ resultJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_RESPONSE_INFO,
+ responseInfoJSONObject);
+
+ Map<Object,JSONObject> visitedObjects = new HashMap<Object,JSONObject>();
+ addExtendedProperties(namespaceMappings,
+ reverseNamespaceMappings,
+ responseInfoJSONObject,
+ (IExtendedResource) responseInfo,
+ properties,
+ visitedObjects);
}
-
- final JSONArray responseInfoTypesJSONArray = new JSONArray();
-
- final JSONObject responseInfoTypeJSONObject = new JSONObject();
-
- responseInfoTypeJSONObject.put(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_RESOURCE,
- OslcConstants.TYPE_RESPONSE_INFO);
-
- responseInfoTypesJSONArray.add(responseInfoTypeJSONObject);
-
- responseInfoJSONObject.put(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_TYPE,
- responseInfoTypesJSONArray);
-
- resultJSONObject.put(oslcPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_RESPONSE_INFO,
- responseInfoJSONObject);
}
}
else if (objects.length == 1)
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java
index 46b6813..5e045a7 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -149,8 +149,7 @@ public final class OslcRdfJsonProvider
Map<String, Object> properties = null;
String descriptionURI = null;
String responseInfoURI = null;
- String nextPageURI = null;
- Integer totalCount = null;
+ ResponseInfo<?> responseInfo = null;
if (object instanceof FilteredResource<?>)
{
@@ -184,8 +183,7 @@ public final class OslcRdfJsonProvider
objects = collection.toArray(new Object[collection.size()]);
}
- nextPageURI = ((ResponseInfo<?>)filteredResource).nextPage();
- totalCount = ((ResponseInfo<?>)filteredResource).totalCount();
+ responseInfo = (ResponseInfo<?>)filteredResource;
}
else
{
@@ -217,8 +215,7 @@ public final class OslcRdfJsonProvider
properties,
descriptionURI,
responseInfoURI,
- nextPageURI,
- totalCount);
+ responseInfo);
}
@Override
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java
index fddc457..63be0ee 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -64,7 +64,6 @@ public final class OslcSimpleRdfJsonArrayProvider
null,
null,
null,
- null,
null);
}
} \ No newline at end of file
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java
index 21cafde..19f722a 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2013 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -80,7 +80,6 @@ public final class OslcSimpleRdfJsonCollectionProvider
null,
null,
null,
- null,
null);
}
} \ No newline at end of file