Interface TaskService
- All Known Implementing Classes:
TaskServiceImpl
public interface TaskService
-
Method Summary
Modifier and TypeMethodDescriptionaddTaskLog(long taskId, String username, String actionName, String target) Create a log associated with a task with giventaskId.voidaddWatcherToTask(String username, TaskDto task) cloneTask(long taskId) Clone the task from a task with giventaskId.countAssignedTasks(String user) countCollaboratedTasks(String user) intcountIncomingTasks(String user) countOverdueTasks(String user) longcountTasks(String user, String query, List<String> memberships) Count tasks assigned to a user using a search term to find in title or description of the taskintcountTasks(TaskQuery query) intcountTaskStatusByProject(long projectId) countUncompletedTasks(String user) countWatchedTasks(String user) createTask(TaskDto task) Create a new task.voiddeleteWatcherOfTask(String username, TaskDto task) filterTasks(String query, long projectId, String keyword, List<Long> labels, TaskUtil.DUE dueDate, Priority priority, List<String> assignees, List<String> coworkers, List<String> watchers, Long labelId, Long statusId, org.exoplatform.services.security.Identity currIdentity, String dueCategory, String space_group_id, TimeZone userTimezone, boolean isShowCompleted, boolean advanceSearch, boolean noProjPermission, boolean noLblPermission, String orderBy, String groupBy, int offset, int limit) findLastUpdatedTasks(TaskQuery query, int offset, int limit) Find tasks switch last update date computed from Task Logs and Task Comments after applying theTaskQueryfilteringfindTaskByActivityId(String activityId) Find tasks assigned to a user using a term to find in title or description of the taskfindTasks(TaskSearchFilter taskFilter) Find tasks assigned to a user using a term to find in title or description of the taskfindTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy, int offset, int limit) findTasksByMemberShips(String user, List<String> memberships, String query, int limit) getAllIds(int offset, int limit) Retrieves a paginated list of all task IDs.getAssignedTasks(String user, int limit) getCollaboratedTasks(String user, int limit) getCoworker(long taskId) getIncomingTasks(String user, int offset, int limit) getMentionedUsers(long taskId) getOverdueTasks(String user, int limit) getTask(long taskId) Return the task with giventaskId.getTaskLogs(long taskId, int offset, int limit) getUncompletedTasks(String user, int limit) getWatchedTasks(String user, int limit) getWatchersOfTask(TaskDto task) booleanisExternal(String userId) Moves tasks to the given status, all or none: each task is authorized asupdateTask(long, TaskDto, Identity)does, in one transaction, so a task refused after others were written rolls those writes back.voidremoveTask(long taskId) Remove the task with giventaskId<T> List<T> selectTaskField(TaskQuery query, String fieldName) unassignTasks(List<Long> taskIds, org.exoplatform.services.security.Identity identity) Removes a user from tasks, all or none: on each task the user is no longer its assignee nor one of its coworkers, the other coworkers stay.updateTask(long taskId, TaskDto task, org.exoplatform.services.security.Identity identity) Update a task on behalf of a user.updateTask(TaskDto task) Update the task.voidupdateTaskOrder(long currentTaskId, Status newStatus, long[] orders)
-
Method Details
-
createTask
-
updateTask
-
updateTask
TaskDto updateTask(long taskId, TaskDto task, org.exoplatform.services.security.Identity identity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Update a task on behalf of a user. The permission is checked on the stored task, and the update applies to that task whatever id the given task carries. A given status is loaded by its id, and moving the task to a status of another project requires the user to view that project.- Parameters:
taskId- the id of the task to update.task- the updated task.identity- the user updating the task.- Returns:
- TaskDto the updated task.
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the task is not found.IllegalAccessException- when the user cannot edit the task, or cannot view the project of the given status.IllegalArgumentException- when the given status is not found.
-
moveTasks
List<TaskDto> moveTasks(List<Long> taskIds, long statusId, org.exoplatform.services.security.Identity identity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Moves tasks to the given status, all or none: each task is authorized asupdateTask(long, TaskDto, Identity)does, in one transaction, so a task refused after others were written rolls those writes back. The update events are broadcast once the move is committed, when no transaction is active on the caller's thread; called inside one, the move joins it and the events are broadcast before its commit. Each task sends its destination board's modification event with the board as read during the move, so an edit of the board's name, description, colour, due date, managers or participants committed in the meantime can be undone by the event's listener, as forupdateTask(TaskDto).- Parameters:
taskIds- ids of the tasks to movestatusId- id of the status the tasks takeidentity- the user moving the tasks- Returns:
- the moved tasks
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when a task is not found.IllegalAccessException- when the user cannot edit a task, or cannot view the project of the given status.IllegalArgumentException- when the given status is not found.
-
unassignTasks
List<TaskDto> unassignTasks(List<Long> taskIds, org.exoplatform.services.security.Identity identity) throws org.exoplatform.commons.exception.ObjectNotFoundException Removes a user from tasks, all or none: on each task the user is no longer its assignee nor one of its coworkers, the other coworkers stay. A task the user is neither the assignee nor a coworker of is refused, and the change is one transaction, so a task refused after others were written rolls those writes back. The update events are broadcast once the change is committed, when no transaction is active on the caller's thread; called inside one, the change joins it and the events are broadcast before its commit. Each task of a board sends that board's modification event with the board as read during the change, so an edit of the board's name, description, colour, due date, managers or participants committed in the meantime can be undone by the event's listener, as forupdateTask(TaskDto).- Parameters:
taskIds- ids of the tasks to remove the user fromidentity- the user to remove- Returns:
- the updated tasks
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when a task is not found.IllegalArgumentException- when the user is neither the assignee nor a coworker of a task.
-
updateTaskOrder
-
removeTask
Remove the task with giventaskId- Parameters:
taskId- the given task id.- Throws:
EntityNotFoundException- when task is not found.
-
cloneTask
Clone the task from a task with giventaskId.- Parameters:
taskId- the task Id- Returns:
- the cloned task.
- Throws:
EntityNotFoundException- when task is not found.
-
getTask
Return the task with giventaskId.- Parameters:
taskId- the task Id- Returns:
- the given task.
- Throws:
EntityNotFoundException- when task is not found.
-
getWatchedTasks
-
countWatchedTasks
-
getAssignedTasks
-
countAssignedTasks
-
getCollaboratedTasks
-
countCollaboratedTasks
-
findTasksByMemberShips
-
findTasks
-
countTasks
-
selectTaskField
-
findTasksByLabel
-
countTasksByLabel
-
addTaskLog
ChangeLogEntry addTaskLog(long taskId, String username, String actionName, String target) throws EntityNotFoundException Create a log associated with a task with giventaskId.- Parameters:
taskId- the given task id.username- the given username.actionName- the given action name.target- the given target.- Returns:
- add task log.
- Throws:
EntityNotFoundException- when task is not found.
-
getTaskLogs
- Throws:
Exception
-
findTaskByActivityId
-
getCoworker
-
getMentionedUsers
-
getUncompletedTasks
-
countUncompletedTasks
-
getIncomingTasks
-
countIncomingTasks
-
getOverdueTasks
-
countOverdueTasks
-
getWatchersOfTask
-
addWatcherToTask
-
deleteWatcherOfTask
-
findTasks
Find tasks assigned to a user using a term to find in title or description of the task -
countTasks
-
countTaskStatusByProject
-
filterTasks
TasksList filterTasks(String query, long projectId, String keyword, List<Long> labels, TaskUtil.DUE dueDate, Priority priority, List<String> assignees, List<String> coworkers, List<String> watchers, Long labelId, Long statusId, org.exoplatform.services.security.Identity currIdentity, String dueCategory, String space_group_id, TimeZone userTimezone, boolean isShowCompleted, boolean advanceSearch, boolean noProjPermission, boolean noLblPermission, String orderBy, String groupBy, int offset, int limit) throws Exception - Throws:
Exception
-
isExternal
-
getAllIds
-
findTasks
Find tasks assigned to a user using a term to find in title or description of the task- Parameters:
taskFilter- the task search filter- Returns:
- a list of task IDs
-
findLastUpdatedTasks
Find tasks switch last update date computed from Task Logs and Task Comments after applying theTaskQueryfiltering
-