Package org.alfresco.repo.search.impl
Class AbstractCategoryServiceImpl
java.lang.Object
org.alfresco.repo.search.impl.AbstractCategoryServiceImpl
- All Implemented Interfaces:
CategoryService
- Direct Known Subclasses:
NoIndexCategoryServiceImpl,SolrCategoryServiceImpl
Category service implementation
- Author:
- andyh
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.search.CategoryService
CategoryService.Depth, CategoryService.Mode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DictionaryServiceprotected IndexerAndSearcherprotected NamespacePrefixResolverprotected NodeServiceprotected NodeServiceprotected intprotected TenantService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCategory(NodeRef parent, String name) Create a new category.createClassification(StoreRef storeRef, QName typeName, String attributeName) Create a new category.createRootCategory(StoreRef storeRef, QName aspectName, String name) Create a new root category in the given classificationprotected SearchParameterscreateSearchTopCategoriesParameters(StoreRef storeRef, QName aspectName, int count) Creates search query parameters used to get top categories.voiddeleteCategory(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 nodegetChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth, String filter) Get all the types that represent categoriesgetClassificationNodes(StoreRef storeRef, QName aspectQName) getClassifications(StoreRef storeRef) Get all the classification entriesprotected StringgetRootCategories(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.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/classificationorg.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 categoriesvoidsetDictionaryService(DictionaryService dictionaryService) Set the dictionary servicevoidsetIndexerAndSearcher(IndexerAndSearcher indexerAndSearcher) Set the indexer and searchervoidsetNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver) Set the service to map prefixes to urisvoidsetNodeService(NodeService nodeService) Set the node servicevoidsetPublicNodeService(NodeService publicNodeService) Set the public node servicevoidsetQueryFetchSize(int queryFetchSize) voidsetTenantService(TenantService tenantService) Set the tenant service
-
Field Details
-
nodeService
-
publicNodeService
-
tenantService
-
namespacePrefixResolver
-
dictionaryService
-
indexerAndSearcher
-
queryFetchSize
protected int queryFetchSize
-
-
Constructor Details
-
AbstractCategoryServiceImpl
public AbstractCategoryServiceImpl()
-
-
Method Details
-
setNodeService
Set the node service- Parameters:
nodeService- NodeService
-
setPublicNodeService
Set the public node service- Parameters:
publicNodeService- NodeService
-
setTenantService
Set the tenant service- Parameters:
tenantService- TenantService
-
setNamespacePrefixResolver
Set the service to map prefixes to uris- Parameters:
namespacePrefixResolver- NamespacePrefixResolver
-
setDictionaryService
Set the dictionary service- Parameters:
dictionaryService- DictionaryService
-
setIndexerAndSearcher
Set the indexer and searcher- Parameters:
indexerAndSearcher- IndexerAndSearcher
-
setQueryFetchSize
public void setQueryFetchSize(int queryFetchSize) -
getChildren
public Collection<ChildAssociationRef> getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth) Description copied from interface:CategoryServiceGet the children of a given category node- Specified by:
getChildrenin interfaceCategoryService- 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
-
getChildren
public Collection<ChildAssociationRef> getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth, String filter) -
getPrefix
-
getCategories
public Collection<ChildAssociationRef> getCategories(StoreRef storeRef, QName aspectQName, CategoryService.Depth depth) Description copied from interface:CategoryServiceGet a list of all the categories appropriate for a given property. The full list of categories that may be assigned for this aspect.- Specified by:
getCategoriesin interfaceCategoryService- 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
-
getClassificationNodes
-
getClassifications
Description copied from interface:CategoryServiceGet all the classification entries- Specified by:
getClassificationsin interfaceCategoryService
-
getClassificationAspects
Description copied from interface:CategoryServiceGet all the types that represent categories- Specified by:
getClassificationAspectsin interfaceCategoryService
-
createClassification
Description copied from interface:CategoryServiceCreate 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.- Specified by:
createClassificationin interfaceCategoryService- Parameters:
storeRef- StoreReftypeName- QNameattributeName- String
-
getRootCategories
public org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName) Description copied from interface:CategoryServiceGet a paged list of the root categories for an aspect/classification- Specified by:
getRootCategoriesin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QNamepagingRequest- PagingRequestsortByName- boolean
-
getRootCategories
public org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, String filter) Description copied from interface:CategoryServiceGet a paged list of the root categories for an aspect/classification- Specified by:
getRootCategoriesin interfaceCategoryService- Returns:
-
getRootCategories
public org.alfresco.query.PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, org.alfresco.query.PagingRequest pagingRequest, boolean sortByName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Description copied from interface:CategoryServiceGet a paged list of the root categories for an aspect/classification supporting multiple name filters.- Specified by:
getRootCategoriesin interfaceCategoryService- Returns:
-
getRootCategories
public Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, Collection<String> exactNamesFilter, Collection<String> alikeNamesFilter) Description copied from interface:CategoryServiceGet a collection of the root categories for an aspect/classification supporting multiple name filters.- Specified by:
getRootCategoriesin interfaceCategoryService
-
getRootCategories
Description copied from interface:CategoryServiceGet the root categories for an aspect/classification- Specified by:
getRootCategoriesin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QName
-
getRootCategories
public Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, String filter) Description copied from interface:CategoryServiceGet the root categories for an aspect/classification with names that start with filter- Specified by:
getRootCategoriesin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QNamefilter- String
-
getCategory
Description copied from interface:CategoryServiceLooks up a category by name under its immediate parent. Index-independent so can be used for cluster-safe existence checks.- Specified by:
getCategoryin interfaceCategoryService- Parameters:
parent- the parentaspectName- the aspect namename- the category name- Returns:
- the category child association reference
-
getRootCategories
public Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, String name, boolean create) Description copied from interface:CategoryServiceGets root categories by name, optionally creating one if one does not exist. Index-independent so can be used for cluster-safe existence checks.- Specified by:
getRootCategoriesin interfaceCategoryService- 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
-
createCategory
Description copied from interface:CategoryServiceCreate a new category.- Specified by:
createCategoryin interfaceCategoryService- Parameters:
parent- NodeRefname- String- Returns:
- NodeRef
-
createRootCategory
Description copied from interface:CategoryServiceCreate a new root category in the given classification- Specified by:
createRootCategoryin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QNamename- String- Returns:
- NodeRef
-
deleteCategory
Description copied from interface:CategoryServiceDelete a category- Specified by:
deleteCategoryin interfaceCategoryService- Parameters:
nodeRef- NodeRef
-
deleteClassification
Description copied from interface:CategoryServiceDelete a classification- Specified by:
deleteClassificationin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QName
-
getTopCategories
public abstract List<Pair<NodeRef,Integer>> getTopCategories(StoreRef storeRef, QName aspectName, int count) Description copied from interface:CategoryServiceGet the most polular categories- Specified by:
getTopCategoriesin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QNamecount- int- Returns:
- List
-
createSearchTopCategoriesParameters
protected SearchParameters createSearchTopCategoriesParameters(StoreRef storeRef, QName aspectName, int count) Creates search query parameters used to get top categories. Can be used as a base both wih SOLR and ES.- Parameters:
storeRef- Node store referenceaspectName- Aspect name. "cm:generalclassifiable" aspect should be used for usual cases. It is possible to use a custom aspect but it must have valid category propertycount- Will be used as faceted results limit, when system has very many categories this must be reflecting that number- Returns:
- SearchParameters to perform search for top categories.
-
getRootCategoryNodeRef
Description copied from interface:CategoryServiceGet a root category NodeRef- Specified by:
getRootCategoryNodeRefin interfaceCategoryService- Returns:
- NodeRef for category root node
-