Class JCRThread
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultAmetysObject<JCRThreadFactory>
org.ametys.plugins.workspaces.forum.jcr.JCRThread
- All Implemented Interfaces:
ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,IndexableDataHolder
,ModifiableIndexableDataHolder
,AttachableAmetysObject
,CommentableAmetysObject<RichTextComment>
,ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,RemovableAmetysObject
,TagAwareAmetysObject
,TaggableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
,Thread
JCR implementation of a Thread
-
Field Summary
Fields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
Fields inherited from interface org.ametys.plugins.workspaces.forum.Thread
ACCEPTED_ANSWER_COMMENT_ID, ATTRIBUTE_ATTACHMENTS, ATTRIBUTE_AUTHOR, ATTRIBUTE_CATEGORY, ATTRIBUTE_CLOSEAUTHOR, ATTRIBUTE_CLOSEDATE, ATTRIBUTE_COMMENTS, ATTRIBUTE_COMMENTS_AUTHORS, ATTRIBUTE_COMMENTS_LENTGH, ATTRIBUTE_CONTENT, ATTRIBUTE_CONTENT_ABSTRACT, ATTRIBUTE_CONTENT_FOR_EDITING, ATTRIBUTE_CONTENT_FOR_RENDERING, ATTRIBUTE_CREATIONDATE, ATTRIBUTE_ID, ATTRIBUTE_LASTCONTRIBUTION, ATTRIBUTE_LASTMODIFIED, ATTRIBUTE_TAGS, ATTRIBUTE_TITLE, HAS_UNOPENED_THREAD_NOTIFICATION, IS_AUTHOR, UNREAD_COMMENTS
-
Constructor Summary
ConstructorDescriptionJCRThread
(javax.jcr.Node node, String parentPath, JCRThreadFactory factory) Default constructor for the JCRThread -
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.Get the accepted answer.Get the attachments listGet the author of the threadThe category of the threadGet the close author of the threadGet the thread's close date.getComment
(String commentId) Get a commentgetComments
(boolean includeNotValidatedComments, boolean includeValidatedComments) Get the list of available comments (validated, not validated, both or none :))The content of the threadGet the thread's creation date.Returns theDataHolder
of thisAmetysObject
.getFlattenComments
(boolean includeNotValidatedComments, boolean includeValidatedComments) Get the list of available comments (validated, not validated, both or none :))Get the thread's last contribution date.Get the thread's last modification date.getTags()
Retrieves current tags.getTitle()
The title of the threadvoid
setAttachments
(List<Binary> attachments) Set the attachments listvoid
setAuthor
(UserIdentity author) Set the author of this thread.void
setCategory
(ThreadCategoryEnum category) Set the category of the threadvoid
setCloseAuthor
(UserIdentity author) Set the close author of this thread.void
setCloseDate
(ZonedDateTime date) Set the thread's close date.void
setContent
(RichText richText) Set the content of the threadvoid
setCreationDate
(ZonedDateTime creationDate) Set the thread's creation date.void
Set the thread's contribution date.void
setLastModified
(ZonedDateTime date) Set the thread's modification date.void
Set the title of the threadvoid
Tags.void
Untags.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.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getSystemPropertyExtensionPoint, indexData, indexData
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultiple
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
Methods inherited from interface org.ametys.cms.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRootDataHolder
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getRepositoryData, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Constructor Details
-
JCRThread
Default constructor for the JCRThread- Parameters:
node
- The thread nodeparentPath
- The parent pathfactory
- The factory
-
-
Method Details
-
getTitle
Description copied from interface:Thread
The title of the thread -
setTitle
Description copied from interface:Thread
Set the title of the thread -
getContent
Description copied from interface:Thread
The content of the thread- Specified by:
getContent
in interfaceThread
- Returns:
- The content
-
setContent
Description copied from interface:Thread
Set the content of the thread- Specified by:
setContent
in interfaceThread
- Parameters:
richText
- The content
-
getAuthor
Description copied from interface:Thread
Get the author of the thread -
setAuthor
Description copied from interface:Thread
Set the author of this thread. -
getCreationDate
Description copied from interface:Thread
Get the thread's creation date.- Specified by:
getCreationDate
in interfaceThread
- Returns:
- the thread's creation date.
-
setCreationDate
Description copied from interface:Thread
Set the thread's creation date.- Specified by:
setCreationDate
in interfaceThread
- Parameters:
creationDate
- the task's creation date.
-
getLastModified
Description copied from interface:Thread
Get the thread's last modification date.- Specified by:
getLastModified
in interfaceThread
- Returns:
- the thread's last modification date.
-
setLastModified
Description copied from interface:Thread
Set the thread's modification date.- Specified by:
setLastModified
in interfaceThread
- Parameters:
date
- the last modification date to set.
-
getLastContribution
Description copied from interface:Thread
Get the thread's last contribution date.- Specified by:
getLastContribution
in interfaceThread
- Returns:
- the thread's last contribution date.
-
setLastContribution
Description copied from interface:Thread
Set the thread's contribution date.- Specified by:
setLastContribution
in interfaceThread
- Parameters:
date
- the last contribution date to set.
-
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.
-
getTags
Description copied from interface:TagAwareAmetysObject
Retrieves current tags.- Specified by:
getTags
in interfaceTagAwareAmetysObject
- Returns:
- the current tags.
- 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
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getCategory
Description copied from interface:Thread
The category of the thread- Specified by:
getCategory
in interfaceThread
- Returns:
- The category
-
setCategory
Description copied from interface:Thread
Set the category of the thread- Specified by:
setCategory
in interfaceThread
- Parameters:
category
- The category
-
getCloseAuthor
Description copied from interface:Thread
Get the close author of the thread- Specified by:
getCloseAuthor
in interfaceThread
- Returns:
- the close author
-
setCloseAuthor
Description copied from interface:Thread
Set the close author of this thread.- Specified by:
setCloseAuthor
in interfaceThread
- Parameters:
author
- the close author
-
getCloseDate
Description copied from interface:Thread
Get the thread's close date.- Specified by:
getCloseDate
in interfaceThread
- Returns:
- the thread's close date.
-
setCloseDate
Description copied from interface:Thread
Set the thread's close date.- Specified by:
setCloseDate
in interfaceThread
- Parameters:
date
- the close date to set.
-
getAttachments
Description copied from interface:AttachableAmetysObject
Get the attachments list- Specified by:
getAttachments
in interfaceAttachableAmetysObject
- Returns:
- the attachments list
-
setAttachments
Description copied from interface:AttachableAmetysObject
Set the attachments list- Specified by:
setAttachments
in interfaceAttachableAmetysObject
- Parameters:
attachments
- the attachments list
-
createComment
Description copied from interface:CommentableAmetysObject
Creates a comment- Specified by:
createComment
in interfaceCommentableAmetysObject<RichTextComment>
- 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<RichTextComment>
- 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<RichTextComment>
- Parameters:
commentId
- The comment- Returns:
- The comment
- Throws:
AmetysRepositoryException
- if error occurs
-
getComments
public List<RichTextComment> 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<RichTextComment>
- 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
-
getAcceptedAnswer
Description copied from interface:Thread
Get the accepted answer.- Specified by:
getAcceptedAnswer
in interfaceThread
- Returns:
- the accepted answer if present, null otherwise.
-
getFlattenComments
public List<RichTextComment> getFlattenComments(boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException Description copied from interface:Thread
Get the list of available comments (validated, not validated, both or none :))- Specified by:
getFlattenComments
in interfaceThread
- 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
-