Package lumis.service.categorization
Class CategorizationUtil
- java.lang.Object
-
- lumis.service.categorization.CategorizationUtil
-
public class CategorizationUtil extends Object
Contains utility methods related to content categorization features.- Since:
- 6.2.0
- Version:
- $Revision: 20509 $ $Date: 2017-09-11 16:18:14 -0300 (Mon, 11 Sep 2017) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CategorizationUtil.CyclicTermsException
Exception thrown when the path of a term cannot be determined because its ancestral are in a cyclic graph.
-
Constructor Summary
Constructors Constructor Description CategorizationUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getBestTermName(String termContentId)
Returns the best name of the specified term to be shown to current user.static String
getBestTermName(String termContentId, Locale locale)
Returns the best name of the specified term to be shown to current user.static Set<String>
getDirectTermAssociationsContentIds(CategorizationDataType.Data terms)
Returns a list of all direct term associations related the a collection ofterm data tree
static List<String>
getTermChildrenByContentId(String contentId, Locale locale)
Returns a list of all direct children from a given term content identifier.static List<String>
getTermPathContentIds(String termContentId)
Returns the content identifiers that make up the path to the specified term.static List<String>
getTermPathNames(String termContentId)
Returns the names of terms make up the path to the specified term.
-
-
-
Method Detail
-
getTermPathContentIds
public static List<String> getTermPathContentIds(String termContentId) throws PortalException, CategorizationUtil.CyclicTermsException
Returns the content identifiers that make up the path to the specified term.- Parameters:
termContentId
- the term's content identifier.- Returns:
- a list of content identifiers, from farthest ancestral to the specified term inclusive.
- Throws:
PortalObjectNotFoundException
- if the specified content could not be found.CategorizationUtil.CyclicTermsException
- if the path cannot be determined because the term's parent are in a cyclic graph.PortalException
- Since:
- 6.2.0
-
getTermPathNames
public static List<String> getTermPathNames(String termContentId) throws PortalException, CategorizationUtil.CyclicTermsException
Returns the names of terms make up the path to the specified term.- Parameters:
termContentId
- the term's content identifier.- Returns:
- a list of term names, from farthest ancestral to the specified term inclusive. If a term has multiple name, the best name appropriate to current user session locale is used.
- Throws:
PortalObjectNotFoundException
- if the specified content could not be found.CategorizationUtil.CyclicTermsException
- if the path cannot be determined because the term's parent are in a cyclic graph.PortalException
- Since:
- 6.2.0
-
getBestTermName
public static String getBestTermName(String termContentId) throws PortalException
Returns the best name of the specified term to be shown to current user.- Parameters:
termContentId
- the term's content identifier.- Returns:
- the name.
- Throws:
PortalObjectNotFoundException
- if the specified content could not be found.PortalException
- Since:
- 6.2.0
-
getBestTermName
public static String getBestTermName(String termContentId, Locale locale) throws PortalException
Returns the best name of the specified term to be shown to current user.- Parameters:
termContentId
- the term's content identifier.- Returns:
- the name.
- Throws:
PortalObjectNotFoundException
- if the specified content could not be found.PortalException
- Since:
- 9.0.0
-
getDirectTermAssociationsContentIds
public static Set<String> getDirectTermAssociationsContentIds(CategorizationDataType.Data terms)
Returns a list of all direct term associations related the a collection ofterm data tree
- Parameters:
terms
- a collection ofterm data
to extract all terms with direct association.- Returns:
- a list of all direct term associations related the a collection of
term data tree
. - Since:
- 9.0.0
-
-