diff --git a/source/java/org/alfresco/rest/framework/jacksonextensions/SerializerOfCollectionWithPaging.java b/source/java/org/alfresco/rest/framework/jacksonextensions/SerializerOfCollectionWithPaging.java index 26d6836243..a7f26b908d 100644 --- a/source/java/org/alfresco/rest/framework/jacksonextensions/SerializerOfCollectionWithPaging.java +++ b/source/java/org/alfresco/rest/framework/jacksonextensions/SerializerOfCollectionWithPaging.java @@ -2,6 +2,7 @@ package org.alfresco.rest.framework.jacksonextensions; import java.io.IOException; +import org.alfresco.rest.framework.resource.SerializablePagedCollection; import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo; import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper; import org.codehaus.jackson.JsonGenerationException; @@ -11,21 +12,21 @@ import org.codehaus.jackson.map.SerializerProvider; import org.codehaus.jackson.map.ser.std.SerializerBase; /** - * Serializes CollectionWithPagingInfo into the correct response format, with Paging information and entries// + * Serializes SerializablePagedCollection into the correct response format, with Paging information and entries * * @author Gethin James */ @SuppressWarnings("rawtypes") -public class SerializerOfCollectionWithPaging extends SerializerBase +public class SerializerOfCollectionWithPaging extends SerializerBase { protected SerializerOfCollectionWithPaging() { - super(CollectionWithPagingInfo.class); + super(SerializablePagedCollection.class); } @Override - public void serialize(CollectionWithPagingInfo pagedCol, JsonGenerator jgen, SerializerProvider provider) + public void serialize(SerializablePagedCollection pagedCol, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { if (pagedCol != null) @@ -40,7 +41,7 @@ public class SerializerOfCollectionWithPaging extends SerializerBase +{ + /** + * Returns the Collection object + * @return Collection + */ + Collection getCollection(); + + /** + * Indicates if the returned collection has more items after the current returned list. + */ + boolean hasMoreItems(); + + /** + * Indicates the total number of items available. + * + * Can be greater than the number of items returned in the list. + * + */ + Integer getTotalItems(); + + /** + * The requested paging parameters set by the client + */ + Paging getPaging(); +} diff --git a/source/java/org/alfresco/rest/framework/resource/parameters/CollectionWithPagingInfo.java b/source/java/org/alfresco/rest/framework/resource/parameters/CollectionWithPagingInfo.java index 059a129aa0..288c5d0a98 100644 --- a/source/java/org/alfresco/rest/framework/resource/parameters/CollectionWithPagingInfo.java +++ b/source/java/org/alfresco/rest/framework/resource/parameters/CollectionWithPagingInfo.java @@ -1,5 +1,7 @@ package org.alfresco.rest.framework.resource.parameters; +import org.alfresco.rest.framework.resource.SerializablePagedCollection; + import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -15,7 +17,7 @@ import java.util.Collections; * * @author Gethin James. */ -public class CollectionWithPagingInfo +public class CollectionWithPagingInfo implements SerializablePagedCollection { private final Collection collection; @@ -95,6 +97,7 @@ public class CollectionWithPagingInfo * Returns the Collection object * @return Collection */ + @Override public Collection getCollection() { return this.collection; @@ -103,6 +106,7 @@ public class CollectionWithPagingInfo /** * Indicates if the returned collection has more items after the current returned list. */ + @Override public boolean hasMoreItems() { return this.hasMoreItems; @@ -114,6 +118,7 @@ public class CollectionWithPagingInfo * Can be greater than the number of items returned in the list. * */ + @Override public Integer getTotalItems() { return this.totalItems; @@ -122,6 +127,7 @@ public class CollectionWithPagingInfo /** * The requested paging parameters set by the client */ + @Override public Paging getPaging() { return this.paging;