Package com.podio.task
Class TaskAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.task.TaskAPI
-
public class TaskAPI extends BaseAPI
Tasks are used to track what work has to be done. Tasks have the following properties:- Tasks can be stand-alone or can be attached to other objects.
- Tasks can be delegated to other users of Hoist.
- Tasks can be private or public. When private, only the creator, the assignee and assignor can see the task.
- Tasks can have a due date, which is the target date for completion. When tasks miss their due date, they become over-due.
- Tasks can be started on or not started on. This is used to indicate to other users if the task is in progress.
- active: The task is active and not yet completed
- completed: The task is completed
- assign: Reassign the task to another user to make that user responsible for the task
- update due date: Update the due date of the task
- update text: Update the text of the task
- update private: Make the task private or public
- start: Indicate that worked have started on the task
- stop: Indicate that work have been stopped
- complete: Mark the task as completed
- incomplete: Mark the task as being incomplete
-
-
Constructor Summary
Constructors Constructor Description TaskAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignTask(int taskId, int responsible)Assigns the task to another user.voidcompleteTask(int taskId)Mark the given task as completed.intcreateTask(TaskCreate task, boolean silent)Creates a new task with no reference to other objects.intcreateTask(TaskCreate task, boolean silent, boolean hook)Creates a new task with no reference to other objects.intcreateTaskWithReference(TaskCreate task, Reference reference, boolean silent)Creates a new task with a reference to the given object.intcreateTaskWithReference(TaskCreate task, Reference reference, boolean silent, boolean hook)Creates a new task with a reference to the given object.TasksByDuegetActiveTasks()Returns the active tasks of the user.TasksByDuegetAssignedActiveTasks()Returns the tasks that the user has assigned to another user.List<Task>getCompletedTasks()Returns the tasks that is completed and where the active user is responsible.TaskgetTask(int taskId)Returns the task with the given id.List<Task>getTasksWithReference(Reference reference)Gets a list of tasks with a reference to the given object.voidincompleteTask(int taskId)Mark the completed task as no longer being completed.voidupdateDueDate(int taskId, org.joda.time.LocalDate dueDate)Updates the due date of the task to the given valuevoidupdatePrivate(int taskId, boolean priv)Update the private flag on the given task.voidupdateText(int taskId, String text)Updates the text of the task.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
TaskAPI
public TaskAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
getTask
public Task getTask(int taskId)
Returns the task with the given id.- Parameters:
taskId- The id of the task to retrieve- Returns:
- The retrieved task
-
assignTask
public void assignTask(int taskId, int responsible)Assigns the task to another user. This makes the user responsible for the task and its completion.- Parameters:
taskId- The id of the task to assignresponsible- The id of the user the task should be assigned to
-
completeTask
public void completeTask(int taskId)
Mark the given task as completed.- Parameters:
taskId- The id of the task to nark as complete
-
incompleteTask
public void incompleteTask(int taskId)
Mark the completed task as no longer being completed.- Parameters:
taskId- The id of the task to mark as incomplete
-
updateDueDate
public void updateDueDate(int taskId, org.joda.time.LocalDate dueDate)Updates the due date of the task to the given value- Parameters:
taskId- The id of the taskdueDate- The new due date of the task
-
updatePrivate
public void updatePrivate(int taskId, boolean priv)Update the private flag on the given task.- Parameters:
taskId- The id of the taskpriv-trueif the task should be private,falseotherwise
-
updateText
public void updateText(int taskId, String text)Updates the text of the task.- Parameters:
taskId- The id of the tasktext- The new text of the task
-
createTask
public int createTask(TaskCreate task, boolean silent)
Creates a new task with no reference to other objects.- Parameters:
task- The data of the task to be createdsilent- Disable notifications- Returns:
- The id of the newly created task
-
createTask
public int createTask(TaskCreate task, boolean silent, boolean hook)
Creates a new task with no reference to other objects.- Parameters:
task- The data of the task to be createdsilent- Disable notificationshook- Execute hooks for the change- Returns:
- The id of the newly created task
-
createTaskWithReference
public int createTaskWithReference(TaskCreate task, Reference reference, boolean silent)
Creates a new task with a reference to the given object.- Parameters:
task- The data of the task to be createdreference- The reference to the object the task should be attached tosilent- Disable notifications- Returns:
- The id of the newly created task
-
createTaskWithReference
public int createTaskWithReference(TaskCreate task, Reference reference, boolean silent, boolean hook)
Creates a new task with a reference to the given object.- Parameters:
task- The data of the task to be createdreference- The reference to the object the task should be attached tosilent- Disable notificationshook- Execute hooks for the change- Returns:
- The id of the newly created task
-
getTasksWithReference
public List<Task> getTasksWithReference(Reference reference)
Gets a list of tasks with a reference to the given object. This will return both active and completed tasks. The reference will not be set on the individual tasks.- Parameters:
reference- The object on which to return tasks- Returns:
- The list of tasks
-
getActiveTasks
public TasksByDue getActiveTasks()
Returns the active tasks of the user. This is the tasks where the user is responsible. The tasks will be sorted by due date and creation time, and grouped by their due date status.- Returns:
- The tasks grouped by due date
-
getAssignedActiveTasks
public TasksByDue getAssignedActiveTasks()
Returns the tasks that the user has assigned to another user.- Returns:
- The tasks grouped by due date
-
-