Interface CategoryService

  • All Known Implementing Classes:
    LuceneCategoryServiceImpl, 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 Detail

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

        @Auditable(parameters={"storeRef","aspectName","pagingRequest","sortByName"})
        PagingResults<ChildAssociationRef> getRootCategories​(StoreRef storeRef,
                                                             QName aspectName,
                                                             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"})
        PagingResults<ChildAssociationRef> getRootCategories​(StoreRef storeRef,
                                                             QName aspectName,
                                                             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:
      • 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
      • 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