RM-2466 Pass through total results count as if nothing is filtered.

Change PagingResultsPostMethodInvocationProcessor to always return the
total results count as if nothing is filtered. This should fix the case
where nothing is filtered, and is a concession to the fact that we cannot
know how many total results there will be from a single page. We will fix
this later by filtering the results before we get to this processor, but
the processor is a good backup filter.

Change the rm-automation tests not to use the pagination details at the
bottom of the browse list pages, as these will often now be incorrect.

In making this change I also looked at using the getTotalResultCount()
interface with a range as the interface supports returning a minimum and
maximum on the total number of results. This would be very useful here,
as it should allow us to say that we don't know how many results there
will be.  However most of the webscripts don't support a range, and so
this leads to some odd results in Share (e.g. 'Showing results 1 to 50
of -1').

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@108482 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-07-17 09:01:00 +00:00
parent 1121127ed2
commit 703fcbef77

View File

@@ -18,8 +18,6 @@
*/
package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor;
import static org.apache.commons.collections.ListUtils.isEqualList;
import java.util.List;
import org.alfresco.query.PagingResults;
@@ -60,8 +58,6 @@ public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodIn
List page = pagingResults.getPage();
final List processedPage = getPostMethodInvocationProcessor().process(page);
if (!isEqualList(page, processedPage))
{
result = (T) new PagingResults<T>()
{
@Override
@@ -83,12 +79,11 @@ public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodIn
@Override
public Pair<Integer, Integer> getTotalResultCount()
{
int size = processedPage.size();
return new Pair<Integer, Integer>(size, size);
// getTotalResultCount may not be correct. We haven't checked how many other results will be filtered.
return pagingResults.getTotalResultCount();
}
};
}
}
return result;
}