Class PdcEntity

  • All Implemented Interfaces:
    Serializable, WebEntity

    public class PdcEntity
    extends Object
    implements WebEntity
    A web entity representing the classification plan (named PdC). The classification plan can be either the one modeled for the Silverpeas system or the one parametrized for a given Silverpeas component instance. It defines the axis that can be used in the classification of a resource managed by a component instance.
    See Also:
    Serialized Form
    • Field Detail

      • NoThesaurus

        public static final UserThesaurusHolder NoThesaurus
        The value representing an absence of thesaurus.
    • Constructor Detail

      • PdcEntity

        protected PdcEntity()
    • Method Detail

      • aPdcEntityWithUsedAxis

        public static PdcEntity aPdcEntityWithUsedAxis​(List<UsedAxis> usedAxis,
                                                       String inLanguage,
                                                       URI atURI,
                                                       UserThesaurusHolder withThesaurus)
                                                throws ThesaurusException
        Creates a new web entity of a PdC containing the specified axis whose terms are expressed in the specified language and with the specified user thesaurus. The web representation of the PdC is identified at the specified URI.
        Parameters:
        usedAxis - the axis to use in the PdC.
        inLanguage - the language in which the PdC's terms should be translated.
        atURI - the URI at which the PdC can be found.
        withThesaurus - the thesaurus to use with this PdC. The thesaurus will be use to set the synonyms of each value of the different PdC's axis. NoThesaurus if the user has no thesaurus configured.
        Returns:
        the web representation of a PdC.
        Throws:
        ThesaurusException - if an error occurs while using the thesaurus to find the synonyms of values of the different PdC's axis.
      • withAxis

        public static List<UsedAxis> withAxis​(List<UsedAxis> axis)
        A convenient method to enhance the readability of the method calls in which the axis are passed as argument.
        Parameters:
        axis - the axis of the PdC.
        Returns:
        the specified axis.
      • inLanguage

        public static String inLanguage​(String language)
        A convenient method to enhance the readability of the method calls that expect the language as argument.
        Parameters:
        language - the language of a user.
        Returns:
        the language.
      • getURI

        public URI getURI()
        Gets the URI at which this resource is published and can be accessed.
        Specified by:
        getURI in interface WebEntity
        Returns:
        the web resource URI.
      • getAxis

        public List<PdcAxis> getAxis()
        Gets the axis of this PdC.
        Returns:
        an unmodifiable list of PdC axis.
      • withAsAxis

        public PdcEntity withAsAxis​(List<PdcAxis> axis)
        Adds the specified PdC axis among the others axis of this PdC.
        Parameters:
        axis - the axis of this PdC.
        Returns:
        itself.
      • atURI

        public static URI atURI​(URI uri)
        A convenient method to enhance the readability of creators.
        Parameters:
        uri - the URI at which the classification is published.
        Returns:
        the classification URI.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object