Class WorkspaceTasksListDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.tasks.AbstractWorkspaceTaskDAO
org.ametys.plugins.workspaces.tasks.WorkspaceTasksListDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
DAO for interacting with tasks list of a project
-
Field Summary
Modifier and TypeFieldDescriptionprotected static AmetysObjectResolver
The ametys object resolverprotected TasksListColorsComponent
The tasks list colors componentprotected TasksListIconsComponent
The tasks list icons componentprotected TasksListJSONHelper
The tasks list JSON helperstatic 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 TypeMethodDescriptionprotected void
_checkTasksList
(AmetysObject objectToCheck) Check the ametys object is a tasks listprotected void
_checkUserRights
(AmetysObject objectToCheck, String rightId) Check user rights_getProjectsTasksLists
(String projectName) Get the list of tasks lists from given project name_getProjectTasksLists
(Project project) Get the project tasks listsaddTasksList
(String label) Add a new tasks list to the projectdeleteTasksList
(String tasksListId) Delete a tasks listeditTasksList
(String tasksListId, String newLabel) Edit a tasks listgetChildTask
(String tasksListId) Get the child task of the tasks listGet all available colors for the tasks listGet all available icons for the tasks listGet the tasks lists from the projectmoveTasksList
(String tasksListId, long newPosition) Move tasks list to new positionvoid
service
(ServiceManager manager) updateTasksListColor
(String tasksListId, String colorId) Update the tasks list colorupdateTasksListIcon
(String tasksListId, String iconId) Update the tasks list iconMethods 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 -
_tasksListJSONHelper
The tasks list JSON helper -
_tasksListColorsComponent
The tasks list colors component -
_tasksListIconsComponent
The tasks list icons component
-
-
Constructor Details
-
WorkspaceTasksListDAO
public WorkspaceTasksListDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceTaskDAO
- Throws:
ServiceException
-
getTasksLists
Get the tasks lists from the project- Returns:
- the tasks lists
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
addTasksList
Add a new tasks list to the project- Parameters:
label
- the tasks list label- Returns:
- The tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
editTasksList
public Map<String,Object> editTasksList(String tasksListId, String newLabel) throws IllegalAccessException Edit a tasks list- Parameters:
tasksListId
- The id of the tasks list to editnewLabel
- The tasks list new label- Returns:
- The tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
deleteTasksList
Delete a tasks list- Parameters:
tasksListId
- the tasks list id to remove- Returns:
- the tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
moveTasksList
public Map<String,Object> moveTasksList(String tasksListId, long newPosition) throws IllegalAccessException Move tasks list to new position- Parameters:
tasksListId
- the tasks list id to movenewPosition
- the new position- Returns:
- The tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
getTasksListColors
Get all available colors for the tasks list- Returns:
- the colors
-
getTasksListIcons
Get all available icons for the tasks list- Returns:
- the icons
-
updateTasksListColor
public Map<String,Object> updateTasksListColor(String tasksListId, String colorId) throws IllegalAccessException Update the tasks list color- Parameters:
tasksListId
- the tasks list idcolorId
- the color id- Returns:
- The tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
updateTasksListIcon
public Map<String,Object> updateTasksListIcon(String tasksListId, String iconId) throws IllegalAccessException Update the tasks list icon- Parameters:
tasksListId
- the tasks list idiconId
- the icon id- Returns:
- The tasks list data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
_checkTasksList
Check the ametys object is a tasks list- Parameters:
objectToCheck
- the object to check
-
_checkUserRights
protected void _checkUserRights(AmetysObject objectToCheck, String rightId) throws IllegalAccessException Check user rights- Parameters:
objectToCheck
- the object to checkrightId
- the right id- Throws:
IllegalAccessException
- if a right error occurred
-
_getProjectsTasksLists
Get the list of tasks lists from given project name- Parameters:
projectName
- The project name.- Returns:
- the list of tasks lists
-
_getProjectTasksLists
Get the project tasks lists- Parameters:
project
- the project- Returns:
- the list of tasks lists
-
getChildTask
Get the child task of the tasks list- Parameters:
tasksListId
- the tasks list id- Returns:
- the list of task
-