Class JCRTask
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultAmetysObject<JCRTaskFactory>
-
- org.ametys.plugins.workspaces.tasks.jcr.JCRTask
-
- All Implemented Interfaces:
CommentableAmetysObject,ACLAmetysObject,AmetysObject,DataAwareAmetysObject,ModelAwareDataAwareAmetysObject,ModifiableModelAwareDataAwareAmetysObject,DataHolder,ModelAwareDataHolder,ModifiableDataHolder,ModifiableModelAwareDataHolder,JCRAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,RemovableAmetysObject,TagAwareAmetysObject,TaggableAmetysObject,DataAndVersionAwareAmetysObject,ModifiableDataAwareVersionableAmetysObject,VersionableAmetysObject,VersionAwareAmetysObject,Task
public class JCRTask extends DefaultAmetysObject<JCRTaskFactory> implements Task
JCR implementation of a task
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.plugins.workspaces.tasks.Task
Task.CheckItem
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_ASSIGNMENTSAttribute Assignmentsstatic StringATTRIBUTE_ATTACHMENTSAttribute Attachmentsstatic StringATTRIBUTE_AUTHORAttribute Authorstatic StringATTRIBUTE_CHECKLISTAttribute CheckListstatic StringATTRIBUTE_CHECKLIST_ISCHECKEDAttribute IsChecked for checkListstatic StringATTRIBUTE_CHECKLIST_LABELAttribute Label for checkListstatic StringATTRIBUTE_CLOSEAUTHORAttribute CloseAuthorstatic StringATTRIBUTE_CLOSEDATEAttribute CloseDatestatic StringATTRIBUTE_CREATIONDATEAttribute Creationdatestatic StringATTRIBUTE_DESCRIPTIONAttribute Descriptionstatic StringATTRIBUTE_DUEDATEAttribute DueDatestatic StringATTRIBUTE_ISCLOSEDAttribute IsClosedstatic StringATTRIBUTE_LABELAttribute Labelstatic StringATTRIBUTE_LASTMODIFIEDAttribute Lastmodifiedstatic StringATTRIBUTE_STARTDATEAttribute Startdatestatic StringATTRIBUTE_TASK_IDAttribute Taskidstatic StringATTRIBUTE_TASKSLISTIDAttribute Taskidstatic StringATTRIBUTE_TASKSLISTPOSITIONAttribute Taskid-
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
-
-
Constructor Summary
Constructors Constructor Description JCRTask(Node node, String parentPath, JCRTaskFactory factory)Default constructor for the JCRTask
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(boolean isClosed)Close the taskCommentcreateComment()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.List<UserIdentity>getAssignments()Get the list of user assigned to this taskList<Binary>getAttachments()Get the task's attachments listUserIdentitygetAuthor()Get the author of the taskList<Task.CheckItem>getCheckList()Get the task's check listUserIdentitygetCloseAuthor()Get the author who close the taskLocalDategetCloseDate()Get the task's date of closureCommentgetComment(String commentId)Get a commentList<Comment>getComments(boolean includeNotValidatedComments, boolean includeValidatedComments)Get the list of available comments (validated, not validated, both or none :))ZonedDateTimegetCreationDate()Get the task's creation date.ModifiableModelAwareDataHoldergetDataHolder()Returns theDataHolderof thisAmetysObject.StringgetDescription()The description of the taskLocalDategetDueDate()The due date of the taskStringgetLabel()The title of the taskZonedDateTimegetLastModified()Get the task's last modification date.LonggetPosition()The position into the task listLocalDategetStartDate()The starting date of the taskSet<String>getTags()Retrieves current tags.StringgetTaskListId()The identifier of a task listbooleanisClosed()True if the task is closedvoidsetAssignments(List<UserIdentity> assignments)Set the list of user assigned to this taskvoidsetAttachments(List<Binary> attachments)Set the task's attachments listvoidsetAuthor(UserIdentity author)Set the author of this task.voidsetCheckListItem(List<Task.CheckItem> checkItems)Set the list of check itemvoidsetCloseAuthor(UserIdentity author)Set the author who close the task.voidsetCloseDate(LocalDate closedDate)Set the task's date of closurevoidsetCreationDate(ZonedDateTime creationDate)Set the post's creation date.voidsetDescription(String description)Set the description of the taskvoidsetDueDate(LocalDate dueDate)Set the due date of the taskvoidsetLabel(String label)Set the label of the taskvoidsetLastModified(ZonedDateTime lastModifiedDate)Set the post's modification date.voidsetPosition(Long position)Set the position into the task listvoidsetStartDate(LocalDate startDate)Set the starting date of the taskvoidsetTasksListId(String taskListId)Set the identifier of a tasks listvoidtag(String tag)Tags.voiduntag(String tag)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, dataToSAX, dataToSAX
-
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.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
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.RemovableAmetysObject
remove
-
-
-
-
Field Detail
-
ATTRIBUTE_TASK_ID
public static final String ATTRIBUTE_TASK_ID
Attribute Taskid- See Also:
- Constant Field Values
-
ATTRIBUTE_TASKSLISTID
public static final String ATTRIBUTE_TASKSLISTID
Attribute Taskid- See Also:
- Constant Field Values
-
ATTRIBUTE_TASKSLISTPOSITION
public static final String ATTRIBUTE_TASKSLISTPOSITION
Attribute Taskid- See Also:
- Constant Field Values
-
ATTRIBUTE_LABEL
public static final String ATTRIBUTE_LABEL
Attribute Label- See Also:
- Constant Field Values
-
ATTRIBUTE_DESCRIPTION
public static final String ATTRIBUTE_DESCRIPTION
Attribute Description- See Also:
- Constant Field Values
-
ATTRIBUTE_STARTDATE
public static final String ATTRIBUTE_STARTDATE
Attribute Startdate- See Also:
- Constant Field Values
-
ATTRIBUTE_DUEDATE
public static final String ATTRIBUTE_DUEDATE
Attribute DueDate- See Also:
- Constant Field Values
-
ATTRIBUTE_ISCLOSED
public static final String ATTRIBUTE_ISCLOSED
Attribute IsClosed- See Also:
- Constant Field Values
-
ATTRIBUTE_CLOSEDATE
public static final String ATTRIBUTE_CLOSEDATE
Attribute CloseDate- See Also:
- Constant Field Values
-
ATTRIBUTE_CLOSEAUTHOR
public static final String ATTRIBUTE_CLOSEAUTHOR
Attribute CloseAuthor- See Also:
- Constant Field Values
-
ATTRIBUTE_AUTHOR
public static final String ATTRIBUTE_AUTHOR
Attribute Author- See Also:
- Constant Field Values
-
ATTRIBUTE_ASSIGNMENTS
public static final String ATTRIBUTE_ASSIGNMENTS
Attribute Assignments- See Also:
- Constant Field Values
-
ATTRIBUTE_CREATIONDATE
public static final String ATTRIBUTE_CREATIONDATE
Attribute Creationdate- See Also:
- Constant Field Values
-
ATTRIBUTE_LASTMODIFIED
public static final String ATTRIBUTE_LASTMODIFIED
Attribute Lastmodified- See Also:
- Constant Field Values
-
ATTRIBUTE_ATTACHMENTS
public static final String ATTRIBUTE_ATTACHMENTS
Attribute Attachments- See Also:
- Constant Field Values
-
ATTRIBUTE_CHECKLIST
public static final String ATTRIBUTE_CHECKLIST
Attribute CheckList- See Also:
- Constant Field Values
-
ATTRIBUTE_CHECKLIST_LABEL
public static final String ATTRIBUTE_CHECKLIST_LABEL
Attribute Label for checkList- See Also:
- Constant Field Values
-
ATTRIBUTE_CHECKLIST_ISCHECKED
public static final String ATTRIBUTE_CHECKLIST_ISCHECKED
Attribute IsChecked for checkList- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRTask
public JCRTask(Node node, String parentPath, JCRTaskFactory factory)
Default constructor for the JCRTask- Parameters:
node- The task nodeparentPath- The parent pathfactory- The factory
-
-
Method Detail
-
getTaskListId
public String getTaskListId()
Description copied from interface:TaskThe identifier of a task list- Specified by:
getTaskListIdin interfaceTask- Returns:
- The id
-
setTasksListId
public void setTasksListId(String taskListId)
Description copied from interface:TaskSet the identifier of a tasks list- Specified by:
setTasksListIdin interfaceTask- Parameters:
taskListId- The tasks list id
-
getPosition
public Long getPosition()
Description copied from interface:TaskThe position into the task list- Specified by:
getPositionin interfaceTask- Returns:
- The position
-
setPosition
public void setPosition(Long position)
Description copied from interface:TaskSet the position into the task list- Specified by:
setPositionin interfaceTask- Parameters:
position- The position into the task list
-
setLabel
public void setLabel(String label)
Description copied from interface:TaskSet the label of the task
-
getDescription
public String getDescription()
Description copied from interface:TaskThe description of the task- Specified by:
getDescriptionin interfaceTask- Returns:
- The description
-
setDescription
public void setDescription(String description)
Description copied from interface:TaskSet the description of the task- Specified by:
setDescriptionin interfaceTask- Parameters:
description- The description
-
getStartDate
public LocalDate getStartDate()
Description copied from interface:TaskThe starting date of the task- Specified by:
getStartDatein interfaceTask- Returns:
- The start date
-
setStartDate
public void setStartDate(LocalDate startDate)
Description copied from interface:TaskSet the starting date of the task- Specified by:
setStartDatein interfaceTask- Parameters:
startDate- The start date
-
getDueDate
public LocalDate getDueDate()
Description copied from interface:TaskThe due date of the task- Specified by:
getDueDatein interfaceTask- Returns:
- The due date
-
setDueDate
public void setDueDate(LocalDate dueDate)
Description copied from interface:TaskSet the due date of the task- Specified by:
setDueDatein interfaceTask- Parameters:
dueDate- The due date
-
isClosed
public boolean isClosed()
Description copied from interface:TaskTrue if the task is closed
-
getCloseAuthor
public UserIdentity getCloseAuthor()
Description copied from interface:TaskGet the author who close the task- Specified by:
getCloseAuthorin interfaceTask- Returns:
- the author who close the task
-
setCloseAuthor
public void setCloseAuthor(UserIdentity author)
Description copied from interface:TaskSet the author who close the task.- Specified by:
setCloseAuthorin interfaceTask- Parameters:
author- the author
-
getCloseDate
public LocalDate getCloseDate()
Description copied from interface:TaskGet the task's date of closure- Specified by:
getCloseDatein interfaceTask- Returns:
- the task's date of closure
-
setCloseDate
public void setCloseDate(LocalDate closedDate)
Description copied from interface:TaskSet the task's date of closure- Specified by:
setCloseDatein interfaceTask- Parameters:
closedDate- The date of closure
-
getAuthor
public UserIdentity getAuthor()
Description copied from interface:TaskGet the author of the task
-
setAuthor
public void setAuthor(UserIdentity author)
Description copied from interface:TaskSet the author of this task.
-
getAssignments
public List<UserIdentity> getAssignments()
Description copied from interface:TaskGet the list of user assigned to this task- Specified by:
getAssignmentsin interfaceTask- Returns:
- The assignment list
-
setAssignments
public void setAssignments(List<UserIdentity> assignments)
Description copied from interface:TaskSet the list of user assigned to this task- Specified by:
setAssignmentsin interfaceTask- Parameters:
assignments- The assignment list
-
getCreationDate
public ZonedDateTime getCreationDate()
Description copied from interface:TaskGet the task's creation date.- Specified by:
getCreationDatein interfaceTask- Returns:
- the task's creation date.
-
setCreationDate
public void setCreationDate(ZonedDateTime creationDate)
Description copied from interface:TaskSet the post's creation date.- Specified by:
setCreationDatein interfaceTask- Parameters:
creationDate- the post's creation date.
-
getLastModified
public ZonedDateTime getLastModified()
Description copied from interface:TaskGet the task's last modification date.- Specified by:
getLastModifiedin interfaceTask- Returns:
- the task's last modification date.
-
setLastModified
public void setLastModified(ZonedDateTime lastModifiedDate)
Description copied from interface:TaskSet the post's modification date.- Specified by:
setLastModifiedin interfaceTask- Parameters:
lastModifiedDate- the last modification date to set.
-
getAttachments
public List<Binary> getAttachments()
Description copied from interface:TaskGet the task's attachments list- Specified by:
getAttachmentsin interfaceTask- Returns:
- the task's attachments list
-
setAttachments
public void setAttachments(List<Binary> attachments)
Description copied from interface:TaskSet the task's attachments list- Specified by:
setAttachmentsin interfaceTask- Parameters:
attachments- the task's attachments list
-
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.
-
getTags
public Set<String> getTags() throws AmetysRepositoryException
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Specified by:
getTagsin interfaceTagAwareAmetysObject- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getCheckList
public List<Task.CheckItem> getCheckList()
Description copied from interface:TaskGet the task's check list- Specified by:
getCheckListin interfaceTask- Returns:
- the task's check list
-
setCheckListItem
public void setCheckListItem(List<Task.CheckItem> checkItems)
Description copied from interface:TaskSet the list of check item- Specified by:
setCheckListItemin interfaceTask- Parameters:
checkItems- the list of check item
-
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 ModifiableModelAwareDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
-