com.silverpeas.pdc.web
Class PdcPositionEntity

java.lang.Object
  extended by com.silverpeas.pdc.web.PdcPositionEntity
All Implemented Interfaces:
Exposable, Serializable

public class PdcPositionEntity
extends Object
implements Exposable

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
protected PdcPositionEntity(List<PdcPositionValueEntity> values)
           
 
Method Summary
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 resource 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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: Exposable
Gets the URI at which this resource is published and can be accessed.

Specified by:
getURI in interface Exposable
Returns:
the web resource URI.

getId

public String getId()

getPositionValues

public List<PdcPositionValueEntity> getPositionValues()
Gets the values of this position.

Returns:
an unmodifiable list of PdC position values.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

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.


Copyright © 2016 Silverpeas. All Rights Reserved.