Resolve ALF-4935: CMIS query interface returns incorrect total result count

- cmis query modified to hit configured permission limits, but paging still adhered to (so, only the appropriate rows are sent across the wire)
- total count now reports the number of rows found before permission limits are hit

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22906 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-10-06 09:40:45 +00:00
parent dfd98a45fa
commit b625d34686
7 changed files with 57 additions and 25 deletions

View File

@@ -649,9 +649,8 @@ public class CMISScript extends BaseScopableProcessorExtension
CMISQueryOptions options = new CMISQueryOptions(statement, cmisService.getDefaultRootStoreRef());
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
options.setSkipCount(unknownRows.getStartRow());
options.setMaxItems(unknownRows.getPageSize());
CMISResultSet resultSet = cmisQueryService.query(options);
Cursor cursor = paging.createCursor(unknownRows.getStartRow() + resultSet.getLength() + (resultSet.hasMore() ? 1 : 0) , page);
Cursor cursor = paging.createCursor(unknownRows.getStartRow() + resultSet.getLength(), page);
return paging.createPagedResult(resultSet, cursor);
}