Class TaskServiceImpl
- java.lang.Object
-
- org.exoplatform.task.service.impl.TaskServiceImpl
-
- All Implemented Interfaces:
TaskService
@Singleton public class TaskServiceImpl extends Object implements TaskService
-
-
Field Summary
-
Fields inherited from interface org.exoplatform.task.service.TaskService
TASK_COMMENT_CREATION, TASK_CREATION, TASK_UPDATE
-
-
Constructor Summary
Constructors Constructor Description TaskServiceImpl(TaskStorage taskStorage, DAOHandler daoHandler, org.exoplatform.services.listener.ListenerService listenerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeLogEntryaddTaskLog(long id, String username, String actionName, String target)Create a log associated with a task with giventaskId.voidaddWatcherToTask(String user, TaskDto task)TaskDtocloneTask(long id)Clone the task from a task with giventaskId.LongcountAssignedTasks(String user)LongcountCollaboratedTasks(String user)intcountIncomingTasks(String user)LongcountOverdueTasks(String user)longcountTasks(String user, String query)Count tasks assigned to a user using a search term to find in title or description of the taskintcountTasks(TaskQuery query)intcountTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy)List<Object[]>countTaskStatusByProject(long projectId)LongcountUncompletedTasks(String user)LongcountWatchedTasks(String user)TaskDtocreateTask(TaskDto task)Create a new task.voiddeleteWatcherOfTask(String user, TaskDto task)TasksListfilterTasks(String query, long projectId, String keyword, List<Long> labels, TaskUtil.DUE dueDate, Priority priority, List<String> assignees, List<String> coworker, 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)TaskDtofindTaskByActivityId(String id)List<TaskDto>findTasks(String user, String query, int limit)List<TaskDto>findTasks(TaskQuery query, int offset, int limit)Find tasks assigned to a user using a term to find in title or description of the taskList<TaskDto>findTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy, int offset, int limit)List<TaskDto>getAssignedTasks(String user, int limit)List<TaskDto>getCollaboratedTasks(String user, int limit)Set<String>getCoworker(long taskId)List<TaskDto>getIncomingTasks(String user, int offset, int limit)Set<String>getMentionedUsers(long taskId)List<TaskDto>getOverdueTasks(String user, int limit)TaskDtogetTask(long id)Return the task with giventaskId.List<ChangeLogEntry>getTaskLogs(long taskId, int offset, int limit)List<TaskDto>getUncompletedTasks(String user, int limit)List<TaskDto>getWatchedTasks(String user, int limit)Set<String>getWatchersOfTask(TaskDto task)booleanisExternal(String userId)voidremoveTask(long id)Remove the task with giventaskId<T> List<T>selectTaskField(TaskQuery query, String fieldName)TaskDtoupdateTask(TaskDto task)Update the task.voidupdateTaskOrder(long currentTaskId, Status newStatus, long[] orders)
-
-
-
Constructor Detail
-
TaskServiceImpl
public TaskServiceImpl(TaskStorage taskStorage, DAOHandler daoHandler, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Detail
-
createTask
public TaskDto createTask(TaskDto task)
Description copied from interface:TaskServiceCreate a new task.- Specified by:
createTaskin interfaceTaskService- Parameters:
task- the given task.- Returns:
- the created task.
-
updateTask
public TaskDto updateTask(TaskDto task)
Description copied from interface:TaskServiceUpdate the task.- Specified by:
updateTaskin interfaceTaskService- Parameters:
task- the given task.- Returns:
- TaskDto the updated task.
-
updateTaskOrder
public void updateTaskOrder(long currentTaskId, Status newStatus, long[] orders)- Specified by:
updateTaskOrderin interfaceTaskService
-
removeTask
public void removeTask(long id) throws EntityNotFoundExceptionDescription copied from interface:TaskServiceRemove the task with giventaskId- Specified by:
removeTaskin interfaceTaskService- Parameters:
id- the given task id.- Throws:
EntityNotFoundException- when task is not found.
-
cloneTask
public TaskDto cloneTask(long id) throws EntityNotFoundException
Description copied from interface:TaskServiceClone the task from a task with giventaskId.- Specified by:
cloneTaskin interfaceTaskService- Parameters:
id- the task Id- Returns:
- the cloned task.
- Throws:
EntityNotFoundException- when task is not found.
-
getTask
public TaskDto getTask(long id) throws EntityNotFoundException
Description copied from interface:TaskServiceReturn the task with giventaskId.- Specified by:
getTaskin interfaceTaskService- Parameters:
id- the task Id- Returns:
- the given task.
- Throws:
EntityNotFoundException- when task is not found.
-
getMentionedUsers
public Set<String> getMentionedUsers(long taskId)
- Specified by:
getMentionedUsersin interfaceTaskService
-
addTaskLog
public ChangeLogEntry addTaskLog(long id, String username, String actionName, String target) throws EntityNotFoundException
Description copied from interface:TaskServiceCreate a log associated with a task with giventaskId.- Specified by:
addTaskLogin interfaceTaskService- Parameters:
id- 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
public List<ChangeLogEntry> getTaskLogs(long taskId, int offset, int limit) throws Exception
- Specified by:
getTaskLogsin interfaceTaskService- Throws:
Exception
-
findTasks
public List<TaskDto> findTasks(TaskQuery query, int offset, int limit) throws Exception
Description copied from interface:TaskServiceFind tasks assigned to a user using a term to find in title or description of the task- Specified by:
findTasksin interfaceTaskService- Parameters:
query- term to search in title or descriptionoffset- term to offset results.limit- term to limit results.- Returns:
ListofTaskDto- Throws:
Exception- when therer is an exception on get tasks.
-
countTasks
public int countTasks(TaskQuery query) throws Exception
- Specified by:
countTasksin interfaceTaskService- Throws:
Exception
-
selectTaskField
public <T> List<T> selectTaskField(TaskQuery query, String fieldName)
- Specified by:
selectTaskFieldin interfaceTaskService
-
findTasksByLabel
public List<TaskDto> findTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy, int offset, int limit) throws Exception
- Specified by:
findTasksByLabelin interfaceTaskService- Throws:
Exception
-
countTasksByLabel
public int countTasksByLabel(LabelDto label, List<Long> projectIds, String username, OrderBy orderBy) throws Exception
- Specified by:
countTasksByLabelin interfaceTaskService- Throws:
Exception
-
findTaskByActivityId
public TaskDto findTaskByActivityId(String id)
- Specified by:
findTaskByActivityIdin interfaceTaskService
-
getCoworker
public Set<String> getCoworker(long taskId)
- Specified by:
getCoworkerin interfaceTaskService
-
getUncompletedTasks
public List<TaskDto> getUncompletedTasks(String user, int limit)
- Specified by:
getUncompletedTasksin interfaceTaskService
-
countUncompletedTasks
public Long countUncompletedTasks(String user)
- Specified by:
countUncompletedTasksin interfaceTaskService
-
getWatchedTasks
public List<TaskDto> getWatchedTasks(String user, int limit)
- Specified by:
getWatchedTasksin interfaceTaskService
-
countWatchedTasks
public Long countWatchedTasks(String user)
- Specified by:
countWatchedTasksin interfaceTaskService
-
getAssignedTasks
public List<TaskDto> getAssignedTasks(String user, int limit)
- Specified by:
getAssignedTasksin interfaceTaskService
-
countAssignedTasks
public Long countAssignedTasks(String user)
- Specified by:
countAssignedTasksin interfaceTaskService
-
getCollaboratedTasks
public List<TaskDto> getCollaboratedTasks(String user, int limit)
- Specified by:
getCollaboratedTasksin interfaceTaskService
-
countCollaboratedTasks
public Long countCollaboratedTasks(String user)
- Specified by:
countCollaboratedTasksin interfaceTaskService
-
findTasks
public List<TaskDto> findTasks(String user, String query, int limit)
- Specified by:
findTasksin interfaceTaskService
-
countTasks
public long countTasks(String user, String query)
Description copied from interface:TaskServiceCount tasks assigned to a user using a search term to find in title or description of the task- Specified by:
countTasksin interfaceTaskService- Parameters:
user- usernamequery- term to search in title or description- Returns:
- tasks count
-
getIncomingTasks
public List<TaskDto> getIncomingTasks(String user, int offset, int limit) throws Exception
- Specified by:
getIncomingTasksin interfaceTaskService- Throws:
Exception
-
countIncomingTasks
public int countIncomingTasks(String user) throws Exception
- Specified by:
countIncomingTasksin interfaceTaskService- Throws:
Exception
-
getOverdueTasks
public List<TaskDto> getOverdueTasks(String user, int limit)
- Specified by:
getOverdueTasksin interfaceTaskService
-
countOverdueTasks
public Long countOverdueTasks(String user)
- Specified by:
countOverdueTasksin interfaceTaskService
-
addWatcherToTask
public void addWatcherToTask(String user, TaskDto task) throws Exception
- Specified by:
addWatcherToTaskin interfaceTaskService- Throws:
Exception
-
deleteWatcherOfTask
public void deleteWatcherOfTask(String user, TaskDto task) throws Exception
- Specified by:
deleteWatcherOfTaskin interfaceTaskService- Throws:
Exception
-
getWatchersOfTask
public Set<String> getWatchersOfTask(TaskDto task)
- Specified by:
getWatchersOfTaskin interfaceTaskService
-
countTaskStatusByProject
public List<Object[]> countTaskStatusByProject(long projectId)
- Specified by:
countTaskStatusByProjectin interfaceTaskService
-
filterTasks
public TasksList filterTasks(String query, long projectId, String keyword, List<Long> labels, TaskUtil.DUE dueDate, Priority priority, List<String> assignees, List<String> coworker, 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
- Specified by:
filterTasksin interfaceTaskService- Throws:
Exception
-
isExternal
public boolean isExternal(String userId)
- Specified by:
isExternalin interfaceTaskService
-
-