Class 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) $
    • Constructor Detail

      • CategorizationUtil

        public CategorizationUtil()
    • Method Detail

      • 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 of term data tree
        Parameters:
        terms - a collection of term 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
      • getTermChildrenByContentId

        public static List<String> getTermChildrenByContentId​(String contentId,
                                                              Locale locale)
        Returns a list of all direct children from a given term content identifier.
        Parameters:
        contentId - a term content identifier.
        Returns:
        a list of all direct children.
        Since:
        9.0.0