Class WorkspaceTaskDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
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 ProjectTagsDAO
The project tags DAOprotected AmetysObjectResolver
The ametys object resolverprotected ProjectTagProviderExtensionPoint
The tag provider extension pointprotected TaskJSONHelper
The task JSON helperprotected UserManager
The user managerstatic final String
The Avalon roleFields inherited from class org.ametys.plugins.workspaces.tasks.AbstractWorkspaceTaskDAO
_context, _currentUserProvider, _moduleEP, _observationManager, _projectManager, _rightManager, RIGHTS_COMMENT_TASK, RIGHTS_DELETE_COMMENT_TASK, RIGHTS_DELETE_TASK, RIGHTS_DELETE_TASK_LIST, RIGHTS_HANDLE_TASK, RIGHTS_HANDLE_TASK_LIST
-
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, String authorURL) Answer to a task's commentcommentTask
(String taskId, String commentText, String authorURL) 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 taskeditTask
(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, _getProjectName, _getSitemapLanguage, _getSiteName, _getTasksListsRoot, _getTasksRoot, contextualize, getUserRights
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
_resolver
The ametys object resolver -
_htmlTransformer
The HTML transformer -
_projectMemberManager
The project member manager -
_tagProviderExtPt
The tag provider extension point -
_projectTagsDAO
The project tags DAO -
_userManager
The user manager -
_taskJSONHelper
The task JSON helper
-
-
Constructor Details
-
WorkspaceTaskDAO
public WorkspaceTaskDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceTaskDAO
- 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, String authorURL) throws IllegalAccessException Comment a task- Parameters:
taskId
- the task idcommentText
- the comment textauthorURL
- the author URL- 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- 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, String authorURL) throws IllegalAccessException Answer to a task's comment- Parameters:
taskId
- the task idcommentId
- the comment idcommentText
- the comment textauthorURL
- the author URL- 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
-