Class WorkspaceTaskDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceDAO
org.ametys.plugins.workspaces.tasks.AbstractWorkspaceTaskDAO
org.ametys.plugins.workspaces.tasks.WorkspaceTaskDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
DAO for interacting with tasks of a project
-
Field Summary
Modifier and TypeFieldDescriptionprotected HTMLTransformer
The HTML transformerprotected ProjectMemberManager
The project member managerprotected ProjectTagProviderExtensionPoint
The tag provider extension pointprotected TaskJSONHelper
The task JSON helperprotected WorkspaceTasksListDAO
The task list DAOstatic final String
The Avalon roleFields inherited from class org.ametys.plugins.workspaces.tasks.AbstractWorkspaceTaskDAO
RIGHTS_COMMENT_TASK, RIGHTS_DELETE_COMMENT_TASK, RIGHTS_DELETE_TASK, RIGHTS_DELETE_TASK_LIST, RIGHTS_HANDLE_TASK, RIGHTS_HANDLE_TASK_LIST
Fields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_setTaskAttributes
(JCRTask task, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles) Set task's attributesaddTask
(String tasksListId, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames) Add a new task to the tasks listanswerCommentTask
(String taskId, String commentId, String commentText) Answer to a task's commentcommentTask
(String taskId, String commentText) Comment a taskdeleteCommentTask
(String taskId, String commentId) Delete a task's commentdeleteTask
(String taskId) Remove a taskeditCommentTask
(String taskId, String commentId, String commentText) Edit a task commenteditTask
(String taskId, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles) Edit a taskGet project membersgetProjectTasks
(Project project) Get all tasks from given projetsgetTasks()
Get the tasks from projectgetTasksCount
(Project project) Get the total number of tasks of the projectlikeOrUnlikeCommentTask
(String taskId, String commentId, Boolean liked) Like or unlike a task's commentMove task to new positionvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.tasks.AbstractWorkspaceTaskDAO
_getModuleRoot, _getTasksListsRoot, _getTasksRoot, getUserRights
Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkUserReadingRights, _checkUserRights, _getProject, _getProjectName, _getSitemapLanguage, _getSiteName, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, likeOrUnlikeComment
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
_htmlTransformer
The HTML transformer -
_projectMemberManager
The project member manager -
_tagProviderExtPt
The tag provider extension point -
_taskJSONHelper
The task JSON helper -
_workspaceTasksListDAO
The task list DAO
-
-
Constructor Details
-
WorkspaceTaskDAO
public WorkspaceTaskDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceDAO
- Throws:
ServiceException
-
getTasks
Get the tasks from project- Returns:
- the list of tasks
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
addTask
public Map<String,Object> addTask(String tasksListId, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames) throws IllegalAccessExceptionAdd a new task to the tasks list- Parameters:
tasksListId
- the tasks list idparameters
- The task parametersnewFiles
- the files to addnewFileNames
- the file names to add- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
editTask
public Map<String,Object> editTask(String taskId, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles) throws IllegalAccessExceptionEdit a task- Parameters:
taskId
- The id of the task to editparameters
- The JS parametersnewFiles
- the new file to addnewFileNames
- the file names to adddeleteFiles
- the file to delete- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
moveTask
public Map<String,Object> moveTask(String tasksListId, String taskId, long newPosition) throws IllegalAccessException Move task to new position- Parameters:
tasksListId
- the tasks list idtaskId
- the task id to movenewPosition
- the new position- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
deleteTask
Remove a task- Parameters:
taskId
- the task id to remove- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
commentTask
public Map<String,Object> commentTask(String taskId, String commentText) throws IllegalAccessException Comment a task- Parameters:
taskId
- the task idcommentText
- the comment text- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
editCommentTask
public Map<String,Object> editCommentTask(String taskId, String commentId, String commentText) throws IllegalAccessException Edit a task comment- Parameters:
taskId
- the task idcommentId
- the comment IdcommentText
- the comment text- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
answerCommentTask
public Map<String,Object> answerCommentTask(String taskId, String commentId, String commentText) throws IllegalAccessException Answer to a task's comment- Parameters:
taskId
- the task idcommentId
- the comment idcommentText
- the comment text- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
deleteCommentTask
public Map<String,Object> deleteCommentTask(String taskId, String commentId) throws IllegalAccessException Delete a task's comment- Parameters:
taskId
- the task idcommentId
- the comment id- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
likeOrUnlikeCommentTask
public Map<String,Object> likeOrUnlikeCommentTask(String taskId, String commentId, Boolean liked) throws IllegalAccessException Like or unlike a task's comment- Parameters:
taskId
- the task idcommentId
- the comment idliked
- true if the comment is liked, otherwise the comment is unliked- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
_setTaskAttributes
protected Map<String,Object> _setTaskAttributes(JCRTask task, Map<String, Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles) Set task's attributes- Parameters:
task
- The task to editparameters
- The JS parametersnewFiles
- the new file to add to the tasknewFileNames
- the new file names to add to the taskdeleteFiles
- the file to remove from the task- Returns:
- the map of results
-
getProjectTasks
Get all tasks from given projets- Parameters:
project
- the project- Returns:
- All tasks as JSON
-
getTasksCount
Get the total number of tasks of the project- Parameters:
project
- The project- Returns:
- The number of tasks, or null if the module is not activated
-
getProjectMembers
public Map<String,Object> getProjectMembers() throws IllegalAccessException, AmetysRepositoryExceptionGet project members- Returns:
- the project members
- Throws:
IllegalAccessException
- if an error occurredAmetysRepositoryException
- if an error occurred
-