F
- the actual type of factory.public class ModifiableDefaultContent<F extends ModifiableContentFactory> extends DefaultContent<F> implements CommentableContent, LockableAmetysObject, ModifiableWorkflowAwareContent
Content
, also versionable, lockable and workflow-aware.ReactionableObject.ReactionType
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
PROTECTED_PROPERTIES
ATTRIBUTE_TITLE, METADATA_TITLE
Constructor and Description |
---|
ModifiableDefaultContent(Node node,
String parentPath,
F factory)
Creates a JCR-based Content.
|
Modifier and Type | Method and Description |
---|---|
Comment |
createComment()
Creates a comment
|
Comment |
getComment(String commentId)
Get a comment
|
List<Comment> |
getComments(boolean includeNotValidatedComments,
boolean includeValidatedComments)
Get the list of available comments (validated, not validated, both or none :))
|
long |
getCurrentStepId()
Retrieves the current step id of the Ametys object
|
ModifiableModelAwareDataHolder |
getDataHolder()
Returns the
DataHolder of this AmetysObject . |
UserIdentity |
getLockOwner()
Returns the owner of the lock, or null if none
|
Date |
getProposalDate()
Retrieves the date at which the content was proposed for validation,
i.e.
|
long |
getWorkflowId()
Retrieves the workflow id associated with the Ametys object.
|
boolean |
isLocked()
Returns true if this
AmetysObject is locked |
void |
lock()
Locks this
AmetysObject |
void |
remove()
Removes this
AmetysObject 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 object
|
void |
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 |
setDCDate(Date date)
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 |
setDCType(String type)
Set the Dublin Core type.
|
void |
setFirstValidationDate(Date validationDate)
Set the first validation date
|
void |
setLanguage(String language)
Set the type of this Content.
This method may only be called on a new Content, ie. |
void |
setLastContributor(UserIdentity user)
Set the login of the last contributor.
|
void |
setLastMajorValidationDate(Date validationDate)
Set the last validation date resulting from a major modification
|
void |
setLastModified(Date lastModified)
Set the last modification date.
|
void |
setLastValidationDate(Date validationDate)
Set the last validation date
|
void |
setMixinTypes(String[] mixins)
Set the mixins of this Content.
|
void |
setOutgoingReferences(Map<String,OutgoingReferences> references)
Store the outgoing references of the content.
|
void |
setProposalDate(Date proposalDate)
Set the date at which the content was proposed for validation, i.e.
|
void |
setTitle(String title)
Set the title.
|
void |
setTitle(String title,
Locale locale)
Set the title from the given locale
|
void |
setTypes(String[] types)
Set the types of this Content.
|
void |
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 |
tag(String tag)
Tags.
|
void |
unlock()
Unlocks this
AmetysObject |
void |
untag(String tag)
Untags.
|
_checkLock, addReaction, 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, getDefinition, getFirstValidationDate, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getModels, getOutgoingReferences, getReactionUsers, getReferencingContents, getRootAttachments, getTags, getTitle, getTitle, getTypes, hasChild, hasReferencingContents, removeReaction
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, getAllLabels, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getAllRevisions, getBaseNode, getBaseVersion, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, getLabels, getLabels, getNode, getRevision, getRevisionTimestamp, getRevisionTimestamp, getUnversionedMetadataHolder, getVersionHistory, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers, removeLabel, restoreFromLabel, restoreFromNode, restoreFromRevision, switchToLabel, switchToRevision
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, rename, revertChanges, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComposite, getComposite, getRepeater, getRepeater, removeValue, setValue
getCreationDate, getCreator, getDefinition, getFirstValidationDate, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getRootAttachments, getTitle, getTitle, getTypes, hasReferencingContents
getType, getValue, getValue, hasValue, isMultiple
copyTo, getDataNames
toSAX, toSAX
dataToSAX, dataToSAX, dataToSAX, dataToSAX
getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType
getTags
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers
getNode
needsSave, rename, revertChanges, saveChanges
equals, getId, getName, getParent, getParentPath, getPath, hashCode
getChildAt, getChildPosition
public ModifiableDefaultContent(Node node, String parentPath, F factory)
node
- the JCR Node backing this Content.parentPath
- the parent path in the Ametys hierarchy.factory
- the corresponding ContentFactory
.public void setTypes(String[] types) throws AmetysRepositoryException
ModifiableContent
setTypes
in interface ModifiableContent
types
- the types of this content.AmetysRepositoryException
- if an error occurs.public void setMixinTypes(String[] mixins) throws AmetysRepositoryException
ModifiableContent
setMixinTypes
in interface ModifiableContent
mixins
- the mixins of this content.AmetysRepositoryException
- if an error occurs.public void setLanguage(String language) throws AmetysRepositoryException
ModifiableContent
setLanguage
in interface ModifiableContent
language
- the language of this content.AmetysRepositoryException
- if an error occurs.public void setTitle(String title, Locale locale) throws AmetysRepositoryException
ModifiableContent
setTitle
in interface ModifiableContent
title
- the title.locale
- The localeAmetysRepositoryException
- if an error occurs.public void setTitle(String title) throws AmetysRepositoryException
ModifiableContent
ModifiableContent.setTitle(String, Locale)
instead.setTitle
in interface ModifiableContent
title
- the title.AmetysRepositoryException
- if an error occurs.public void setCreator(UserIdentity user) throws AmetysRepositoryException
ModifiableContent
setCreator
in interface ModifiableContent
user
- the creator.AmetysRepositoryException
- if an error occurs.public void setCreationDate(Date creationDate) throws AmetysRepositoryException
ModifiableContent
setCreationDate
in interface ModifiableContent
creationDate
- the creation date.AmetysRepositoryException
- if an error occurs.public void setLastContributor(UserIdentity user)
ModifiableContent
setLastContributor
in interface ModifiableContent
user
- the last contributor.public void setLastModified(Date lastModified) throws AmetysRepositoryException
ModifiableContent
setLastModified
in interface ModifiableContent
lastModified
- the last modification date.AmetysRepositoryException
- if an error occurs.public void setFirstValidationDate(Date validationDate) throws AmetysRepositoryException
ModifiableContent
setFirstValidationDate
in interface ModifiableContent
validationDate
- the validation date.AmetysRepositoryException
- if an error occurs.public void setLastValidationDate(Date validationDate) throws AmetysRepositoryException
ModifiableContent
setLastValidationDate
in interface ModifiableContent
validationDate
- the validation date.AmetysRepositoryException
- if an error occurs.public void setLastMajorValidationDate(Date validationDate) throws AmetysRepositoryException
ModifiableContent
setLastMajorValidationDate
in interface ModifiableContent
validationDate
- the validation date.AmetysRepositoryException
- if an error occurs.public void setOutgoingReferences(Map<String,OutgoingReferences> references) throws AmetysRepositoryException
ModifiableContent
setOutgoingReferences
in interface ModifiableContent
references
- A non null map of outgoing references grouped by metadata (key are metadata path)AmetysRepositoryException
- if an error occurs.public void tag(String tag) throws AmetysRepositoryException
TaggableAmetysObject
tag
in interface TaggableAmetysObject
tag
- the tag to add.AmetysRepositoryException
- if an error occurs.public void untag(String tag) throws AmetysRepositoryException
TaggableAmetysObject
untag
in interface TaggableAmetysObject
tag
- the tag to remove.AmetysRepositoryException
- if an error occurs.public long getWorkflowId() throws AmetysRepositoryException
WorkflowAwareAmetysObject
getWorkflowId
in interface WorkflowAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public void setWorkflowId(long workflowId) throws AmetysRepositoryException
WorkflowAwareAmetysObject
setWorkflowId
in interface WorkflowAwareAmetysObject
workflowId
- the workflow id of the object.AmetysRepositoryException
- if an error occurs.public long getCurrentStepId() throws AmetysRepositoryException
WorkflowAwareAmetysObject
getCurrentStepId
in interface WorkflowAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public void setCurrentStepId(long stepId) throws AmetysRepositoryException
WorkflowAwareAmetysObject
setCurrentStepId
in interface WorkflowAwareAmetysObject
stepId
- the step id to setAmetysRepositoryException
- if an error occurs.public Date getProposalDate() throws AmetysRepositoryException
WorkflowAwareContent
getProposalDate
in interface WorkflowAwareContent
AmetysRepositoryException
- if an error occurs.public void setProposalDate(Date proposalDate) throws AmetysRepositoryException
WorkflowAwareContent
setProposalDate
in interface WorkflowAwareContent
proposalDate
- the date at which the content was proposed for validation, or null to remove it.AmetysRepositoryException
- if an error occurs.public void remove() throws AmetysRepositoryException, RepositoryIntegrityViolationException
RemovableAmetysObject
AmetysObject
from the Ametys tree.remove
in interface RemovableAmetysObject
remove
in class SimpleAmetysObject<F extends ModifiableContentFactory>
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if this AmetysObject
is referenced by another objects.public void lock() throws AmetysRepositoryException
LockableAmetysObject
AmetysObject
lock
in interface LockableAmetysObject
AmetysRepositoryException
- if a problem occurspublic void unlock() throws AmetysRepositoryException
LockableAmetysObject
AmetysObject
unlock
in interface LockableAmetysObject
AmetysRepositoryException
- if a problem occurspublic boolean isLocked() throws AmetysRepositoryException
LockAwareAmetysObject
AmetysObject
is lockedisLocked
in interface LockAwareAmetysObject
AmetysObject
is lockedAmetysRepositoryException
- if a problem occurspublic UserIdentity getLockOwner() throws AmetysRepositoryException
LockAwareAmetysObject
getLockOwner
in interface LockAwareAmetysObject
AmetysRepositoryException
- if a problem occurspublic void setDCTitle(String title) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCTitle
in interface ModifiableDublinCoreAwareAmetysObject
title
- the Dublin Core title to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCCreator(String creator) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCCreator
in interface ModifiableDublinCoreAwareAmetysObject
creator
- the Dublin Core creator to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCSubject(String[] subject) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCSubject
in interface ModifiableDublinCoreAwareAmetysObject
subject
- the Dublin Core subject to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCDescription(String description) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCDescription
in interface ModifiableDublinCoreAwareAmetysObject
description
- the Dublin Core description to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCPublisher(String publisher) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCPublisher
in interface ModifiableDublinCoreAwareAmetysObject
publisher
- the Dublin Core publisher to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCContributor(String contributor) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCContributor
in interface ModifiableDublinCoreAwareAmetysObject
contributor
- the Dublin Core contributor to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCDate(Date date) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCDate
in interface ModifiableDublinCoreAwareAmetysObject
date
- the Dublin Core date to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCType(String type) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCType
in interface ModifiableDublinCoreAwareAmetysObject
type
- the Dublin Core type to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCFormat(String format) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCFormat
in interface ModifiableDublinCoreAwareAmetysObject
format
- the Dublin Core format to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCIdentifier(String identifier) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCIdentifier
in interface ModifiableDublinCoreAwareAmetysObject
identifier
- the Dublin Core identifier to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCSource(String source) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCSource
in interface ModifiableDublinCoreAwareAmetysObject
source
- the Dublin Core source to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCLanguage(String language) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCLanguage
in interface ModifiableDublinCoreAwareAmetysObject
language
- the Dublin Core language to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCRelation(String relation) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCRelation
in interface ModifiableDublinCoreAwareAmetysObject
relation
- the Dublin Core relation to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCCoverage(String coverage) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCCoverage
in interface ModifiableDublinCoreAwareAmetysObject
coverage
- the Dublin Core coverage to set. Can be null.AmetysRepositoryException
- if an error occurs.public void setDCRights(String rights) throws AmetysRepositoryException
ModifiableDublinCoreAwareAmetysObject
setDCRights
in interface ModifiableDublinCoreAwareAmetysObject
rights
- the Dublin Core rights to set. Can be null.AmetysRepositoryException
- if an error occurs.public Comment createComment()
CommentableContent
createComment
in interface CommentableContent
public Comment getComment(String commentId) throws AmetysRepositoryException
CommentableContent
getComment
in interface CommentableContent
commentId
- The commentAmetysRepositoryException
- if the comment does not existpublic List<Comment> getComments(boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException
CommentableContent
getComments
in interface CommentableContent
includeNotValidatedComments
- true to get the non validated comments.includeValidatedComments
- true to get the validated comment.AmetysRepositoryException
- if an error occuredpublic ModifiableModelAwareDataHolder getDataHolder()
DataAwareAmetysObject
DataHolder
of this AmetysObject
.getDataHolder
in interface DataAwareAmetysObject
getDataHolder
in interface ModelAwareDataAwareAmetysObject
getDataHolder
in interface ModifiableModelAwareDataAwareAmetysObject
getDataHolder
in class DefaultContent<F extends ModifiableContentFactory>
DataHolder
of this AmetysObject