Interface MCRCategLinkService
- All Known Implementing Classes:
MCRCategLinkServiceImpl
,MCRSolrCategLinkService
public interface MCRCategLinkService
- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- Thomas Scheffler (yagee)
-
Method Summary
Modifier and TypeMethodDescriptioncountLinks
(MCRCategory category, boolean childrenOnly) Counts links to a collection of categories.countLinksForType
(MCRCategory category, String type, boolean childrenOnly) Counts links to a collection of categories.void
Delete all links that refer to the givenMCRCategLinkReference
.void
Delete all links that refer to the given collection of category links.Returns a collection of all links for the given type.Returns a list of linked Object IDs.getLinksFromCategoryForType
(MCRCategoryID id, String type) Returns a list of linked Object IDs restricted by the specified type.getLinksFromReference
(MCRCategLinkReference reference) Returns a list of linked categories.getReferences
(String type) Return a collection of all category link references for the given typegetTypes()
Return a collection of all link types.boolean
hasLink
(MCRCategory classif) Checks if the category with the given id is liked with an objecthasLinks
(MCRCategory category) Checks if a categories id refered by objects.boolean
isInCategory
(MCRCategLinkReference reference, MCRCategoryID id) Checks if a given reference is in a specific category.void
setLinks
(MCRCategLinkReference objectReference, Collection<MCRCategoryID> categories) Add links between categories and Objects.
-
Method Details
-
hasLinks
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
Checks if the category with the given id is liked with an object- Returns:
- true if is linked otherwise false
-
countLinks
Counts links to a collection of categories.- Parameters:
category
- a subtree rooted at a MCRCategory for which links should be countedchildrenOnly
- 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 countedtype
- restrict links that refer to object of this typechildrenOnly
- 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
Delete all links that refer to the givenMCRCategLinkReference
.- Parameters:
id
- an Object ID- See Also:
-
deleteLinks
Delete all links that refer to the given collection of category links.- Parameters:
ids
- a collection ofMCRCategLinkReference
- See Also:
-
getLinksFromCategory
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
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
Returns a list of linked Object IDs restricted by the specified type.- Parameters:
id
- ID of the categorytype
- restrict links that refer to object of this type- Returns:
- Collection of Object IDs
-
getLinksFromReference
Returns a list of linked categories.- Parameters:
reference
- reference, e.g. to a MCRObject- Returns:
- list of MCRCategoryID of linked categories
-
getReferences
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
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 Objectcategories
- a collection of categoryIDs to be linked to- See Also:
-