Package org.ametys.cms.repository
Class DefaultContent<F extends ContentFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultAmetysObject<F>
org.ametys.cms.repository.DefaultContent<F>
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
Content
,ReactionableObject
,ReportableObject
,ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,DublinCoreAwareAmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TagAwareAmetysObject
,TraversableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
- Direct Known Subclasses:
DefaultWebContent
,DefaultWorkflowAwareContent
,ModifiableDefaultContent
public class DefaultContent<F extends ContentFactory>
extends DefaultAmetysObject<F>
implements Content, CopiableAmetysObject, JCRTraversableAmetysObject, ReactionableObject, ReportableObject
Default implementation of a
Content
, also versionable, lockable and workflow-aware.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.repository.ReactionableObject
ReactionableObject.ReactionType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for the attachment node name.static final Locale
The default locale for contentstatic final String
Constants for contentType Metadata*static final String
Constants for last contributor Metadata*static final String
Constants for lastModified Metadata*static final String
Constants for author Metadata*static final String
Constants for firstValidationDate Metadata*static final String
Constants for language Metadata*static final String
Constants for lastMajorValidationDate Metadata*static final String
Constants for lastValidationDate Metadata*static final String
Constants for contentType Metadata*static final String
Constants for lastModified Metadata*static final String
Constants for the outgoing reference nodetypestatic final String
Constants for the outgoing reference propertystatic final String
Constants for the outgoing references nodestatic final String
Constants for the outgoing references path propertystatic final String
Constants for the root outgoing references nodeFields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
Fields inherited from interface org.ametys.cms.repository.Content
ATTRIBUTE_TITLE, METADATA_TITLE
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Constructor Summary
ConstructorDescriptionDefaultContent
(javax.jcr.Node node, String parentPath, F factory) Creates a JCR-based Content. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addReaction
(UserIdentity user, ReactionableObject.ReactionType reactionType) Add the user reactionvoid
Add a report to the objectvoid
Remove all reports on the objectcopyTo
(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObject
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId) Copy the currentDefaultWorkflowAwareContent
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId) Copy the currentDefaultWorkflowAwareContent
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId, boolean waitAsyncObservers, boolean copyACL) Copy the currentDefaultWorkflowAwareContent
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) Copy the currentAmetysObject
to the given object if it is not in the restriction list.<A extends AmetysObject>
AcreateChild
(String name, String type) Creates a child below current object.<A extends AmetysObject>
ARetrieves a given child from its relative path.<A extends AmetysObject>
AmetysObjectIterable<A>Retrieves children of the current object.Retrieves the creation date.Retrieves the login of the creator.Returns theDataHolder
of thisAmetysObject
.Get the Dublin Core contributor.Get the Dublin Core coverage.Get the Dublin Core creator.Get the Dublin Core date.Get the Dublin Core description.Get the Dublin Core format.Get the Dublin Core identifier.Get the Dublin Core language.Get the Dublin Core publisher.Get the Dublin Core relation.Get the Dublin Core rights.Get the Dublin Core source.String[]
Get the Dublin Core subject.Get the Dublin Core title.Get the Dublin Core type.Retrieves the first validation dateReturns theDataHolder
for internal data of thisContent
.Retrieves the language of this content.Retrieves the login of the last contributor.Retrieves the last validation date resulting from a major modification.Retrieves the last modification date.Retrieves the last validation dateString[]
Retrieves the mixin type identifiers of this content.Get the stored outgoing references of the content.getReactionUsers
(ReactionableObject.ReactionType reactionType) Get the list of users who reactReturns all Contents referencing this Content (as a metadata).long
Retrieves the number of reports on the objectRetrieves the attachments root nodegetTags()
Retrieves current tags.getTitle()
Retrieves the title.Retrieves the title for the given locale.String[]
getTypes()
Retrieves the type identifiers of this content.boolean
Tests if this Object has at least one child with the given name.boolean
Returnstrue
if there is at least one Content referencing this Content (as a metadata).void
removeReaction
(UserIdentity user, ReactionableObject.ReactionType reactionType) Remove the user reactionvoid
setLanguage
(String language) Set the type of this Content.
This method may only be called on a new Content, ie.void
setMixinTypes
(String[] mixins) Set the mixins of this Content.void
setReportsCount
(long reportsCount) Sets the number of reports on the objectvoid
Set the type of this contentvoid
Set the types of this Content.void
toSAX
(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) Generates SAX events representing this Content.Methods inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, disallowInheritance, getAllLabels, getAllRevisions, getBaseNode, getBaseVersion, getLabels, getLabels, getNode, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, getRevision, getRevisionTimestamp, getRevisionTimestamp, getUnversionedDataHolder, getVersionHistory, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers, removeLabel, restoreFromLabel, restoreFromNode, restoreFromRevision, switchToLabel, switchToRevision
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, 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.ACLAmetysObject
getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, isInheritanceDisallowed
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX, getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getComposite, getDataNames, getDefinition, getExternalComposite, getExternalRepeater, getExternalValue, getLocalComposite, getLocalRepeater, getLocalValue, getModel, getParentDataHolder, getRepeater, getRootDataHolder, getStatus, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getType, getValue, isMultiple
Methods inherited from interface org.ametys.plugins.repository.ModifiableACLAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, disallowInheritance, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Field Details
-
METADATA_ROOT_OUTGOING_REFERENCES
Constants for the root outgoing references node- See Also:
-
METADATA_OUTGOING_REFERENCES
Constants for the outgoing references node- See Also:
-
METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
Constants for the outgoing references path property- See Also:
-
METADATA_OUTGOING_REFERENCE_PROPERTY
Constants for the outgoing reference property- See Also:
-
METADATA_OUTGOING_REFERENCE_NODETYPE
Constants for the outgoing reference nodetype- See Also:
-
METADATA_LANGUAGE
Constants for language Metadata*- See Also:
-
METADATA_CREATOR
Constants for author Metadata*- See Also:
-
METADATA_CREATION
Constants for lastModified Metadata*- See Also:
-
METADATA_FIRST_VALIDATION
Constants for firstValidationDate Metadata*- See Also:
-
METADATA_LAST_VALIDATION
Constants for lastValidationDate Metadata*- See Also:
-
METADATA_LAST_MAJORVALIDATION
Constants for lastMajorValidationDate Metadata*- See Also:
-
METADATA_CONTRIBUTOR
Constants for last contributor Metadata*- See Also:
-
METADATA_MODIFIED
Constants for lastModified Metadata*- See Also:
-
METADATA_CONTENTTYPE
Constants for contentType Metadata*- See Also:
-
METADATA_MIXINCONTENTTYPES
Constants for contentType Metadata*- See Also:
-
ATTACHMENTS_NODE_NAME
Constant for the attachment node name.- See Also:
-
DEFAULT_CONTENT_LOCALE
The default locale for content
-
-
Constructor Details
-
DefaultContent
Creates a JCR-based Content.- Parameters:
node
- the JCR Node backing this Content.parentPath
- the parent path in the Ametys hierarchy.factory
- the correspondingContentFactory
.
-
-
Method Details
-
getTypes
Description copied from interface:Content
Retrieves the type identifiers of this content.- Specified by:
getTypes
in interfaceContent
- Returns:
- the type identifiers of this content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setType
Description copied from interface:Content
Set the type of this content- Specified by:
setType
in interfaceContent
- Parameters:
type
- the type to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTypes
Description copied from interface:Content
Set the types of this Content.- Specified by:
setTypes
in interfaceContent
- Parameters:
types
- the types of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getMixinTypes
Description copied from interface:Content
Retrieves the mixin type identifiers of this content.- Specified by:
getMixinTypes
in interfaceContent
- Returns:
- the mixin type identifiers of this content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setMixinTypes
Description copied from interface:Content
Set the mixins of this Content.- Specified by:
setMixinTypes
in interfaceContent
- Parameters:
mixins
- the mixins of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLanguage
Description copied from interface:Content
Retrieves the language of this content.- Specified by:
getLanguage
in interfaceContent
- Returns:
- the language of this content or
null
if the content is a multilingual content - Throws:
AmetysRepositoryException
- if an error occurs.
-
setLanguage
Description copied from interface:Content
Set the type of this Content.
This method may only be called on a new Content, ie. before its first save.- Specified by:
setLanguage
in interfaceContent
- Parameters:
language
- the language of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTitle
Description copied from interface:Content
Retrieves the title for the given locale. If the locale is null or does not exist, the first locale will be used.- Specified by:
getTitle
in interfaceContent
- Parameters:
locale
- The locale. Can be null if the content is not a multilingual content or to get the title in the default locale.- Returns:
- the title.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getTitle
Description copied from interface:Content
Retrieves the title. This method is same asContent.getTitle(Locale)
with a null locale. Use this method only if you are manipulating no-multilingual content. If not sure, useContent.getTitle(Locale)
instead.- Specified by:
getTitle
in interfaceContent
- Returns:
- the title.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getCreator
Description copied from interface:Content
Retrieves the login of the creator.- Specified by:
getCreator
in interfaceContent
- Returns:
- the login of the creator.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getCreationDate
Description copied from interface:Content
Retrieves the creation date.- Specified by:
getCreationDate
in interfaceContent
- Returns:
- the creation date.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastContributor
Description copied from interface:Content
Retrieves the login of the last contributor.- Specified by:
getLastContributor
in interfaceContent
- Returns:
- the login of the last contributor.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastModified
Description copied from interface:Content
Retrieves the last modification date.- Specified by:
getLastModified
in interfaceContent
- Returns:
- the last modification date.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getFirstValidationDate
Description copied from interface:Content
Retrieves the first validation date- Specified by:
getFirstValidationDate
in interfaceContent
- Returns:
- the first validation date
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastValidationDate
Description copied from interface:Content
Retrieves the last validation date- Specified by:
getLastValidationDate
in interfaceContent
- Returns:
- the last validation date
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastMajorValidationDate
Description copied from interface:Content
Retrieves the last validation date resulting from a major modification. At least this is the first validation date- Specified by:
getLastMajorValidationDate
in interfaceContent
- Returns:
- the last validation date resulting from a major modification
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getTags
Description copied from interface:TagAwareAmetysObject
Retrieves current tags.- Specified by:
getTags
in interfaceTagAwareAmetysObject
- Returns:
- the current tags.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getOutgoingReferences
Description copied from interface:Content
Get the stored outgoing references of the content. This references can be used for different purposes, such as testing link consistency for example.- Specified by:
getOutgoingReferences
in interfaceContent
- Returns:
- A non null map of outgoing references grouped by metadata (key are metadata path)
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getReferencingContents
Description copied from interface:Content
Returns all Contents referencing this Content (as a metadata).- Specified by:
getReferencingContents
in interfaceContent
- Returns:
- all Contents referencing this Content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasReferencingContents
Description copied from interface:Content
Returnstrue
if there is at least one Content referencing this Content (as a metadata).- Specified by:
hasReferencingContents
in interfaceContent
- Returns:
true
if there is at least one Content referencing this Content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo
- A restrict list ofCopiableAmetysObject
authorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContent
to the given object. Be careful, this method save changes, but do not create a new version (checkpoint)- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object.initWorkflowActionId
- The initial workflow action id- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContent
to the given object. Be careful, this method save changes, but do not create a new version (checkpoint)- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object.lang
- Language of the new object. Can be null. If null, the new language will be get from the copied object.initWorkflowActionId
- The initial workflow action id- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId, boolean waitAsyncObservers, boolean copyACL) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContent
to the given object. Be careful, this method save changes, but do not create a new version (checkpoint)- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object.lang
- Language of the new object. Can be null. If null, the new language will be get from the copied object.initWorkflowActionId
- The initial workflow action idwaitAsyncObservers
- if true, waits if necessary for the asynchronous observers to completecopyACL
- true to copy ACL of source content- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCTitle
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core title.- Specified by:
getDCTitle
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core title. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCCreator
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core creator.- Specified by:
getDCCreator
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core creator. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCSubject
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core subject.- Specified by:
getDCSubject
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core subject. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCDescription
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core description.- Specified by:
getDCDescription
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core description. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCPublisher
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core publisher.- Specified by:
getDCPublisher
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core publisher. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCContributor
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core contributor.- Specified by:
getDCContributor
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core contributor. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCDate
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core date.- Specified by:
getDCDate
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core date. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCType
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core type.- Specified by:
getDCType
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core type. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCFormat
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core format.- Specified by:
getDCFormat
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core format. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCIdentifier
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core identifier.- Specified by:
getDCIdentifier
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core identifier. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCSource
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core source.- Specified by:
getDCSource
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core source. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCLanguage
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core language.- Specified by:
getDCLanguage
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core language. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCRelation
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core relation.- Specified by:
getDCRelation
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core relation. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCCoverage
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core coverage.- Specified by:
getDCCoverage
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core coverage. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCRights
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core rights.- Specified by:
getDCRights
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core rights. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getRootAttachments
Description copied from interface:Content
Retrieves the attachments root node- Specified by:
getRootAttachments
in interfaceContent
- Returns:
- The attachments root node, or null if the content is working on an (unmodifiable) old version and the attachments root is missing.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChild
Description copied from interface:TraversableAmetysObject
Tests if this Object has at least one child with the given name.- Specified by:
hasChild
in interfaceTraversableAmetysObject
- Parameters:
name
- the name to test. Cannot benull
nor empty nor begin with a'/'
and it cannot contain'/'
.- Returns:
true
if the named child exists,false
otherwise.- Throws:
AmetysRepositoryException
- if an error occurs.
-
createChild
public <A extends AmetysObject> A createChild(String name, String type) throws AmetysRepositoryException, RepositoryIntegrityViolationException Description copied from interface:ModifiableTraversableAmetysObject
Creates a child below current object.- Specified by:
createChild
in interfaceModifiableTraversableAmetysObject
- Type Parameters:
A
- the actual type ofAmetysObject
.- Parameters:
name
- the name of the child, position ([n]
) are not supported for same name sibling, the child will be added at the end of the children list.type
- the type of the object.- Returns:
- the new object created.
- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if an object with the same name already exists and same name siblings is not allowed.
-
getChild
public <A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException Description copied from interface:TraversableAmetysObject
Retrieves a given child from its relative path. The path cannot benull
, empty nor begin with a'/'
.- Specified by:
getChild
in interfaceTraversableAmetysObject
- Type Parameters:
A
- the actual type ofAmetysObject
.- Parameters:
path
- the path of the child which can contains a position with.[n]
if same name sibling is allowed.- Returns:
- the child found.
- Throws:
AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.
-
getChildren
public <A extends AmetysObject> AmetysObjectIterable<A> getChildren() throws AmetysRepositoryExceptionDescription copied from interface:TraversableAmetysObject
Retrieves children of the current object.- Specified by:
getChildren
in interfaceTraversableAmetysObject
- Type Parameters:
A
- the actual type ofAmetysObject
s.- Returns:
- the children or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getInternalDataHolder
Description copied from interface:Content
Returns theDataHolder
for internal data of thisContent
.- Specified by:
getInternalDataHolder
in interfaceContent
- Returns:
- the
DataHolder
for internal data of thisContent
-
addReaction
Description copied from interface:ReactionableObject
Add the user reaction- Specified by:
addReaction
in interfaceReactionableObject
- Parameters:
user
- the userreactionType
- the reaction type
-
removeReaction
Description copied from interface:ReactionableObject
Remove the user reaction- Specified by:
removeReaction
in interfaceReactionableObject
- Parameters:
user
- the userreactionType
- the reaction type
-
getReactionUsers
Description copied from interface:ReactionableObject
Get the list of users who react- Specified by:
getReactionUsers
in interfaceReactionableObject
- Parameters:
reactionType
- the reaction type- Returns:
- the list of users
-
addReport
Description copied from interface:ReportableObject
Add a report to the object- Specified by:
addReport
in interfaceReportableObject
-
setReportsCount
Description copied from interface:ReportableObject
Sets the number of reports on the object- Specified by:
setReportsCount
in interfaceReportableObject
- Parameters:
reportsCount
- the number of reports to set
-
clearReports
Description copied from interface:ReportableObject
Remove all reports on the object- Specified by:
clearReports
in interfaceReportableObject
-
getReportsCount
Description copied from interface:ReportableObject
Retrieves the number of reports on the object- Specified by:
getReportsCount
in interfaceReportableObject
- Returns:
- the number of reports
-
toSAX
public void toSAX(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) throws SAXException Description copied from interface:Content
Generates SAX events representing this Content.- Specified by:
toSAX
in interfaceContent
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX events.locale
- theLocale
to use for eg. multilingual attributes.view
- the associated View, or null to generate SAX events for all attributes from the model.saxWorkflowStep
- if true, also generates SAX events for the current workflow step.- Throws:
SAXException
- if an error occurs during the SAX events generation.
-