Package org.ametys.plugins.glossary
Class DefaultDefinition
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<DefaultDefinitionFactory>
-
- org.ametys.plugins.glossary.DefaultDefinition
-
- All Implemented Interfaces:
Definition
,AmetysObject
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableAmetysObject
,RemovableAmetysObject
,SiteAwareAmetysObject
public class DefaultDefinition extends SimpleAmetysObject<DefaultDefinitionFactory> implements Definition, SiteAwareAmetysObject
Repository implementation of a glossary definition.
-
-
Field Summary
Fields Modifier and Type Field Description static String
METADATA_CONTENT
Constant for content metadata.static String
METADATA_DISPLAY
Constant for display metadata.static String
METADATA_VARIANTS
Constant for variants metadata.static String
METADATA_WORD
Constant for word metadata.
-
Constructor Summary
Constructors Constructor Description DefaultDefinition(Node node, String parentPath, DefaultDefinitionFactory factory)
Create aDefaultDefinition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
displayOnText()
Get the displayOnText.Set<String>
getAllForms()
Get all forms.String
getContent()
Get the content.String
getLanguage()
Get the definition language.Site
getSite()
Returns this object's site.String
getSiteName()
Returns this object's site name.Set<String>
getVariants()
Get the variants.String
getWord()
Get the word.void
setContent(String content)
Set the content.void
setDisplayOnText(boolean displayOnText)
Set the displayOnText.void
setVariants(Collection<String> variants)
Set the variants.void
setWord(String word)
Set the word.-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
-
-
-
Field Detail
-
METADATA_WORD
public static final String METADATA_WORD
Constant for word metadata.- See Also:
- Constant Field Values
-
METADATA_VARIANTS
public static final String METADATA_VARIANTS
Constant for variants metadata.- See Also:
- Constant Field Values
-
METADATA_CONTENT
public static final String METADATA_CONTENT
Constant for content metadata.- See Also:
- Constant Field Values
-
METADATA_DISPLAY
public static final String METADATA_DISPLAY
Constant for display metadata.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultDefinition
public DefaultDefinition(Node node, String parentPath, DefaultDefinitionFactory factory)
Create aDefaultDefinition
.- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultDefinitionFactory
which creates the AmetysObject.
-
-
Method Detail
-
getWord
public String getWord() throws AmetysRepositoryException
Description copied from interface:Definition
Get the word.- Specified by:
getWord
in interfaceDefinition
- Returns:
- the word
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setWord
public void setWord(String word) throws AmetysRepositoryException
Description copied from interface:Definition
Set the word.- Specified by:
setWord
in interfaceDefinition
- Parameters:
word
- the word to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
getVariants
public Set<String> getVariants() throws AmetysRepositoryException
Description copied from interface:Definition
Get the variants.- Specified by:
getVariants
in interfaceDefinition
- Returns:
- the variants
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setVariants
public void setVariants(Collection<String> variants) throws AmetysRepositoryException
Description copied from interface:Definition
Set the variants.- Specified by:
setVariants
in interfaceDefinition
- Parameters:
variants
- the variants to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
getContent
public String getContent() throws AmetysRepositoryException
Description copied from interface:Definition
Get the content.- Specified by:
getContent
in interfaceDefinition
- Returns:
- _the content
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setContent
public void setContent(String content) throws AmetysRepositoryException
Description copied from interface:Definition
Set the content.- Specified by:
setContent
in interfaceDefinition
- Parameters:
content
- the content to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
displayOnText
public boolean displayOnText() throws AmetysRepositoryException
Description copied from interface:Definition
Get the displayOnText.- Specified by:
displayOnText
in interfaceDefinition
- Returns:
- _the displayOnText
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDisplayOnText
public void setDisplayOnText(boolean displayOnText) throws AmetysRepositoryException
Description copied from interface:Definition
Set the displayOnText.- Specified by:
setDisplayOnText
in interfaceDefinition
- Parameters:
displayOnText
- the displayOnText to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
getAllForms
public Set<String> getAllForms() throws AmetysRepositoryException
Description copied from interface:Definition
Get all forms.- Specified by:
getAllForms
in interfaceDefinition
- Returns:
- a list of all the word forms (word + variants).
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSite
public Site getSite() throws AmetysRepositoryException
Description copied from interface:SiteAwareAmetysObject
Returns this object's site.- Specified by:
getSite
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSiteName
public String getSiteName() throws AmetysRepositoryException
Description copied from interface:SiteAwareAmetysObject
Returns this object's site name.- Specified by:
getSiteName
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site name.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLanguage
public String getLanguage()
Get the definition language.- Returns:
- the definition language.
-
-