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
public class WorkspaceTaskDAO extends AbstractWorkspaceTaskDAO
DAO for interacting with tasks of a project
-
-
Field Summary
Fields Modifier and Type Field Description protected HTMLTransformer
_htmlTransformer
The HTML transformerprotected ProjectMemberManager
_projectMemberManager
The project member managerprotected ProjectTagsDAO
_projectTagsDAO
The project tags DAOprotected AmetysObjectResolver
_resolver
The ametys object resolverprotected ProjectTagProviderExtensionPoint
_tagProviderExtPt
The tag provider extension pointprotected TaskJSONHelper
_taskJSONHelper
The task JSON helperprotected UserManager
_userManager
The user managerstatic String
ROLE
The Avalon role-
Fields 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
Constructors Constructor Description WorkspaceTaskDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
_setTaskAttributes(JCRTask task, Map<String,Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles)
Set task's attributesMap<String,Object>
addTask(String tasksListId, Map<String,Object> parameters, List<Part> newFiles, List<String> newFileNames)
Add a new task to the tasks listMap<String,Object>
answerCommentTask(String taskId, String commentId, String commentText, String authorURL)
Answer to a task's commentMap<String,Object>
commentTask(String taskId, String commentText, String authorURL)
Comment a taskMap<String,Object>
deleteCommentTask(String taskId, String commentId)
Delete a task's commentMap<String,Object>
deleteTask(String taskId)
Remove a taskMap<String,Object>
editCommentTask(String taskId, String commentId, String commentText)
Edit a taskMap<String,Object>
editTask(String taskId, Map<String,Object> parameters, List<Part> newFiles, List<String> newFileNames, List<String> deleteFiles)
Edit a taskMap<String,Object>
getProjectMembers()
Get project membersList<Task>
getProjectTasks(Project project)
Get all tasks from given projetsList<Map<String,Object>>
getTasks()
Get the tasks from projectLong
getTasksCount(Project project)
Get the total number of tasks of the projectMap<String,Object>
likeOrUnlikeCommentTask(String taskId, String commentId, Boolean liked)
Like or unlike a task's commentMap<String,Object>
moveTask(String tasksListId, String taskId, long newPosition)
Move 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 Detail
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
_htmlTransformer
protected HTMLTransformer _htmlTransformer
The HTML transformer
-
_projectMemberManager
protected ProjectMemberManager _projectMemberManager
The project member manager
-
_tagProviderExtPt
protected ProjectTagProviderExtensionPoint _tagProviderExtPt
The tag provider extension point
-
_projectTagsDAO
protected ProjectTagsDAO _projectTagsDAO
The project tags DAO
-
_userManager
protected UserManager _userManager
The user manager
-
_taskJSONHelper
protected TaskJSONHelper _taskJSONHelper
The task JSON helper
-
-
Constructor Detail
-
WorkspaceTaskDAO
public WorkspaceTaskDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceTaskDAO
- Throws:
ServiceException
-
getTasks
public List<Map<String,Object>> getTasks() throws IllegalAccessException
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 IllegalAccessException
Add 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 IllegalAccessException
Edit 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
public Map<String,Object> deleteTask(String taskId) throws IllegalAccessException
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
public List<Task> getProjectTasks(Project project)
Get all tasks from given projets- Parameters:
project
- the project- Returns:
- All tasks as JSON
-
getTasksCount
public Long getTasksCount(Project project)
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, AmetysRepositoryException
Get project members- Returns:
- the project members
- Throws:
IllegalAccessException
- if an error occurredAmetysRepositoryException
- if an error occurred
-
-