Class LuceneCategoryServiceImpl
- java.lang.Object
-
- org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl
-
- All Implemented Interfaces:
CategoryService
- Direct Known Subclasses:
NoIndexCategoryServiceImpl,SolrCategoryServiceImpl
public class LuceneCategoryServiceImpl extends Object implements CategoryService
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
Fields Modifier and Type Field Description protected DictionaryServicedictionaryServiceprotected IndexerAndSearcherindexerAndSearcherprotected NamespacePrefixResolvernamespacePrefixResolverprotected NodeServicenodeServiceprotected NodeServicepublicNodeServiceprotected intqueryFetchSizeprotected TenantServicetenantService
-
Constructor Summary
Constructors Constructor Description LuceneCategoryServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeRefcreateCategory(NodeRef parent, String name)Create a new category.NodeRefcreateClassification(StoreRef storeRef, QName typeName, String attributeName)Create a new category.NodeRefcreateRootCategory(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 classificationCollection<ChildAssociationRef>getCategories(StoreRef storeRef, QName aspectQName, CategoryService.Depth depth)Get a list of all the categories appropriate for a given property.ChildAssociationRefgetCategory(NodeRef parent, QName aspectName, String name)Looks up a category by name under its immediate parent.Collection<ChildAssociationRef>getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth)Get the children of a given category nodeCollection<ChildAssociationRef>getChildren(NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth, String filter)Collection<QName>getClassificationAspects()Get all the types that represent categoriesCollection<ChildAssociationRef>getClassifications(StoreRef storeRef)Get all the classification entriesCollection<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName)Get the root categories for an aspect/classificationCollection<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, String filter)Get the root categories for an aspect/classification with names that start with filterCollection<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, String name, boolean create)Gets root categories by name, optionally creating one if one does not exist.PagingResults<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, PagingRequest pagingRequest, boolean sortByName)Get a paged list of the root categories for an aspect/classificationPagingResults<ChildAssociationRef>getRootCategories(StoreRef storeRef, QName aspectName, PagingRequest pagingRequest, boolean sortByName, String filter)Get a paged list of the root categories for an aspect/classificationList<Pair<NodeRef,Integer>>getTopCategories(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 Detail
-
nodeService
protected NodeService nodeService
-
publicNodeService
protected NodeService publicNodeService
-
tenantService
protected TenantService tenantService
-
namespacePrefixResolver
protected NamespacePrefixResolver namespacePrefixResolver
-
dictionaryService
protected DictionaryService dictionaryService
-
indexerAndSearcher
protected IndexerAndSearcher indexerAndSearcher
-
queryFetchSize
protected int queryFetchSize
-
-
Method Detail
-
setNodeService
public void setNodeService(NodeService nodeService)
Set the node service- Parameters:
nodeService- NodeService
-
setPublicNodeService
public void setPublicNodeService(NodeService publicNodeService)
Set the public node service- Parameters:
publicNodeService- NodeService
-
setTenantService
public void setTenantService(TenantService tenantService)
Set the tenant service- Parameters:
tenantService- TenantService
-
setNamespacePrefixResolver
public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
Set the service to map prefixes to uris- Parameters:
namespacePrefixResolver- NamespacePrefixResolver
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
Set the dictionary service- Parameters:
dictionaryService- DictionaryService
-
setIndexerAndSearcher
public void setIndexerAndSearcher(IndexerAndSearcher indexerAndSearcher)
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)
-
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
-
getClassifications
public Collection<ChildAssociationRef> getClassifications(StoreRef storeRef)
Description copied from interface:CategoryServiceGet all the classification entries- Specified by:
getClassificationsin interfaceCategoryService
-
getClassificationAspects
public Collection<QName> getClassificationAspects()
Description copied from interface:CategoryServiceGet all the types that represent categories- Specified by:
getClassificationAspectsin interfaceCategoryService
-
createClassification
public NodeRef createClassification(StoreRef storeRef, QName typeName, String attributeName)
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 PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, 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 PagingResults<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName, 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 Collection<ChildAssociationRef> getRootCategories(StoreRef storeRef, QName aspectName)
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
public ChildAssociationRef getCategory(NodeRef parent, QName aspectName, String name)
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
public NodeRef createCategory(NodeRef parent, String name)
Description copied from interface:CategoryServiceCreate a new category.- Specified by:
createCategoryin interfaceCategoryService- Parameters:
parent- NodeRefname- String- Returns:
- NodeRef
-
createRootCategory
public NodeRef createRootCategory(StoreRef storeRef, QName aspectName, String name)
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
public void deleteCategory(NodeRef nodeRef)
Description copied from interface:CategoryServiceDelete a category- Specified by:
deleteCategoryin interfaceCategoryService- Parameters:
nodeRef- NodeRef
-
deleteClassification
public void deleteClassification(StoreRef storeRef, QName aspectName)
Description copied from interface:CategoryServiceDelete a classification- Specified by:
deleteClassificationin interfaceCategoryService- Parameters:
storeRef- StoreRefaspectName- QName
-
getTopCategories
public 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
-
-