ALF-9153 Share sometimes asks for a topic listing with a zero page size, avoid giving this to the CQ engine and instead immediately return an empty result set

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30035 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-08-24 16:06:13 +00:00
parent 44aa5689bd
commit 9c5e894a97

View File

@@ -30,6 +30,7 @@ import org.alfresco.model.ForumModel;
import org.alfresco.query.CannedQueryFactory;
import org.alfresco.query.CannedQueryResults;
import org.alfresco.query.CannedQuerySortDetails;
import org.alfresco.query.EmptyCannedQueryResults;
import org.alfresco.query.EmptyPagingResults;
import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults;
@@ -889,6 +890,13 @@ public class DiscussionServiceImpl implements DiscussionService
QName nodeType, String creatorUsername, Date from, Date to,
boolean oldestFirst, PagingRequest paging)
{
// The Canned Query system doesn't allow for zero sized pages
// If they asked for that (bits of share sometimes do), bail out now
if(paging != null && paging.getMaxItems() == 0)
{
return new EmptyCannedQueryResults<NodeBackedEntity>(null);
}
// Grab the factory
GetChildrenAuditableCannedQueryFactory getChildrenCannedQueryFactory = (GetChildrenAuditableCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_CHILDREN);