Class JCRThread
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<JCRThreadFactory>
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
__VERSION_COMPARATOR, PROTECTED_PROPERTIESFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIXFields 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
ConstructorsConstructorDescriptionJCRThread(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 theDataHolderof 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 threadvoidsetAttachments(List<Binary> attachments) Set the attachments listvoidsetAuthor(UserIdentity author) Set the author of this thread.voidsetCategory(ThreadCategoryEnum category) Set the category of the threadvoidsetCloseAuthor(UserIdentity author) Set the close author of this thread.voidsetCloseDate(ZonedDateTime date) Set the thread's close date.voidsetContent(RichText richText) Set the content of the threadvoidsetCreationDate(ZonedDateTime creationDate) Set the thread's creation date.voidSet the thread's contribution date.voidsetLastModified(ZonedDateTime date) Set the thread's modification date.voidSet the title of the threadvoidTags.voidUntags.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, switchToRevisionMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAXMethods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getSystemPropertyExtensionPoint, indexData, indexDataMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultipleMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryDataMethods inherited from interface org.ametys.cms.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRootDataHolderMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getRepositoryData, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValuesMethods 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:ThreadThe title of the thread -
setTitle
Description copied from interface:ThreadSet the title of the thread -
getContent
Description copied from interface:ThreadThe content of the thread- Specified by:
getContentin interfaceThread- Returns:
- The content
-
setContent
Description copied from interface:ThreadSet the content of the thread- Specified by:
setContentin interfaceThread- Parameters:
richText- The content
-
getAuthor
Description copied from interface:ThreadGet the author of the thread -
setAuthor
Description copied from interface:ThreadSet the author of this thread. -
getCreationDate
Description copied from interface:ThreadGet the thread's creation date.- Specified by:
getCreationDatein interfaceThread- Returns:
- the thread's creation date.
-
setCreationDate
Description copied from interface:ThreadSet the thread's creation date.- Specified by:
setCreationDatein interfaceThread- Parameters:
creationDate- the task's creation date.
-
getLastModified
Description copied from interface:ThreadGet the thread's last modification date.- Specified by:
getLastModifiedin interfaceThread- Returns:
- the thread's last modification date.
-
setLastModified
Description copied from interface:ThreadSet the thread's modification date.- Specified by:
setLastModifiedin interfaceThread- Parameters:
date- the last modification date to set.
-
getLastContribution
Description copied from interface:ThreadGet the thread's last contribution date.- Specified by:
getLastContributionin interfaceThread- Returns:
- the thread's last contribution date.
-
setLastContribution
Description copied from interface:ThreadSet the thread's contribution date.- Specified by:
setLastContributionin interfaceThread- Parameters:
date- the last contribution date to set.
-
tag
Description copied from interface:TaggableAmetysObjectTags.- Specified by:
tagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to add.- Throws:
AmetysRepositoryException- if an error occurs.
-
untag
Description copied from interface:TaggableAmetysObjectUntags.- Specified by:
untagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to remove.- Throws:
AmetysRepositoryException- if an error occurs.
-
getTags
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Specified by:
getTagsin interfaceTagAwareAmetysObject- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
getCategory
Description copied from interface:ThreadThe category of the thread- Specified by:
getCategoryin interfaceThread- Returns:
- The category
-
setCategory
Description copied from interface:ThreadSet the category of the thread- Specified by:
setCategoryin interfaceThread- Parameters:
category- The category
-
getCloseAuthor
Description copied from interface:ThreadGet the close author of the thread- Specified by:
getCloseAuthorin interfaceThread- Returns:
- the close author
-
setCloseAuthor
Description copied from interface:ThreadSet the close author of this thread.- Specified by:
setCloseAuthorin interfaceThread- Parameters:
author- the close author
-
getCloseDate
Description copied from interface:ThreadGet the thread's close date.- Specified by:
getCloseDatein interfaceThread- Returns:
- the thread's close date.
-
setCloseDate
Description copied from interface:ThreadSet the thread's close date.- Specified by:
setCloseDatein interfaceThread- Parameters:
date- the close date to set.
-
getAttachments
Description copied from interface:AttachableAmetysObjectGet the attachments list- Specified by:
getAttachmentsin interfaceAttachableAmetysObject- Returns:
- the attachments list
-
setAttachments
Description copied from interface:AttachableAmetysObjectSet the attachments list- Specified by:
setAttachmentsin interfaceAttachableAmetysObject- Parameters:
attachments- the attachments list
-
createComment
Description copied from interface:CommentableAmetysObjectCreates a comment- Specified by:
createCommentin interfaceCommentableAmetysObject<RichTextComment>- Returns:
- The new comment
-
createComment
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<RichTextComment>- Parameters:
commentId- the comment's idcreationDate- the comment's creation date- Returns:
- the new comment
-
getComment
Description copied from interface:CommentableAmetysObjectGet a comment- Specified by:
getCommentin 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:CommentableAmetysObjectGet the list of available comments (validated, not validated, both or none :))- Specified by:
getCommentsin 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:ThreadGet the accepted answer.- Specified by:
getAcceptedAnswerin interfaceThread- Returns:
- the accepted answer if present, null otherwise.
-
getFlattenComments
public List<RichTextComment> getFlattenComments(boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException Description copied from interface:ThreadGet the list of available comments (validated, not validated, both or none :))- Specified by:
getFlattenCommentsin 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
-