Merged 5.1.N (5.1.1) to HEAD (5.2)

123152 amorarasu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
      123098 rmunteanu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
         122976 tvalkevych: MNT-15783: Merged V4.2.4 (4.2.4.20) to V4.2-BUG-FIX (4.2.7)
            113807 adragoi: Merged DEV to V4.2.4 (4.2.4.16)
               113780: MNT-12240 : Loading of available Tags is slow at 'Edit Properties' -> 'Select Tags' dialog.
                  - limited query results sin webscript


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123694 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 22:33:33 +00:00
parent 8f7e06cb95
commit 38f73d02ae
4 changed files with 54 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.List;
import org.alfresco.model.ContentModel;
import org.alfresco.query.PagingRequest;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -138,6 +139,23 @@ public final class Classification extends BaseScopableProcessorExtension
return Context.getCurrentContext().newArray(getScope(), cats);
}
/**
* Get ordered, filtered and paged root categories in a classification.
*
* @param aspect
* @param filter
* @param maxItems
* @param skipCount (offset)
* @return
*/
public Scriptable getRootCategories(String aspect, String filter, int maxItems, int skipCount)
{
PagingRequest pagingRequest = new PagingRequest(skipCount, maxItems);
List<ChildAssociationRef> rootCategories = services.getCategoryService().getRootCategories(storeRef, createQName(aspect), pagingRequest, true, filter).getPage();
Object[] cats = buildCategoryNodes(rootCategories);
return Context.getCurrentContext().newArray(getScope(), cats);
}
/**
* Get the category usage count.
*