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
  • 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 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

      @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 - StoreRef
      aspectQName - QName
      depth - - 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 - StoreRef
      aspectName - 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 - StoreRef
      aspectName - QName
      pagingRequest - PagingRequest
      sortByName - 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 - StoreRef
      aspectName - QName
      filter - 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 parent
      aspectName - the aspect name
      name - 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 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
    • getClassificationAspects

      @Auditable Collection<QName> 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 - StoreRef
      aspectName - QName
      attributeName - 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 - StoreRef
      aspectName - QName
      name - String
      Returns:
      NodeRef
    • createCategory

      @Auditable(parameters={"parent","name"}) NodeRef createCategory(NodeRef parent, String name)
      Create a new category.
      Parameters:
      parent - NodeRef
      name - String
      Returns:
      NodeRef
    • deleteClassification

      @Auditable(parameters={"storeRef","aspectName"}) void deleteClassification(StoreRef storeRef, QName aspectName)
      Delete a classification
      Parameters:
      storeRef - StoreRef
      aspectName - QName
    • deleteCategory

      @Auditable(parameters="nodeRef") void deleteCategory(NodeRef nodeRef)
      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 - StoreRef
      aspectName - QName
      count - int
      Returns:
      List
    • getRootCategoryNodeRef

      @Auditable(parameters="storeRef") default Optional<NodeRef> getRootCategoryNodeRef(StoreRef storeRef)
      Get a root category NodeRef
      Returns:
      NodeRef for category root node