Interface MCRCategLinkService

All Known Implementing Classes:
MCRCategLinkServiceImpl, MCRSolrCategLinkService

public interface MCRCategLinkService
Since:
2.0
Version:
$Revision$ $Date$
Author:
Thomas Scheffler (yagee)
  • Method Details

    • hasLinks

      Map<MCRCategoryID,Boolean> hasLinks(MCRCategory category)
      Checks if a categories id refered by objects.
      Parameters:
      category - a subtree rooted at a MCRCategory for which links should be counted
      Returns:
      true if the classification is used
    • hasLink

      boolean hasLink(MCRCategory classif)
      Checks if the category with the given id is liked with an object
      Returns:
      true if is linked otherwise false
    • countLinks

      Map<MCRCategoryID,Number> countLinks(MCRCategory category, boolean childrenOnly)
      Counts links to a collection of categories.
      Parameters:
      category - a subtree rooted at a MCRCategory for which links should be counted
      childrenOnly - if only direct children of category should be queried (query may be more optimized)
      Returns:
      a Map with MCRCategoryID as key and the number of links as value
    • countLinksForType

      Map<MCRCategoryID,Number> countLinksForType(MCRCategory category, String type, boolean childrenOnly)
      Counts links to a collection of categories.
      Parameters:
      category - a subtree rooted at a MCRCategory for which links should be counted
      type - restrict links that refer to object of this type
      childrenOnly - if only direct children of category should be queried (query may be more optimized)
      Returns:
      a Map with MCRCategoryID as key and the number of links as value
    • deleteLink

      void deleteLink(MCRCategLinkReference id)
      Delete all links that refer to the given MCRCategLinkReference.
      Parameters:
      id - an Object ID
      See Also:
    • deleteLinks

      void deleteLinks(Collection<MCRCategLinkReference> ids)
      Delete all links that refer to the given collection of category links.
      Parameters:
      ids - a collection of MCRCategLinkReference
      See Also:
    • getLinksFromCategory

      Collection<String> getLinksFromCategory(MCRCategoryID id)
      Returns a list of linked Object IDs.
      Parameters:
      id - ID of the category
      Returns:
      Collection of Object IDs, empty Collection when no links exist
    • isInCategory

      boolean isInCategory(MCRCategLinkReference reference, MCRCategoryID id)
      Checks if a given reference is in a specific category.
      Parameters:
      reference - reference, e.g. to a MCRObject
      Returns:
      true if the reference is in the category
    • getLinksFromCategoryForType

      Collection<String> getLinksFromCategoryForType(MCRCategoryID id, String type)
      Returns a list of linked Object IDs restricted by the specified type.
      Parameters:
      id - ID of the category
      type - restrict links that refer to object of this type
      Returns:
      Collection of Object IDs
    • getLinksFromReference

      Collection<MCRCategoryID> getLinksFromReference(MCRCategLinkReference reference)
      Returns a list of linked categories.
      Parameters:
      reference - reference, e.g. to a MCRObject
      Returns:
      list of MCRCategoryID of linked categories
    • getReferences

      Collection<MCRCategLinkReference> getReferences(String type)
      Return a collection of all category link references for the given type
    • getTypes

      Collection<String> getTypes()
      Return a collection of all link types.
    • getLinks

      Returns a collection of all links for the given type.
    • setLinks

      void setLinks(MCRCategLinkReference objectReference, Collection<MCRCategoryID> categories)
      Add links between categories and Objects. Implementors must assure that ancestor (parent) axis categories are implicit linked by this method.
      Parameters:
      objectReference - reference to a Object
      categories - a collection of categoryIDs to be linked to
      See Also: