org.alfresco.repo.search.impl.lucene
Class LuceneCategoryServiceImpl

java.lang.Object
  extended by org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl
All Implemented Interfaces:
CategoryService
Direct Known Subclasses:
NoIndexCategoryServiceImpl, SolrCategoryServiceImpl

public class LuceneCategoryServiceImpl
extends java.lang.Object
implements CategoryService

Category service implementation


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.search.CategoryService
CategoryService.Depth, CategoryService.Mode
 
Field Summary
protected  org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
           
protected  IndexerAndSearcher indexerAndSearcher
           
protected  org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver
           
protected  org.alfresco.service.cmr.repository.NodeService nodeService
           
protected  org.alfresco.service.cmr.repository.NodeService publicNodeService
           
protected  org.alfresco.repo.tenant.TenantService tenantService
           
 
Constructor Summary
LuceneCategoryServiceImpl()
           
 
Method Summary
 org.alfresco.service.cmr.repository.NodeRef createCategory(org.alfresco.service.cmr.repository.NodeRef parent, java.lang.String name)
          Create a new category.
 org.alfresco.service.cmr.repository.NodeRef createClassification(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName typeName, java.lang.String attributeName)
          Create a new category.
 org.alfresco.service.cmr.repository.NodeRef createRootCategory(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectName, java.lang.String name)
          Create a new root category in the given classification
 void deleteCategory(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Delete a category
 void deleteClassification(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectName)
          Delete a classification
 java.util.Collection getCategories(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectQName, CategoryService.Depth depth)
          Get a list of all the categories appropriate for a given property.
 org.alfresco.service.cmr.repository.ChildAssociationRef getCategory(org.alfresco.service.cmr.repository.NodeRef parent, org.alfresco.service.namespace.QName aspectName, java.lang.String name)
          Looks up a category by name under its immediate parent.
 java.util.Collection getChildren(org.alfresco.service.cmr.repository.NodeRef categoryRef, CategoryService.Mode mode, CategoryService.Depth depth)
          Get the children of a given category node
 java.util.Collection getClassificationAspects()
          Get all the types that represent categories
 java.util.Collection getClassifications(org.alfresco.service.cmr.repository.StoreRef storeRef)
          Get all the classification entries
 java.util.Collection getRootCategories(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectName)
          Get the root categories for an aspect/classification
 java.util.Collection getRootCategories(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectName, java.lang.String name, boolean create)
          Gets root categories by name, optionally creating one if one does not exist.
 java.util.List getTopCategories(org.alfresco.service.cmr.repository.StoreRef storeRef, org.alfresco.service.namespace.QName aspectName, int count)
          Get the most polular categories
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
          Set the dictionary service
 void setIndexerAndSearcher(IndexerAndSearcher indexerAndSearcher)
          Set the indexer and searcher
 void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
          Set the service to map prefixes to uris
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
          Set the node service
 void setPublicNodeService(org.alfresco.service.cmr.repository.NodeService publicNodeService)
          Set the public node service
 void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
          Set the tenant service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeService

protected org.alfresco.service.cmr.repository.NodeService nodeService

publicNodeService

protected org.alfresco.service.cmr.repository.NodeService publicNodeService

tenantService

protected org.alfresco.repo.tenant.TenantService tenantService

namespacePrefixResolver

protected org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver

dictionaryService

protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService

indexerAndSearcher

protected IndexerAndSearcher indexerAndSearcher
Constructor Detail

LuceneCategoryServiceImpl

public LuceneCategoryServiceImpl()
Method Detail

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service

Parameters:
nodeService -

setPublicNodeService

public void setPublicNodeService(org.alfresco.service.cmr.repository.NodeService publicNodeService)
Set the public node service

Parameters:
nodeService -

setTenantService

public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the tenant service

Parameters:
tenantService -

setNamespacePrefixResolver

public void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
Set the service to map prefixes to uris

Parameters:
namespacePrefixResolver -

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service

Parameters:
dictionaryService -

setIndexerAndSearcher

public void setIndexerAndSearcher(IndexerAndSearcher indexerAndSearcher)
Set the indexer and searcher

Parameters:
indexerAndSearcher -

getChildren

public java.util.Collection getChildren(org.alfresco.service.cmr.repository.NodeRef categoryRef,
                                        CategoryService.Mode mode,
                                        CategoryService.Depth depth)
Description copied from interface: CategoryService
Get the children of a given category node

Specified by:
getChildren in interface CategoryService
Parameters:
categoryRef - - the category node
mode - - the enumeration mode for what to recover
depth - - the enumeration depth for what level to recover
Returns:
a collection of all the nodes found identified by their ChildAssocRef's

getCategories

public java.util.Collection getCategories(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                          org.alfresco.service.namespace.QName aspectQName,
                                          CategoryService.Depth depth)
Description copied from interface: CategoryService
Get 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:
getCategories in interface CategoryService
depth - - the enumeration depth for what level to recover
Returns:
a collection of all the nodes found identified by their ChildAssocRef's

getClassifications

public java.util.Collection getClassifications(org.alfresco.service.cmr.repository.StoreRef storeRef)
Description copied from interface: CategoryService
Get all the classification entries

Specified by:
getClassifications in interface CategoryService
Returns:

getClassificationAspects

public java.util.Collection getClassificationAspects()
Description copied from interface: CategoryService
Get all the types that represent categories

Specified by:
getClassificationAspects in interface CategoryService
Returns:

createClassification

public org.alfresco.service.cmr.repository.NodeRef createClassification(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                                                        org.alfresco.service.namespace.QName typeName,
                                                                        java.lang.String attributeName)
Description copied from interface: CategoryService
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.

Specified by:
createClassification in interface CategoryService

getRootCategories

public java.util.Collection getRootCategories(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                              org.alfresco.service.namespace.QName aspectName)
Description copied from interface: CategoryService
Get the root categories for an aspect/classification

Specified by:
getRootCategories in interface CategoryService
Returns:

getCategory

public org.alfresco.service.cmr.repository.ChildAssociationRef getCategory(org.alfresco.service.cmr.repository.NodeRef parent,
                                                                           org.alfresco.service.namespace.QName aspectName,
                                                                           java.lang.String name)
Description copied from interface: CategoryService
Looks up a category by name under its immediate parent. Index-independent so can be used for cluster-safe existence checks.

Specified by:
getCategory in interface CategoryService
Parameters:
parent - the parent
aspectName - the aspect name
name - the category name
Returns:
the category child association reference

getRootCategories

public java.util.Collection getRootCategories(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                              org.alfresco.service.namespace.QName aspectName,
                                              java.lang.String name,
                                              boolean create)
Description copied from interface: CategoryService
Gets 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:
getRootCategories in interface CategoryService
Parameters:
storeRef - the store ref
aspectName - the aspect name
name - the aspect name
create - should a category node be created if one does not exist?
Returns:
the root categories

createCategory

public org.alfresco.service.cmr.repository.NodeRef createCategory(org.alfresco.service.cmr.repository.NodeRef parent,
                                                                  java.lang.String name)
Description copied from interface: CategoryService
Create a new category.

Specified by:
createCategory in interface CategoryService
Returns:

createRootCategory

public org.alfresco.service.cmr.repository.NodeRef createRootCategory(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                                                      org.alfresco.service.namespace.QName aspectName,
                                                                      java.lang.String name)
Description copied from interface: CategoryService
Create a new root category in the given classification

Specified by:
createRootCategory in interface CategoryService
Returns:

deleteCategory

public void deleteCategory(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: CategoryService
Delete a category

Specified by:
deleteCategory in interface CategoryService

deleteClassification

public void deleteClassification(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                 org.alfresco.service.namespace.QName aspectName)
Description copied from interface: CategoryService
Delete a classification

Specified by:
deleteClassification in interface CategoryService

getTopCategories

public java.util.List getTopCategories(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                       org.alfresco.service.namespace.QName aspectName,
                                       int count)
Description copied from interface: CategoryService
Get the most polular categories

Specified by:
getTopCategories in interface CategoryService
Returns:


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.