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 aContent, 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
Constructors Constructor Description ModifiableDefaultContent(Node node, String parentPath, F factory)Creates a JCR-based Content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommentcreateComment()Creates a commentCommentcreateComment(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.voidfillContent(Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter)Fills the current content with the values from the providedNode.CommentgetComment(String commentId)Get a commentList<Comment>getComments(boolean includeNotValidatedComments, boolean includeValidatedComments)Get the list of available comments (validated, not validated, both or none :))longgetCurrentStepId()Retrieves the current step id of the Ametys objectModifiableContentDataHoldergetDataHolder()Returns theDataHolderof thisAmetysObject.UserIdentitygetLockOwner()Returns the owner of the lock, or null if noneZonedDateTimegetProposalDate()Retrieves the date at which the content was proposed for validation, i.e.longgetWorkflowId()Retrieves the workflow id associated with the Ametys object.booleanisLocked()Returns true if thisAmetysObjectis lockedvoidlock()Locks thisAmetysObjectvoidremove()Removes thisAmetysObjectfrom the Ametys tree.voidsetCreationDate(Date creationDate)Set the creation date.voidsetCreator(UserIdentity user)Set the login of the creator.voidsetCurrentStepId(long stepId)Set the current step id of the Ametys objectvoidsetDCContributor(String contributor)Set the Dublin Core contributor.voidsetDCCoverage(String coverage)Set the Dublin Core coverage.voidsetDCCreator(String creator)Set the Dublin Core creator.voidsetDCDate(Date date)Set the Dublin Core date.voidsetDCDescription(String description)Set the Dublin Core description.voidsetDCFormat(String format)Set the Dublin Core format.voidsetDCIdentifier(String identifier)Set the Dublin Core identifier.voidsetDCLanguage(String language)Set the Dublin Core language.voidsetDCPublisher(String publisher)Set the Dublin Core publisher.voidsetDCRelation(String relation)Set the Dublin Core relation.voidsetDCRights(String rights)Set the Dublin Core rights.voidsetDCSource(String source)Set the Dublin Core source.voidsetDCSubject(String[] subject)Set the Dublin Core subject.voidsetDCTitle(String title)Set the Dublin Core title.voidsetDCType(String type)Set the Dublin Core type.voidsetFirstValidationDate(Date validationDate)Set the first validation datevoidsetLastContributor(UserIdentity user)Set the login of the last contributor.voidsetLastMajorValidationDate(Date validationDate)Set the last validation date resulting from a major modificationvoidsetLastModified(Date lastModified)Set the last modification date.voidsetLastValidationDate(Date validationDate)Set the last validation datevoidsetOutgoingReferences(Map<String,OutgoingReferences> references)Store the outgoing references of the content.voidsetProposalDate(ZonedDateTime proposalDate)Set the date at which the content was proposed for validation, i.e.voidsetTitle(String title)Set the title.voidsetTitle(String title, Locale locale)Set the title from the given localevoidsetWorkflowId(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.voidtag(String tag)Tags.voidunlock()Unlocks thisAmetysObjectvoiduntag(String tag)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 Detail
-
ModifiableDefaultContent
public ModifiableDefaultContent(Node node, String parentPath, F factory)
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 Detail
-
setTitle
public void setTitle(String title, Locale locale) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the title from the given locale- Specified by:
setTitlein interfaceModifiableContent- Parameters:
title- the title.locale- The locale- Throws:
AmetysRepositoryException- if an error occurs.
-
setTitle
public void setTitle(String title) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet 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:
setTitlein interfaceModifiableContent- Parameters:
title- the title.- Throws:
AmetysRepositoryException- if an error occurs.
-
setCreator
public void setCreator(UserIdentity user) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the login of the creator.- Specified by:
setCreatorin interfaceModifiableContent- Parameters:
user- the creator.- Throws:
AmetysRepositoryException- if an error occurs.
-
setCreationDate
public void setCreationDate(Date creationDate) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the creation date.- Specified by:
setCreationDatein interfaceModifiableContent- Parameters:
creationDate- the creation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastContributor
public void setLastContributor(UserIdentity user)
Description copied from interface:ModifiableContentSet the login of the last contributor.- Specified by:
setLastContributorin interfaceModifiableContent- Parameters:
user- the last contributor.
-
setLastModified
public void setLastModified(Date lastModified) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the last modification date.- Specified by:
setLastModifiedin interfaceModifiableContent- Parameters:
lastModified- the last modification date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setFirstValidationDate
public void setFirstValidationDate(Date validationDate) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the first validation date- Specified by:
setFirstValidationDatein interfaceModifiableContent- Parameters:
validationDate- the validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastValidationDate
public void setLastValidationDate(Date validationDate) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the last validation date- Specified by:
setLastValidationDatein interfaceModifiableContent- Parameters:
validationDate- the validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastMajorValidationDate
public void setLastMajorValidationDate(Date validationDate) throws AmetysRepositoryException
Description copied from interface:ModifiableContentSet the last validation date resulting from a major modification- Specified by:
setLastMajorValidationDatein interfaceModifiableContent- Parameters:
validationDate- the validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setOutgoingReferences
public void setOutgoingReferences(Map<String,OutgoingReferences> references) throws AmetysRepositoryException
Description copied from interface:ModifiableContentStore the outgoing references of the content.- Specified by:
setOutgoingReferencesin interfaceModifiableContent- Parameters:
references- A non null map of outgoing references grouped by metadata (key are metadata path)- Throws:
AmetysRepositoryException- if an error occurs.
-
tag
public void tag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObjectTags.- Specified by:
tagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to add.- Throws:
AmetysRepositoryException- if an error occurs.
-
untag
public void untag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObjectUntags.- Specified by:
untagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to remove.- Throws:
AmetysRepositoryException- if an error occurs.
-
getWorkflowId
public long getWorkflowId() throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectRetrieves the workflow id associated with the Ametys object.- Specified by:
getWorkflowIdin interfaceWorkflowAwareAmetysObject- Returns:
- the workflow id.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setWorkflowId
public void setWorkflowId(long workflowId) throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectSet 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:
setWorkflowIdin interfaceWorkflowAwareAmetysObject- Parameters:
workflowId- the workflow id of the object.- Throws:
AmetysRepositoryException- if an error occurs.
-
getCurrentStepId
public long getCurrentStepId() throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectRetrieves the current step id of the Ametys object- Specified by:
getCurrentStepIdin interfaceWorkflowAwareAmetysObject- Returns:
- the current step id
- Throws:
AmetysRepositoryException- if an error occurs.
-
setCurrentStepId
public void setCurrentStepId(long stepId) throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectSet the current step id of the Ametys object- Specified by:
setCurrentStepIdin interfaceWorkflowAwareAmetysObject- Parameters:
stepId- the step id to set- Throws:
AmetysRepositoryException- if an error occurs.
-
getProposalDate
public ZonedDateTime getProposalDate() throws AmetysRepositoryException
Description copied from interface:WorkflowAwareContentRetrieves 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:
getProposalDatein interfaceWorkflowAwareContent- Returns:
- the date at which the content was proposed for validation.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setProposalDate
public void setProposalDate(ZonedDateTime proposalDate) throws AmetysRepositoryException
Description copied from interface:WorkflowAwareContentSet 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:
setProposalDatein 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
public void remove() throws AmetysRepositoryException, RepositoryIntegrityViolationException
Description copied from interface:RemovableAmetysObjectRemoves thisAmetysObjectfrom the Ametys tree.- Specified by:
removein interfaceRemovableAmetysObject- Overrides:
removein classSimpleAmetysObject<F extends ModifiableContentFactory>- Throws:
AmetysRepositoryException- if an error occurs.RepositoryIntegrityViolationException- if thisAmetysObjectis referenced by another objects.
-
lock
public void lock() throws AmetysRepositoryException
Description copied from interface:LockableAmetysObjectLocks thisAmetysObject- Specified by:
lockin interfaceLockableAmetysObject- Throws:
AmetysRepositoryException- if a problem occurs
-
unlock
public void unlock() throws AmetysRepositoryException
Description copied from interface:LockableAmetysObjectUnlocks thisAmetysObject- Specified by:
unlockin interfaceLockableAmetysObject- Throws:
AmetysRepositoryException- if a problem occurs
-
isLocked
public boolean isLocked() throws AmetysRepositoryException
Description copied from interface:LockAwareAmetysObjectReturns true if thisAmetysObjectis locked- Specified by:
isLockedin interfaceLockAwareAmetysObject- Returns:
- true if this
AmetysObjectis locked - Throws:
AmetysRepositoryException- if a problem occurs
-
getLockOwner
public UserIdentity getLockOwner() throws AmetysRepositoryException
Description copied from interface:LockAwareAmetysObjectReturns the owner of the lock, or null if none- Specified by:
getLockOwnerin interfaceLockAwareAmetysObject- Returns:
- the owner of the lock, or null if none
- Throws:
AmetysRepositoryException- if a problem occurs
-
setDCTitle
public void setDCTitle(String title) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core title.- Specified by:
setDCTitlein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
title- the Dublin Core title to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCCreator
public void setDCCreator(String creator) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core creator.- Specified by:
setDCCreatorin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
creator- the Dublin Core creator to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCSubject
public void setDCSubject(String[] subject) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core subject.- Specified by:
setDCSubjectin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
subject- the Dublin Core subject to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCDescription
public void setDCDescription(String description) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core description.- Specified by:
setDCDescriptionin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
description- the Dublin Core description to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCPublisher
public void setDCPublisher(String publisher) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core publisher.- Specified by:
setDCPublisherin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
publisher- the Dublin Core publisher to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCContributor
public void setDCContributor(String contributor) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core contributor.- Specified by:
setDCContributorin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
contributor- the Dublin Core contributor to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCDate
public void setDCDate(Date date) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core date.- Specified by:
setDCDatein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
date- the Dublin Core date to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCType
public void setDCType(String type) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core type. You can use a constant from org.ametys.plugins.repository.dublincore.DCMITypes.- Specified by:
setDCTypein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
type- the Dublin Core type to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCFormat
public void setDCFormat(String format) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core format.- Specified by:
setDCFormatin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
format- the Dublin Core format to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCIdentifier
public void setDCIdentifier(String identifier) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core identifier.- Specified by:
setDCIdentifierin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
identifier- the Dublin Core identifier to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCSource
public void setDCSource(String source) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core source.- Specified by:
setDCSourcein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
source- the Dublin Core source to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCLanguage
public void setDCLanguage(String language) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core language.- Specified by:
setDCLanguagein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
language- the Dublin Core language to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCRelation
public void setDCRelation(String relation) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core relation.- Specified by:
setDCRelationin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
relation- the Dublin Core relation to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCCoverage
public void setDCCoverage(String coverage) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core coverage.- Specified by:
setDCCoveragein interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
coverage- the Dublin Core coverage to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
setDCRights
public void setDCRights(String rights) throws AmetysRepositoryException
Description copied from interface:ModifiableDublinCoreAwareAmetysObjectSet the Dublin Core rights.- Specified by:
setDCRightsin interfaceModifiableDublinCoreAwareAmetysObject- Parameters:
rights- the Dublin Core rights to set. Can be null.- Throws:
AmetysRepositoryException- if an error occurs.
-
createComment
public Comment createComment()
Description copied from interface:CommentableAmetysObjectCreates a comment- Specified by:
createCommentin interfaceCommentableAmetysObject- Returns:
- The new comment
-
createComment
public Comment createComment(String commentId, ZonedDateTime creationDate)
Description copied from interface:CommentableAmetysObjectCreates 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:
createCommentin interfaceCommentableAmetysObject- Parameters:
commentId- the comment's idcreationDate- the comment's creation date- Returns:
- the new comment
-
getComment
public Comment getComment(String commentId) throws AmetysRepositoryException
Description copied from interface:CommentableAmetysObjectGet a comment- Specified by:
getCommentin 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:CommentableAmetysObjectGet the list of available comments (validated, not validated, both or none :))- Specified by:
getCommentsin 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
public ModifiableContentDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Overrides:
getDataHolderin classDefaultContent<F extends ModifiableContentFactory>- Returns:
- the
DataHolderof thisAmetysObject
-
fillContent
public void fillContent(Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) throws Exception
Description copied from interface:ModifiableContentFills 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:
fillContentin 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
-
-