Package org.ametys.cms.repository
Class ModifiableDefaultContent<F extends ModifiableContentFactory>
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>
org.ametys.cms.repository.ModifiableDefaultContent<F>
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
CommentableContent
,CommentableAmetysObject
,Content
,ModifiableContent
,ModifiableWorkflowAwareContent
,ReactionableObject
,ReportableObject
,WorkflowAwareContent
,ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
,DublinCoreAwareAmetysObject
,ModifiableDublinCoreAwareAmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,LockableAmetysObject
,LockAwareAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TagAwareAmetysObject
,TaggableAmetysObject
,TraversableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
,WorkflowAwareAmetysObject
- Direct Known Subclasses:
AbstractProgramPart
,Course
,CoursePart
,OrgUnit
,Person
public class ModifiableDefaultContent<F extends ModifiableContentFactory>
extends DefaultContent<F>
implements CommentableContent, LockableAmetysObject, ModifiableWorkflowAwareContent
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
Fields inherited from class org.ametys.cms.repository.DefaultContent
ATTACHMENTS_NODE_NAME, DEFAULT_CONTENT_LOCALE, METADATA_CONTENTTYPE, METADATA_CONTRIBUTOR, METADATA_CREATION, METADATA_CREATOR, METADATA_FIRST_VALIDATION, METADATA_LANGUAGE, METADATA_LAST_MAJORVALIDATION, METADATA_LAST_VALIDATION, METADATA_MIXINCONTENTTYPES, METADATA_MODIFIED, METADATA_OUTGOING_REFERENCE_NODETYPE, METADATA_OUTGOING_REFERENCE_PROPERTY, METADATA_OUTGOING_REFERENCES, METADATA_OUTGOING_REFERENCES_PATH_PROPERTY, METADATA_ROOT_OUTGOING_REFERENCES
Fields 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
ConstructorDescriptionModifiableDefaultContent
(javax.jcr.Node node, String parentPath, F factory) Creates a JCR-based Content. -
Method Summary
Modifier and TypeMethodDescriptionCreates a commentcreateComment
(String commentId, ZonedDateTime creationDate) Creates a comment with the given id and creation date This method allow to create a comment from existing data (ex: data import from archive) The id is not generated here, the source is trusted.void
fillContent
(Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) Fills the current content with the values from the providedNode
.getComment
(String commentId) Get a commentgetComments
(boolean includeNotValidatedComments, boolean includeValidatedComments) Get the list of available comments (validated, not validated, both or none :))long
Retrieves the current step id of the Ametys objectReturns theDataHolder
of thisAmetysObject
.Returns the owner of the lock, or null if noneRetrieves the date at which the content was proposed for validation, i.e.long
Retrieves the workflow id associated with the Ametys object.boolean
isLocked()
Returns true if thisAmetysObject
is lockedvoid
lock()
Locks thisAmetysObject
void
remove()
Removes thisAmetysObject
from the Ametys tree.void
setCreationDate
(Date creationDate) Set the creation date.void
setCreator
(UserIdentity user) Set the login of the creator.void
setCurrentStepId
(long stepId) Set the current step id of the Ametys objectvoid
setDCContributor
(String contributor) Set the Dublin Core contributor.void
setDCCoverage
(String coverage) Set the Dublin Core coverage.void
setDCCreator
(String creator) Set the Dublin Core creator.void
Set the Dublin Core date.void
setDCDescription
(String description) Set the Dublin Core description.void
setDCFormat
(String format) Set the Dublin Core format.void
setDCIdentifier
(String identifier) Set the Dublin Core identifier.void
setDCLanguage
(String language) Set the Dublin Core language.void
setDCPublisher
(String publisher) Set the Dublin Core publisher.void
setDCRelation
(String relation) Set the Dublin Core relation.void
setDCRights
(String rights) Set the Dublin Core rights.void
setDCSource
(String source) Set the Dublin Core source.void
setDCSubject
(String[] subject) Set the Dublin Core subject.void
setDCTitle
(String title) Set the Dublin Core title.void
Set the Dublin Core type.void
setFirstValidationDate
(Date validationDate) Set the first validation datevoid
Set the login of the last contributor.void
setLastMajorValidationDate
(Date validationDate) Set the last validation date resulting from a major modificationvoid
setLastModified
(Date lastModified) Set the last modification date.void
setLastValidationDate
(Date validationDate) Set the last validation datevoid
setOutgoingReferences
(Map<String, OutgoingReferences> references) Store the outgoing references of the content.void
setProposalDate
(ZonedDateTime proposalDate) Set the date at which the content was proposed for validation, i.e.void
Set the title.void
Set the title from the given localevoid
setWorkflowId
(long workflowId) Set the workflow id of this Ametys object.
This method will throw Exception if the workflow id was already set on this Ametys object.void
Tags.void
unlock()
Unlocks thisAmetysObject
void
Untags.Methods inherited from class org.ametys.cms.repository.DefaultContent
addReaction, addReport, clearReports, copyTo, copyTo, copyTo, copyTo, copyTo, createChild, getChild, getChildren, getCreationDate, getCreator, getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType, getFirstValidationDate, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReactionUsers, getReferencingContents, getReportsCount, getRootAttachments, getTags, getTitle, getTitle, getTypes, hasChild, hasReferencingContents, removeReaction, setLanguage, setMixinTypes, setReportsCount, setType, setTypes, toSAX
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, 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.cms.repository.Content
getCreationDate, getCreator, getFirstValidationDate, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getRootAttachments, getTitle, getTitle, getTypes, hasReferencingContents, setLanguage, setMixinTypes, setType, setTypes, toSAX
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.dublincore.DublinCoreAwareAmetysObject
getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, 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, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, 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.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRepositoryData, getRootDataHolder, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
Methods inherited from interface org.ametys.plugins.repository.tag.TagAwareAmetysObject
getTags
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Constructor Details
-
ModifiableDefaultContent
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
-
setTitle
Description copied from interface:ModifiableContent
Set the title from the given locale- Specified by:
setTitle
in interfaceModifiableContent
- Parameters:
title
- the title.locale
- The locale- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTitle
Description copied from interface:ModifiableContent
Set the title. Be careful ! Use only if content's title is not a multilingual string. If not sure useModifiableContent.setTitle(String, Locale)
instead.- Specified by:
setTitle
in interfaceModifiableContent
- Parameters:
title
- the title.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCreator
Description copied from interface:ModifiableContent
Set the login of the creator.- Specified by:
setCreator
in interfaceModifiableContent
- Parameters:
user
- the creator.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCreationDate
Description copied from interface:ModifiableContent
Set the creation date.- Specified by:
setCreationDate
in interfaceModifiableContent
- Parameters:
creationDate
- the creation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastContributor
Description copied from interface:ModifiableContent
Set the login of the last contributor.- Specified by:
setLastContributor
in interfaceModifiableContent
- Parameters:
user
- the last contributor.
-
setLastModified
Description copied from interface:ModifiableContent
Set the last modification date.- Specified by:
setLastModified
in interfaceModifiableContent
- Parameters:
lastModified
- the last modification date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setFirstValidationDate
Description copied from interface:ModifiableContent
Set the first validation date- Specified by:
setFirstValidationDate
in interfaceModifiableContent
- Parameters:
validationDate
- the validation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastValidationDate
Description copied from interface:ModifiableContent
Set the last validation date- Specified by:
setLastValidationDate
in interfaceModifiableContent
- Parameters:
validationDate
- the validation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastMajorValidationDate
Description copied from interface:ModifiableContent
Set the last validation date resulting from a major modification- Specified by:
setLastMajorValidationDate
in interfaceModifiableContent
- Parameters:
validationDate
- the validation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setOutgoingReferences
public void setOutgoingReferences(Map<String, OutgoingReferences> references) throws AmetysRepositoryExceptionDescription copied from interface:ModifiableContent
Store the outgoing references of the content.- Specified by:
setOutgoingReferences
in interfaceModifiableContent
- Parameters:
references
- A non null map of outgoing references grouped by metadata (key are metadata path)- Throws:
AmetysRepositoryException
- if an error occurs.
-
tag
Description copied from interface:TaggableAmetysObject
Tags.- Specified by:
tag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to add.- Throws:
AmetysRepositoryException
- if an error occurs.
-
untag
Description copied from interface:TaggableAmetysObject
Untags.- Specified by:
untag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to remove.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getWorkflowId
Description copied from interface:WorkflowAwareAmetysObject
Retrieves the workflow id associated with the Ametys object.- Specified by:
getWorkflowId
in interfaceWorkflowAwareAmetysObject
- Returns:
- the workflow id.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setWorkflowId
Description copied from interface:WorkflowAwareAmetysObject
Set the workflow id of this Ametys object.
This method will throw Exception if the workflow id was already set on this Ametys object.- Specified by:
setWorkflowId
in interfaceWorkflowAwareAmetysObject
- Parameters:
workflowId
- the workflow id of the object.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCurrentStepId
Description copied from interface:WorkflowAwareAmetysObject
Retrieves the current step id of the Ametys object- Specified by:
getCurrentStepId
in interfaceWorkflowAwareAmetysObject
- Returns:
- the current step id
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCurrentStepId
Description copied from interface:WorkflowAwareAmetysObject
Set the current step id of the Ametys object- Specified by:
setCurrentStepId
in interfaceWorkflowAwareAmetysObject
- Parameters:
stepId
- the step id to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
getProposalDate
Description copied from interface:WorkflowAwareContent
Retrieves the date at which the content was proposed for validation, i.e. put in a workflow step in which it's awaiting validation.- Specified by:
getProposalDate
in interfaceWorkflowAwareContent
- Returns:
- the date at which the content was proposed for validation.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setProposalDate
Description copied from interface:WorkflowAwareContent
Set the date at which the content was proposed for validation, i.e. put in a workflow step in which it's awaiting validation.- Specified by:
setProposalDate
in interfaceWorkflowAwareContent
- Parameters:
proposalDate
- the date at which the content was proposed for validation, or null to remove it.- Throws:
AmetysRepositoryException
- if an error occurs.
-
remove
Description copied from interface:RemovableAmetysObject
Removes thisAmetysObject
from the Ametys tree.- Specified by:
remove
in interfaceRemovableAmetysObject
- Overrides:
remove
in classSimpleAmetysObject<F extends ModifiableContentFactory>
- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if thisAmetysObject
is referenced by another objects.
-
lock
Description copied from interface:LockableAmetysObject
Locks thisAmetysObject
- Specified by:
lock
in interfaceLockableAmetysObject
- Throws:
AmetysRepositoryException
- if a problem occurs
-
unlock
Description copied from interface:LockableAmetysObject
Unlocks thisAmetysObject
- Specified by:
unlock
in interfaceLockableAmetysObject
- Throws:
AmetysRepositoryException
- if a problem occurs
-
isLocked
Description copied from interface:LockAwareAmetysObject
Returns true if thisAmetysObject
is locked- Specified by:
isLocked
in interfaceLockAwareAmetysObject
- Returns:
- true if this
AmetysObject
is locked - Throws:
AmetysRepositoryException
- if a problem occurs
-
getLockOwner
Description copied from interface:LockAwareAmetysObject
Returns the owner of the lock, or null if none- Specified by:
getLockOwner
in interfaceLockAwareAmetysObject
- Returns:
- the owner of the lock, or null if none
- Throws:
AmetysRepositoryException
- if a problem occurs
-
setDCTitle
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core title.- Specified by:
setDCTitle
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
title
- the Dublin Core title to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCCreator
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core creator.- Specified by:
setDCCreator
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
creator
- the Dublin Core creator to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCSubject
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core subject.- Specified by:
setDCSubject
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
subject
- the Dublin Core subject to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCDescription
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core description.- Specified by:
setDCDescription
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
description
- the Dublin Core description to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCPublisher
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core publisher.- Specified by:
setDCPublisher
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
publisher
- the Dublin Core publisher to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCContributor
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core contributor.- Specified by:
setDCContributor
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
contributor
- the Dublin Core contributor to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCDate
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core date.- Specified by:
setDCDate
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
date
- the Dublin Core date to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCType
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core type. You can use a constant from org.ametys.plugins.repository.dublincore.DCMITypes.- Specified by:
setDCType
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
type
- the Dublin Core type to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCFormat
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core format.- Specified by:
setDCFormat
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
format
- the Dublin Core format to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCIdentifier
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core identifier.- Specified by:
setDCIdentifier
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
identifier
- the Dublin Core identifier to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCSource
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core source.- Specified by:
setDCSource
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
source
- the Dublin Core source to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCLanguage
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core language.- Specified by:
setDCLanguage
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
language
- the Dublin Core language to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCRelation
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core relation.- Specified by:
setDCRelation
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
relation
- the Dublin Core relation to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCCoverage
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core coverage.- Specified by:
setDCCoverage
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
coverage
- the Dublin Core coverage to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDCRights
Description copied from interface:ModifiableDublinCoreAwareAmetysObject
Set the Dublin Core rights.- Specified by:
setDCRights
in interfaceModifiableDublinCoreAwareAmetysObject
- Parameters:
rights
- the Dublin Core rights to set. Can be null.- Throws:
AmetysRepositoryException
- if an error occurs.
-
createComment
Description copied from interface:CommentableAmetysObject
Creates a comment- Specified by:
createComment
in interfaceCommentableAmetysObject
- Returns:
- The new comment
-
createComment
Description copied from interface:CommentableAmetysObject
Creates a comment with the given id and creation date This method allow to create a comment from existing data (ex: data import from archive) The id is not generated here, the source is trusted. Be careful using this method- Specified by:
createComment
in interfaceCommentableAmetysObject
- Parameters:
commentId
- the comment's idcreationDate
- the comment's creation date- Returns:
- the new comment
-
getComment
Description copied from interface:CommentableAmetysObject
Get a comment- Specified by:
getComment
in interfaceCommentableAmetysObject
- Parameters:
commentId
- The comment- Returns:
- The comment
- Throws:
AmetysRepositoryException
- if error occurs
-
getComments
public List<Comment> getComments(boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException Description copied from interface:CommentableAmetysObject
Get the list of available comments (validated, not validated, both or none :))- Specified by:
getComments
in interfaceCommentableAmetysObject
- Parameters:
includeNotValidatedComments
- true to get the non validated comments.includeValidatedComments
- true to get the validated comment.- Returns:
- A non null list of comments on the ametys object.
- Throws:
AmetysRepositoryException
- if an error occurred
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Overrides:
getDataHolder
in classDefaultContent<F extends ModifiableContentFactory>
- Returns:
- the
DataHolder
of thisAmetysObject
-
fillContent
public void fillContent(Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) throws Exception Description copied from interface:ModifiableContent
Fills the current content with the values from the providedNode
.
This is the anti-operation ofContent.toSAX(org.xml.sax.ContentHandler, java.util.Locale, org.ametys.runtime.model.View, boolean)
, as the Node should be a Node previously generated with SAX events from this method.- Specified by:
fillContent
in interfaceModifiableContent
- Parameters:
node
- The node to read for retrieving values to filladditionalDataGetter
- The object that will retrieve potential additional data for the content's attributes- Throws:
Exception
- if an exception occurs
-