Package org.alfresco.service.cmr.search
Interface CategoryService
- All Known Implementing Classes:
AbstractCategoryServiceImpl,NoIndexCategoryServiceImpl,SolrCategoryServiceImpl
@AlfrescoPublicApi
public interface CategoryService
Category Service
The service for querying and creating categories. All other management can be carried out using the node service.
Classification - the groupings of categories. There is a one-to-one mapping with aspects. For example, Region. Root Category - the top level categories in a classification. For example, Northern Europe Category - any other category below a root category
- Author:
- Andy Hind
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDepth from which to get nodes.static enumEnumeration for navigation control. -
Method Summary
Modifier and TypeMethodDescriptioncreateCategory(NodeRef parent, String name) Create a new category.createClassification(StoreRef storeRef, QName aspectName, String attributeName) Create a new category.createRootCategory(StoreRef storeRef, QName aspectName, String name) Create a new root category in the given classificationvoiddeleteCategory(NodeRef nodeRef) Delete a categoryvoiddeleteClassification(StoreRef storeRef, QName aspectName) Delete a classificationgetCategories(StoreRef storeRef, QName aspectQName, CategoryService.Depth depth) Get a list of all the categories appropriate for a given property.getCategory(NodeRef parent, QName aspectName, String name) Looks up a category by name under its immediate parent.getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth) Get the children of a given category nodeGet all the types that represent categoriesgetClassifications(StoreRef storeRef) Get all the classification entriesgetRootCategories(StoreRef storeRef, QName aspectName) Get the root categories for an aspect/classificationgetRootCategories(StoreRef storeRef, QName aspectName, String filter) Get the root categories for an aspect/classification with names that start with filtergetRootCategories(StoreRef storeRef, QName aspectName, String name, boolean create) Gets root categories by name, optionally creating one if one does not exist.default Collection<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Get a collection of the root categories for an aspect/classification supporting multiple name filters.org.alfresco.query.PagingResults<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName) Get a paged list of the root categories for an aspect/classificationorg.alfresco.query.PagingResults<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, String filter) Get a paged list of the root categories for an aspect/classificationdefault org.alfresco.query.PagingResults<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Get a paged list of the root categories for an aspect/classification supporting multiple name filters.getRootCategoryNodeRef(StoreRef storeRef) Get a root category NodeRefgetTopCategories(StoreRef storeRef, QName aspectName, int count) Get the most polular categories
-
Method Details
-
getChildren
@Auditable(parameters={"categoryRef","mode","depth"}) Collection<ChildAssociationRef> getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth) Get the children of a given category node- Parameters:
categoryRef- - the category nodemode- - the enumeration mode for what to recoverdepth- - the enumeration depth for what level to recover- Returns:
- a collection of all the nodes found identified by their ChildAssocRef's
-
getCategories
@Auditable(parameters={"storeRef","aspectQName","depth"}) Collection<ChildAssociationRef> getCategories(StoreRef storeRef, QName aspectQName, CategoryService.Depth depth) Get a list of all the categories appropriate for a given property. The full list of categories that may be assigned for this aspect.- Parameters:
storeRef- StoreRefaspectQName- QNamedepth- - the enumeration depth for what level to recover- Returns:
- a collection of all the nodes found identified by their ChildAssocRef's
-
getClassifications
@Auditable(parameters="storeRef") Collection<ChildAssociationRef> getClassifications(StoreRef storeRef) Get all the classification entries -
getRootCategories
@Auditable(parameters={"storeRef","aspectName"}) Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName) Get the root categories for an aspect/classification- Parameters:
storeRef- StoreRefaspectName- QName
-
getRootCategories
@Auditable(parameters={"storeRef","aspectName","pagingRequest","sortByName"}) org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName) Get a paged list of the root categories for an aspect/classification- Parameters:
storeRef- StoreRefaspectName- QNamepagingRequest- PagingRequestsortByName- boolean
-
getRootCategories
@Auditable(parameters={"storeRef","aspectName","pagingRequest","sortByName","filter"}) org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, String filter) Get a paged list of the root categories for an aspect/classification- Parameters:
storeRef-aspectName-pagingRequest-sortByName-filter-- Returns:
-
getRootCategories
@Auditable(parameters={"storeRef","aspectName","pagingRequest","sortByName","exactNamesFilter","alikeNamesFilter"}) default org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Get a paged list of the root categories for an aspect/classification supporting multiple name filters.- Parameters:
storeRef-aspectName-pagingRequest-sortByName-exactNamesFilter-alikeNamesFilter-- Returns:
-
getRootCategories
@Auditable(parameters={"storeRef","aspectName","exactNamesFilter","alikeNamesFilter"}) default Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Get a collection of the root categories for an aspect/classification supporting multiple name filters. -
getRootCategories
@Auditable(parameters={"storeRef","aspectName"}) Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, String filter) Get the root categories for an aspect/classification with names that start with filter- Parameters:
storeRef- StoreRefaspectName- QNamefilter- String
-
getCategory
@Auditable(parameters={"storeRef","aspectName","name"}) ChildAssociationRef getCategory(NodeRef parent, QName aspectName, String name) Looks up a category by name under its immediate parent. Index-independent so can be used for cluster-safe existence checks.- Parameters:
parent- the parentaspectName- the aspect namename- the category name- Returns:
- the category child association reference
-
getRootCategories
@Auditable(parameters={"storeRef","aspectName","name","create"}) Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, String name, boolean create) Gets root categories by name, optionally creating one if one does not exist. Index-independent so can be used for cluster-safe existence checks.- Parameters:
storeRef- the store refaspectName- the aspect namename- the aspect namecreate- should a category node be created if one does not exist?- Returns:
- the root categories
-
getClassificationAspects
Get all the types that represent categories -
createClassification
@Auditable(parameters={"storeRef","aspectName","attributeName"}) NodeRef createClassification(StoreRef storeRef, QName aspectName, String attributeName) Create a new category. This will extend the category types in the data dictionary All it needs is the type name and the attribute in which to store noderefs to categories.- Parameters:
storeRef- StoreRefaspectName- QNameattributeName- String
-
createRootCategory
@Auditable(parameters={"storeRef","aspectName","name"}) NodeRef createRootCategory(StoreRef storeRef, QName aspectName, String name) Create a new root category in the given classification- Parameters:
storeRef- StoreRefaspectName- QNamename- String- Returns:
- NodeRef
-
createCategory
Create a new category.- Parameters:
parent- NodeRefname- String- Returns:
- NodeRef
-
deleteClassification
@Auditable(parameters={"storeRef","aspectName"}) void deleteClassification(StoreRef storeRef, QName aspectName) Delete a classification- Parameters:
storeRef- StoreRefaspectName- QName
-
deleteCategory
Delete a category- Parameters:
nodeRef- NodeRef
-
getTopCategories
@Auditable(parameters={"storeRef","aspectName","count"}) List<Pair<NodeRef,Integer>> getTopCategories(StoreRef storeRef, QName aspectName, int count) Get the most polular categories- Parameters:
storeRef- StoreRefaspectName- QNamecount- int- Returns:
- List
-
getRootCategoryNodeRef
@Auditable(parameters="storeRef") default Optional<NodeRef> getRootCategoryNodeRef(StoreRef storeRef) Get a root category NodeRef- Returns:
- NodeRef for category root node
-