REPO-2117: Deleted nodes pagination returns incorrect properties

- fix paging call (in API impl) & add a sanity test (to JUnit test suite)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137827 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2017-06-26 10:20:40 +00:00
parent d62104b859
commit b5d6a8696a
2 changed files with 22 additions and 4 deletions

View File

@@ -118,6 +118,9 @@ public class DeletedNodesImpl implements DeletedNodes
// Query the DB
PagingResults<NodeRef> result = nodeArchiveService.listArchivedNodes(queryBuilder);
Integer totalItems = result.getTotalResultCount().getFirst();
List<Node> nodesFound = new ArrayList<Node>(result.getPage().size());
Map mapUserInfo = new HashMap<>();
for (NodeRef nRef:result.getPage())
@@ -126,7 +129,8 @@ public class DeletedNodesImpl implements DeletedNodes
mapArchiveInfo(foundNode,mapUserInfo);
nodesFound.add(foundNode);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodesFound);
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodesFound, result.hasMoreItems(), (totalItems == null ? null : totalItems.intValue()));
}
@Override