Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)

128479 jvonka: V1 REST API: Node Version History - add basic paging
   REPO-313


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129162 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Martin Muller
2016-08-05 13:46:26 +00:00
parent 5e6bc0ae99
commit 750adc141c
3 changed files with 86 additions and 32 deletions

View File

@@ -74,27 +74,15 @@ import java.util.Map;
* @author janv
*/
@RelationshipResource(name = "versions", entityResource = NodesEntityResource.class, title = "Node Versions")
public class NodeVersionsRelation implements
public class NodeVersionsRelation extends AbstractNodeRelation implements
RelationshipResourceAction.Read<Node>,
RelationshipResourceAction.ReadById<Node>,
RelationshipResourceBinaryAction.Read,
RelationshipResourceAction.Delete,
InitializingBean
{
protected ServiceRegistry sr;
protected Nodes nodes;
protected VersionService versionService;
public void setNodes(Nodes nodes)
{
this.nodes = nodes;
}
public void setServiceRegistry(ServiceRegistry sr)
{
this.sr = sr;
}
@Override
public void afterPropertiesSet()
{
@@ -118,8 +106,7 @@ public class NodeVersionsRelation implements
Map<String, UserInfo> mapUserInfo = new HashMap<>(10);
List<String> includeParam = parameters.getInclude();
// TODO fixme - add paging etc
List<Node> collection = null;
if (vh != null)
{
@@ -131,9 +118,8 @@ public class NodeVersionsRelation implements
collection.add(node);
}
}
Paging paging = parameters.getPaging();
return CollectionWithPagingInfo.asPaged(paging, collection, false, (collection != null ? collection.size() : 0));
return listPage(collection, parameters.getPaging());
}
private void mapVersionInfo(Version v, Node aNode)