com.silverpeas.pdc.web
Class PdcEntity

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

public class PdcEntity
extends Object
implements Exposable

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
static UserThesaurusHolder NoThesaurus
          The value representing an absence of thesaurus.
 
Constructor Summary
protected PdcEntity()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.

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.

Specified by:
getURI in interface Exposable
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.

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


Copyright © 2016 Silverpeas. All Rights Reserved.