Package org.silverpeas.core.webapi.pdc
Class PdcEntity
- java.lang.Object
-
- org.silverpeas.core.webapi.pdc.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 Summary
Fields Modifier and Type Field Description static UserThesaurusHolder
NoThesaurus
The value representing an absence of thesaurus.
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdcEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PdcEntity
aPdcEntityWithAxis(List<Axis> usedAxis, String inLanguage, URI atURI, UserThesaurusHolder withThesaurus)
static PdcEntity
aPdcEntityWithUsedAxis(List<UsedAxis> usedAxis, String inLanguage, URI atURI, UserThesaurusHolder withThesaurus)
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.static URI
atURI(URI uri)
A convenient method to enhance the readability of creators.boolean
equals(Object obj)
List<PdcAxis>
getAxis()
Gets the axis of this PdC.URI
getURI()
Gets the URI at which this resource is published and can be accessed.int
hashCode()
static String
inLanguage(String language)
A convenient method to enhance the readability of the method calls that expect the language as argument.String
toString()
PdcEntity
withAsAxis(List<PdcAxis> axis)
Adds the specified PdC axis among the others axis of this PdC.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.
-
-
-
Field Detail
-
NoThesaurus
public static final UserThesaurusHolder NoThesaurus
The value representing an absence of thesaurus.
-
-
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.
-
aPdcEntityWithAxis
public static PdcEntity aPdcEntityWithAxis(List<Axis> usedAxis, String inLanguage, URI atURI, UserThesaurusHolder withThesaurus) throws ThesaurusException
- Throws:
ThesaurusException
-
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.
-
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.
-
-