mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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,34 +58,31 @@ public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodIn
|
||||
List page = pagingResults.getPage();
|
||||
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
|
||||
public String getQueryExecutionId()
|
||||
{
|
||||
return pagingResults.getQueryExecutionId();
|
||||
}
|
||||
@Override
|
||||
public List<T> getPage()
|
||||
{
|
||||
return processedPage;
|
||||
}
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
// hasMoreItems might not be correct. Cannot determine the correct value as request details are needed.
|
||||
return pagingResults.hasMoreItems();
|
||||
}
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
int size = processedPage.size();
|
||||
return new Pair<Integer, Integer>(size, size);
|
||||
}
|
||||
};
|
||||
}
|
||||
return pagingResults.getQueryExecutionId();
|
||||
}
|
||||
@Override
|
||||
public List<T> getPage()
|
||||
{
|
||||
return processedPage;
|
||||
}
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
// hasMoreItems might not be correct. Cannot determine the correct value as request details are needed.
|
||||
return pagingResults.hasMoreItems();
|
||||
}
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
// getTotalResultCount may not be correct. We haven't checked how many other results will be filtered.
|
||||
return pagingResults.getTotalResultCount();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user