Class WorkspaceTaskDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.explorer.tasks.jcr.JCRTasksDAO
org.ametys.plugins.workspaces.tasks.WorkspaceTaskDAO
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Contextualizable
,Serviceable
DAO for interacting with tasks of a project
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.explorer.tasks.jcr.JCRTasksDAO
JCRTasksDAO.TaskListResult
-
Field Summary
Fields inherited from class org.ametys.plugins.explorer.tasks.jcr.JCRTasksDAO
_currentUserProvider, _explorerResourcesDAO, _observationManager, _resolver, _rightManager, _userHelper, _userManager, RIGHTS_ADD_TASK, RIGHTS_DELETE_ALL_TASK, RIGHTS_DELETE_TASK, RIGHTS_EDIT_TASK, RIGHTS_VIEW_TASKS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_projectToJson
(Project project) Retrieve the project JSON dataAdd a new task to the current projectvoid
contextualize
(Context context) protected Project
getParentProject
(Task task) Get the parent project of a taskgetProjectTaskList
(List<String> projectNames, boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) Get the list of tasksgetProjectTasks
(boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) Get the tasks of the current projectgetProjectTasks
(List<String> projectNames, boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) Get the list of tasksTransform a task to JSON dataprotected String
getTaskDescription
(Task task) Get the description of a task as a Stringprotected String
Get the description of a task to edit as a StringgetTasksCount
(Project project) Get the total number of tasks of the projectvoid
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.protected void
setTaskDescription
(ModifiableTask task, String description) Update the description of a taskMethods inherited from class org.ametys.plugins.explorer.tasks.jcr.JCRTasksDAO
_assignmentToJSON, _setTaskParameters, _subscribersToJSON, addTask, assignTasks, deleteTasks, editTask, getTask, getTaskList, getTasks, getTasksXpathQuery, setTasksProgress, setTasksStatus
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
WorkspaceTaskDAO
public WorkspaceTaskDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classJCRTasksDAO
- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
addTask
Add a new task to the current project- Parameters:
parameters
- The task parameters- Returns:
- The task data
- Throws:
IllegalAccessException
- If an error occurs
-
getProjectTaskList
public JCRTasksDAO.TaskListResult getProjectTaskList(List<String> projectNames, boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) throws ProcessingException Get the list of tasks- Parameters:
projectNames
- The project that contain the tasks. Can be null to search in all project.assignedToUser
- Filter only the tasks assigned to the current useruserSubscribed
- Filter only the tasks for which current user subscribedoffset
- Offset the list of resultslimit
- The maximum number of results to returnfilter
- Return only tasks matching the filterorderBy
- Order the list by this property. Default to the creation dateorderAsc
- Sort the list by order ascendant or descendant. Default to ascendant.- Returns:
- The list as a
JCRTasksDAO.TaskListResult
object - Throws:
ProcessingException
- If an error occurred
-
getProjectTasks
public Map<String,Object> getProjectTasks(List<String> projectNames, boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) throws ProcessingException Get the list of tasks- Parameters:
projectNames
- The project that contain the tasks. Can be null to search in all project.assignedToUser
- Filter only the tasks assigned to the current useruserSubscribed
- Filter only the tasks for which current user subscribedoffset
- Offset the list of resultslimit
- The maximum number of results to returnfilter
- Return only tasks matching the filterorderBy
- Order the list by this property. Default to the creation dateorderAsc
- Sort the list by order ascendant or descendant. Default to ascendant.- Returns:
- The list of tasks
- Throws:
ProcessingException
- If an error occurred
-
getProjectTasks
public Map<String,Object> getProjectTasks(boolean assignedToUser, boolean userSubscribed, Integer offset, Integer limit, String filter, String orderBy, Boolean orderAsc) throws IllegalAccessException, ProcessingException Get the tasks of the current project- Parameters:
assignedToUser
- True to filter only the tasks assigned to the current useruserSubscribed
- Filter only the tasks for which current user subscribedoffset
- Start the list of tasks at the Nth task, used for paginationlimit
- Only return a maximum of N tasks, used for paginationfilter
- Return only tasks matching the filterorderBy
- Order the list by this property. Default to the creation dateorderAsc
- Sort the list by order ascendant or descendant. Default to ascendant.- Returns:
- The list of tasks
- Throws:
IllegalAccessException
- If the user is not authorizedProcessingException
- If an error occurred
-
setTaskDescription
Description copied from class:JCRTasksDAO
Update the description of a task- Overrides:
setTaskDescription
in classJCRTasksDAO
- Parameters:
task
- The task to updatedescription
- The description as string
-
getTaskDescription
Description copied from class:JCRTasksDAO
Get the description of a task as a String- Overrides:
getTaskDescription
in classJCRTasksDAO
- Parameters:
task
- the task- Returns:
- The content as String
- Throws:
AmetysRepositoryException
- if failed to parse description
-
getTaskDescriptionForEdition
Description copied from class:JCRTasksDAO
Get the description of a task to edit as a String- Overrides:
getTaskDescriptionForEdition
in classJCRTasksDAO
- Parameters:
task
- the task- Returns:
- The content as String
- Throws:
AmetysRepositoryException
- if failed to parse description
-
getTask
Description copied from class:JCRTasksDAO
Transform a task to JSON data- Overrides:
getTask
in classJCRTasksDAO
- Parameters:
task
- The taskisEdition
- true to get the task in edit mode- Returns:
- The JSON data
-
getParentProject
Get the parent project of a task- Parameters:
task
- The task- Returns:
- the project or
null
if not found
-
_projectToJson
Retrieve the project JSON data- Parameters:
project
- The project- Returns:
- The data
-
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
-