Package org.silverpeas.core.webapi.pdc
Class LocalizedPdcAxisValue
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
-
- org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity<PdcAxisValue,PdcAxisValuePk>
-
- org.silverpeas.core.pdc.pdc.model.PdcAxisValue
-
- org.silverpeas.core.webapi.pdc.LocalizedPdcAxisValue
-
- All Implemented Interfaces:
Serializable
,IdentifiableEntity
,LocalizedValue
public class LocalizedPdcAxisValue extends PdcAxisValue implements LocalizedValue
A decorator of a Pdc axis value by adding to it additional methods required to compute information to render in a view. Theses information are localized according to the language passed in the constructor.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.webapi.pdc.LocalizedValue
MAX_NUMBER_OF_RENDERED_PATH_NODE, NUMBER_OF_RENDERED_PATH_NODE_IN_TRUNCATION, SEPARATOR_PATH, TRUNCATION_SEPARATOR
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalizedPdcAxisValue
decorate(PdcAxisValue value, String forLanguage)
String
getAxisId()
Gets the unique identifier of the axis to which this value belongs to.Set<PdcAxisValue>
getChildValues()
Gets all the values into which this one can be refined or specifying in a little more.String
getId()
Gets the unique identifier of this entity.String
getLanguage()
Gets the language in which the path of the value is localized.String
getLocalizedPath()
Gets the path of the value whose the terms are translated in a given language.String
getMeaning()
Gets the meaning carried by this value.String
getMeaningTranslatedIn(String language)
Gets the meaning carried by this value translated in the specified language.PdcAxisValue
getParentValue()
Gets the value this one refines or specifies a little more.String
getTerm()
Gets the term carried by this value.String
getTermTranslatedIn(String language)
Gets the term carried by this value and translated in the specified language.String
getValuePath()
Gets the path of this value from the root value (that is a base value of the axis).boolean
isBaseValue()
Is this value is a base one?ClassifyValue
toClassifyValue()
Converts this PdC axis value to a ClassifyValue instance.String
toString()
-
Methods inherited from class org.silverpeas.core.pdc.pdc.model.PdcAxisValue
aPdcAxisValue, aPdcAxisValueFromTreeNode, copy, equals, fromTreeNode, getTreeNode, getTreeNodeParents, getUsedAxis, getValueId, hashCode, inAxisId, setId, withAsTreeNodeParents, withId
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity
performBeforePersist, performBeforeRemove, performBeforeUpdate
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity
getNativeId, isPersisted, setId
-
-
-
-
Method Detail
-
decorate
public static LocalizedPdcAxisValue decorate(PdcAxisValue value, String forLanguage)
-
getLocalizedPath
public String getLocalizedPath()
Description copied from interface:LocalizedValue
Gets the path of the value whose the terms are translated in a given language.- Specified by:
getLocalizedPath
in interfaceLocalizedValue
- Returns:
- the translated path to render.
-
getLanguage
public String getLanguage()
Description copied from interface:LocalizedValue
Gets the language in which the path of the value is localized.- Specified by:
getLanguage
in interfaceLocalizedValue
- Returns:
-
toString
public String toString()
- Overrides:
toString
in classPdcAxisValue
-
toClassifyValue
public ClassifyValue toClassifyValue()
Description copied from class:PdcAxisValue
Converts this PdC axis value to a ClassifyValue instance. This method is for compatibility with the old way to manage the classification.- Overrides:
toClassifyValue
in classPdcAxisValue
- Returns:
- a ClassifyValue instance.
-
isBaseValue
public boolean isBaseValue()
Description copied from class:PdcAxisValue
Is this value is a base one?- Overrides:
isBaseValue
in classPdcAxisValue
- Returns:
- true if this value is an axis base value.
-
getValuePath
public String getValuePath()
Description copied from class:PdcAxisValue
Gets the path of this value from the root value (that is a base value of the axis). The path is made up of the identifiers of each parent value; for example : /0/2/3- Overrides:
getValuePath
in classPdcAxisValue
- Returns:
- the path of its value.
-
getTermTranslatedIn
public String getTermTranslatedIn(String language)
Description copied from class:PdcAxisValue
Gets the term carried by this value and translated in the specified language.- Overrides:
getTermTranslatedIn
in classPdcAxisValue
- Parameters:
language
- the language in which the term should be translated.- Returns:
- the term translated in the specified language. If no such translation exists, then return the default term as get by calling getTerm() method.
-
getTerm
public String getTerm()
Description copied from class:PdcAxisValue
Gets the term carried by this value.- Overrides:
getTerm
in classPdcAxisValue
- Returns:
- the term of the value.
-
getParentValue
public PdcAxisValue getParentValue()
Description copied from class:PdcAxisValue
Gets the value this one refines or specifies a little more. The returned value is the parent of this one in the semantic tree represented by the axis to which this value belongs.- Overrides:
getParentValue
in classPdcAxisValue
- Returns:
- the axis value parent of this one or null if this value has no parent (in that case, this value is a base one).
-
getMeaningTranslatedIn
public String getMeaningTranslatedIn(String language)
Description copied from class:PdcAxisValue
Gets the meaning carried by this value translated in the specified language. The meaning is in fact the complete path of translated terms that made this value. For example, in an axis representing the geography, the meaning of the value "France / Rhônes-Alpes / Isère" is in french "Geographie / France / Rhônes-Alpes / Isère".- Overrides:
getMeaningTranslatedIn
in classPdcAxisValue
- Returns:
- the meaning carried by this value, in other words the complete path of this value translated in the specified language. If no such translations exist, then the result is equivalent to the call of the getMeaning() method.
-
getMeaning
public String getMeaning()
Description copied from class:PdcAxisValue
Gets the meaning carried by this value. The meaning is in fact the complete path of terms that made this value. For example, in an axis representing the geography, the meaning of the value "France / Rhônes-Alpes / Isère" is "Geography / France / Rhônes-Alpes / Isère".- Overrides:
getMeaning
in classPdcAxisValue
- Returns:
- the meaning carried by this value, in other words the complete path of this value.
-
getId
public String getId()
Description copied from interface:IdentifiableEntity
Gets the unique identifier of this entity.- Specified by:
getId
in interfaceIdentifiableEntity
- Overrides:
getId
in classAbstractJpaEntity<PdcAxisValue,PdcAxisValuePk>
- Returns:
- the entity unique identifier in the form of a string.
-
getChildValues
public Set<PdcAxisValue> getChildValues()
Description copied from class:PdcAxisValue
Gets all the values into which this one can be refined or specifying in a little more. Theses values are the children of this one in the semantic tree represented by the axis to which this value belongs.- Overrides:
getChildValues
in classPdcAxisValue
- Returns:
- an unmodifiable set of values that are children of this one. If this value is a leaf, then an empty set is returned.
-
getAxisId
public String getAxisId()
Description copied from class:PdcAxisValue
Gets the unique identifier of the axis to which this value belongs to.- Overrides:
getAxisId
in classPdcAxisValue
- Returns:
- the unique identifier of the axis value.
-
-