Class CategorizationDataType.Data

  • All Implemented Interfaces:
    IRenderable
    Enclosing class:
    CategorizationDataType

    public static class CategorizationDataType.Data
    extends Object
    implements IRenderable
    Categorization data of a given content.
    Since:
    9.0.0
    Version:
    $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
    • Constructor Detail

      • Data

        public Data​(ContentVersion contentVersion,
                    Locale locale)
             throws PortalException
        Creates a new categorization data of the categorization related to the given content version.
        Parameters:
        contentVersion - the content version.
        locale - the locale to be used when determining the terms names.
        Throws:
        PortalException
        Since:
        9.0.0
      • Data

        public Data​(Collection<String> termIds,
                    Locale locale)
             throws PortalException
        Creates a new categorization data of the given categorization content identifiers. All terms passed as parameters will be marked as direct association. Other (their ancestors) won't be marked as direct association.
        Parameters:
        termIds - the terms content identifiers.
        locale - the locale to be used to get appropriate strings.
        Throws:
        PortalException
        Since:
        9.0.0
    • Method Detail

      • hydrateTermsTree

        public CategorizationDataType.Data hydrateTermsTree()
        Hydrate this data by adding all existing direct association terms' sub-trees. The added terms will be marked as direct association as well.
        Returns:
        this data.
        Since:
        9.0.0
      • getGroups

        public Map<String,​CategorizationDataType.CategorizationGroupData> getGroups()
        Returns the categorization grouped by each categorization service instance identifier.
        Returns:
        the categorization grouped by each categorization service instance identifier.
        Since:
        9.0.0
      • getXmlString

        public String getXmlString()
                            throws PortalException
        Returns the XML string of this data.
        Returns:
        the XML string of this data.
        Throws:
        PortalException
        Since:
        9.0.0
      • buildRestJSONMap

        public Map<String,​Object> buildRestJSONMap()
        Returns the Rest JSON map representation of this data.
        Returns:
        the Rest JSON map representation of this data.
        Since:
        9.0.0
      • getDisplayString

        public String getDisplayString​(IRenderer renderer)
                                throws PortalException
        Description copied from interface: IRenderable
        Returns the string to be displayed for representing this instance, when a short display is required.
        Specified by:
        getDisplayString in interface IRenderable
        Parameters:
        renderer - the renderer object that will use the returned render data.
        Returns:
        the string to be used to friendly display this instance.
        Throws:
        PortalException