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 2fca73abcf
commit 2dcdc2f727

View File

@@ -18,8 +18,6 @@
*/ */
package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor; package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor;
import static org.apache.commons.collections.ListUtils.isEqualList;
import java.util.List; import java.util.List;
import org.alfresco.query.PagingResults; import org.alfresco.query.PagingResults;
@@ -60,34 +58,31 @@ public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodIn
List page = pagingResults.getPage(); List page = pagingResults.getPage();
final List processedPage = getPostMethodInvocationProcessor().process(page); final List processedPage = getPostMethodInvocationProcessor().process(page);
if (!isEqualList(page, processedPage)) result = (T) new PagingResults<T>()
{ {
result = (T) new PagingResults<T>() @Override
public String getQueryExecutionId()
{ {
@Override return pagingResults.getQueryExecutionId();
public String getQueryExecutionId() }
{ @Override
return pagingResults.getQueryExecutionId(); public List<T> getPage()
} {
@Override return processedPage;
public List<T> getPage() }
{ @Override
return processedPage; public boolean hasMoreItems()
} {
@Override // hasMoreItems might not be correct. Cannot determine the correct value as request details are needed.
public boolean hasMoreItems() return pagingResults.hasMoreItems();
{ }
// hasMoreItems might not be correct. Cannot determine the correct value as request details are needed. @Override
return pagingResults.hasMoreItems(); public Pair<Integer, Integer> getTotalResultCount()
} {
@Override // getTotalResultCount may not be correct. We haven't checked how many other results will be filtered.
public Pair<Integer, Integer> getTotalResultCount() return pagingResults.getTotalResultCount();
{ }
int size = processedPage.size(); };
return new Pair<Integer, Integer>(size, size);
}
};
}
} }
return result; return result;