Package org.silverpeas.core.webapi.pdc
Class PdcPositionEntity
- java.lang.Object
-
- org.silverpeas.core.webapi.pdc.PdcPositionEntity
-
- All Implemented Interfaces:
Serializable
,WebEntity
public class PdcPositionEntity extends Object implements WebEntity
The Web representation of the position of a Silverpeas's resource in the classification plan (PdC). As such, it publishes only some of the business classification's position attributes. A position of a resource on the PdC defines an atomic semantic information about its content. As such, it can be a single or a set of values in the different PdC's axis. An axis value can be a single semantic term or a hierarchical tree of semantic terms carrying a deeper exactness about the concept's value. For example, in a geographic axis, the value France can be a tree in which it is splited into regions, departments, towns, and so on, each of theses terms giving a more accuracy about a geographic position (that is the semantic concept of the geographic axis).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdcPositionEntity(List<PdcPositionValueEntity> values)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PdcPositionEntity
createNewPositionWith(List<PdcPositionValueEntity> values)
Creates a web entity representing a new position on the Pdc and that is valued with the specified PdC axis values.boolean
equals(Object obj)
static PdcPositionEntity
fromClassifyPosition(ClassifyPosition position, String inLanguage, URI inClassificationByURI)
Creates a Web entity representing a position on the PdC from the specified business classification position.static PdcPositionEntity
fromPdcPosition(PdcPosition position, String inLanguage, URI inClassificationByURI)
Creates a Web entity representing a position on the PdC from the specified business classification position.String
getId()
List<PdcPositionValueEntity>
getPositionValues()
Gets the values of this position.URI
getURI()
Gets the URI at which this web entity is published and can be accessed.int
hashCode()
protected void
setSynonymsFrom(UserThesaurusHolder userThesaurus)
Sets the synonyms for each value of this position from the specified thesaurus.ClassifyPosition
toClassifyPosition()
Gets the business classification position this web entity represents.PdcPosition
toPdcPosition()
String
toString()
-
-
-
Constructor Detail
-
PdcPositionEntity
protected PdcPositionEntity(List<PdcPositionValueEntity> values)
-
-
Method Detail
-
fromClassifyPosition
public static PdcPositionEntity fromClassifyPosition(ClassifyPosition position, String inLanguage, URI inClassificationByURI)
Creates a Web entity representing a position on the PdC from the specified business classification position. It is expressed in the specified language and it is located in the PdC classification identified by the specified URI.- Parameters:
position
- the ClassifyPosition instance the web entity should represent.inLanguage
- the language in which the position should expressed.inClassificationByURI
- the URI identifying the PdC classification to which the position belongs.- Returns:
- a PdcPositionEntity instance.
-
fromPdcPosition
public static PdcPositionEntity fromPdcPosition(PdcPosition position, String inLanguage, URI inClassificationByURI)
Creates a Web entity representing a position on the PdC from the specified business classification position. It is expressed in the specified language and it is located in the PdC classification identified by the specified URI.- Parameters:
position
- the position on the PdC the web entity should represent.inLanguage
- the language in which the position should expressed.inClassificationByURI
- the URI identifying the PdC classification to which the position belongs.- Returns:
- a PdcPositionEntity instance.
-
createNewPositionWith
public static PdcPositionEntity createNewPositionWith(List<PdcPositionValueEntity> values)
Creates a web entity representing a new position on the Pdc and that is valued with the specified PdC axis values.- Parameters:
values
- a list of representations of PdC axis values.- Returns:
- a PdcPositionEntity instance.
-
toClassifyPosition
public ClassifyPosition toClassifyPosition()
Gets the business classification position this web entity represents.- Returns:
- a ClassifyPosition instance represented by this web entity.
-
toPdcPosition
public PdcPosition toPdcPosition()
-
getURI
public URI getURI()
Description copied from interface:WebEntity
Gets the URI at which this web entity is published and can be accessed.
-
getId
public String getId()
-
getPositionValues
public List<PdcPositionValueEntity> getPositionValues()
Gets the values of this position.- Returns:
- an unmodifiable list of PdC position values.
-
setSynonymsFrom
protected void setSynonymsFrom(UserThesaurusHolder userThesaurus) throws ThesaurusException
Sets the synonyms for each value of this position from the specified thesaurus.- Parameters:
userThesaurus
- a user thesaurus from which synonyms can be get.- Throws:
ThesaurusException
- if an error occurs while getting the synonyms of this position's values.
-
-