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 String
ATTRIBUTE_ASSIGNMENTS
Attribute Assignmentsstatic String
ATTRIBUTE_ATTACHMENTS
Attribute Attachmentsstatic String
ATTRIBUTE_AUTHOR
Attribute Authorstatic String
ATTRIBUTE_CHECKLIST
Attribute CheckListstatic String
ATTRIBUTE_CHECKLIST_ISCHECKED
Attribute IsChecked for checkListstatic String
ATTRIBUTE_CHECKLIST_LABEL
Attribute Label for checkListstatic String
ATTRIBUTE_CLOSEAUTHOR
Attribute CloseAuthorstatic String
ATTRIBUTE_CLOSEDATE
Attribute CloseDatestatic String
ATTRIBUTE_CREATIONDATE
Attribute Creationdatestatic String
ATTRIBUTE_DESCRIPTION
Attribute Descriptionstatic String
ATTRIBUTE_DUEDATE
Attribute DueDatestatic String
ATTRIBUTE_ISCLOSED
Attribute IsClosedstatic String
ATTRIBUTE_LABEL
Attribute Labelstatic String
ATTRIBUTE_LASTMODIFIED
Attribute Lastmodifiedstatic String
ATTRIBUTE_STARTDATE
Attribute Startdatestatic String
ATTRIBUTE_TASK_ID
Attribute Taskidstatic String
ATTRIBUTE_TASKSLISTID
Attribute Taskidstatic String
ATTRIBUTE_TASKSLISTPOSITION
Attribute 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 void
close(boolean isClosed)
Close the taskComment
createComment()
Creates a commentComment
createComment(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 listUserIdentity
getAuthor()
Get the author of the taskList<Task.CheckItem>
getCheckList()
Get the task's check listUserIdentity
getCloseAuthor()
Get the author who close the taskLocalDate
getCloseDate()
Get the task's date of closureComment
getComment(String commentId)
Get a commentList<Comment>
getComments(boolean includeNotValidatedComments, boolean includeValidatedComments)
Get the list of available comments (validated, not validated, both or none :))ZonedDateTime
getCreationDate()
Get the task's creation date.ModifiableModelAwareDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.String
getDescription()
The description of the taskLocalDate
getDueDate()
The due date of the taskString
getLabel()
The title of the taskZonedDateTime
getLastModified()
Get the task's last modification date.Long
getPosition()
The position into the task listLocalDate
getStartDate()
The starting date of the taskSet<String>
getTags()
Retrieves current tags.String
getTaskListId()
The identifier of a task listboolean
isClosed()
True if the task is closedvoid
setAssignments(List<UserIdentity> assignments)
Set the list of user assigned to this taskvoid
setAttachments(List<Binary> attachments)
Set the task's attachments listvoid
setAuthor(UserIdentity author)
Set the author of this task.void
setCheckListItem(List<Task.CheckItem> checkItems)
Set the list of check itemvoid
setCloseAuthor(UserIdentity author)
Set the author who close the task.void
setCloseDate(LocalDate closedDate)
Set the task's date of closurevoid
setCreationDate(ZonedDateTime creationDate)
Set the post's creation date.void
setDescription(String description)
Set the description of the taskvoid
setDueDate(LocalDate dueDate)
Set the due date of the taskvoid
setLabel(String label)
Set the label of the taskvoid
setLastModified(ZonedDateTime lastModifiedDate)
Set the post's modification date.void
setPosition(Long position)
Set the position into the task listvoid
setStartDate(LocalDate startDate)
Set the starting date of the taskvoid
setTasksListId(String taskListId)
Set the identifier of a tasks listvoid
tag(String tag)
Tags.void
untag(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:Task
The identifier of a task list- Specified by:
getTaskListId
in interfaceTask
- Returns:
- The id
-
setTasksListId
public void setTasksListId(String taskListId)
Description copied from interface:Task
Set the identifier of a tasks list- Specified by:
setTasksListId
in interfaceTask
- Parameters:
taskListId
- The tasks list id
-
getPosition
public Long getPosition()
Description copied from interface:Task
The position into the task list- Specified by:
getPosition
in interfaceTask
- Returns:
- The position
-
setPosition
public void setPosition(Long position)
Description copied from interface:Task
Set the position into the task list- Specified by:
setPosition
in interfaceTask
- Parameters:
position
- The position into the task list
-
setLabel
public void setLabel(String label)
Description copied from interface:Task
Set the label of the task
-
getDescription
public String getDescription()
Description copied from interface:Task
The description of the task- Specified by:
getDescription
in interfaceTask
- Returns:
- The description
-
setDescription
public void setDescription(String description)
Description copied from interface:Task
Set the description of the task- Specified by:
setDescription
in interfaceTask
- Parameters:
description
- The description
-
getStartDate
public LocalDate getStartDate()
Description copied from interface:Task
The starting date of the task- Specified by:
getStartDate
in interfaceTask
- Returns:
- The start date
-
setStartDate
public void setStartDate(LocalDate startDate)
Description copied from interface:Task
Set the starting date of the task- Specified by:
setStartDate
in interfaceTask
- Parameters:
startDate
- The start date
-
getDueDate
public LocalDate getDueDate()
Description copied from interface:Task
The due date of the task- Specified by:
getDueDate
in interfaceTask
- Returns:
- The due date
-
setDueDate
public void setDueDate(LocalDate dueDate)
Description copied from interface:Task
Set the due date of the task- Specified by:
setDueDate
in interfaceTask
- Parameters:
dueDate
- The due date
-
isClosed
public boolean isClosed()
Description copied from interface:Task
True if the task is closed
-
getCloseAuthor
public UserIdentity getCloseAuthor()
Description copied from interface:Task
Get the author who close the task- Specified by:
getCloseAuthor
in interfaceTask
- Returns:
- the author who close the task
-
setCloseAuthor
public void setCloseAuthor(UserIdentity author)
Description copied from interface:Task
Set the author who close the task.- Specified by:
setCloseAuthor
in interfaceTask
- Parameters:
author
- the author
-
getCloseDate
public LocalDate getCloseDate()
Description copied from interface:Task
Get the task's date of closure- Specified by:
getCloseDate
in interfaceTask
- Returns:
- the task's date of closure
-
setCloseDate
public void setCloseDate(LocalDate closedDate)
Description copied from interface:Task
Set the task's date of closure- Specified by:
setCloseDate
in interfaceTask
- Parameters:
closedDate
- The date of closure
-
getAuthor
public UserIdentity getAuthor()
Description copied from interface:Task
Get the author of the task
-
setAuthor
public void setAuthor(UserIdentity author)
Description copied from interface:Task
Set the author of this task.
-
getAssignments
public List<UserIdentity> getAssignments()
Description copied from interface:Task
Get the list of user assigned to this task- Specified by:
getAssignments
in interfaceTask
- Returns:
- The assignment list
-
setAssignments
public void setAssignments(List<UserIdentity> assignments)
Description copied from interface:Task
Set the list of user assigned to this task- Specified by:
setAssignments
in interfaceTask
- Parameters:
assignments
- The assignment list
-
getCreationDate
public ZonedDateTime getCreationDate()
Description copied from interface:Task
Get the task's creation date.- Specified by:
getCreationDate
in interfaceTask
- Returns:
- the task's creation date.
-
setCreationDate
public void setCreationDate(ZonedDateTime creationDate)
Description copied from interface:Task
Set the post's creation date.- Specified by:
setCreationDate
in interfaceTask
- Parameters:
creationDate
- the post's creation date.
-
getLastModified
public ZonedDateTime getLastModified()
Description copied from interface:Task
Get the task's last modification date.- Specified by:
getLastModified
in interfaceTask
- Returns:
- the task's last modification date.
-
setLastModified
public void setLastModified(ZonedDateTime lastModifiedDate)
Description copied from interface:Task
Set the post's modification date.- Specified by:
setLastModified
in interfaceTask
- Parameters:
lastModifiedDate
- the last modification date to set.
-
getAttachments
public List<Binary> getAttachments()
Description copied from interface:Task
Get the task's attachments list- Specified by:
getAttachments
in interfaceTask
- Returns:
- the task's attachments list
-
setAttachments
public void setAttachments(List<Binary> attachments)
Description copied from interface:Task
Set the task's attachments list- Specified by:
setAttachments
in interfaceTask
- Parameters:
attachments
- the task's attachments list
-
tag
public void tag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObject
Tags.- Specified by:
tag
in 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:TaggableAmetysObject
Untags.- Specified by:
untag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to remove.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTags
public Set<String> getTags() throws AmetysRepositoryException
Description copied from interface:TagAwareAmetysObject
Retrieves current tags.- Specified by:
getTags
in interfaceTagAwareAmetysObject
- Returns:
- the current tags.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCheckList
public List<Task.CheckItem> getCheckList()
Description copied from interface:Task
Get the task's check list- Specified by:
getCheckList
in interfaceTask
- Returns:
- the task's check list
-
setCheckListItem
public void setCheckListItem(List<Task.CheckItem> checkItems)
Description copied from interface:Task
Set the list of check item- Specified by:
setCheckListItem
in interfaceTask
- Parameters:
checkItems
- the list of check item
-
createComment
public Comment createComment()
Description copied from interface:CommentableAmetysObject
Creates a comment- Specified by:
createComment
in interfaceCommentableAmetysObject
- Returns:
- The new comment
-
createComment
public Comment createComment(String commentId, ZonedDateTime creationDate)
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
- 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:CommentableAmetysObject
Get a comment- Specified by:
getComment
in 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:CommentableAmetysObject
Get the list of available comments (validated, not validated, both or none :))- Specified by:
getComments
in 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:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
-