|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workflow.CmsTaskService
Just a convenience wrapper for workflow related methods.
Field Summary | |
protected CmsRequestContext |
m_context
The request context. |
protected CmsSecurityManager |
m_securityManager
The security manager to access the cms. |
static java.lang.String |
TASK_FILTER
Task preferences filter. |
static java.lang.String |
TASK_MESSAGES
Task preferences message flags. |
static int |
TASK_MESSAGES_ACCEPTED
state values of task messages when accepted. |
static int |
TASK_MESSAGES_COMPLETED
state values of task messages when completed. |
static int |
TASK_MESSAGES_FORWARDED
state values of task messages when forwarded. |
static int |
TASK_MESSAGES_MEMBERS
state values of task messages when members. |
static int |
TASK_PRIORITY_HIGH
Task priority high. |
static int |
TASK_PRIORITY_LOW
Task priority low. |
static int |
TASK_PRIORITY_NORMAL
Task priority normal. |
static int |
TASK_STATE_ENDED
state values of a task ended. |
static int |
TASK_STATE_HALTED
state values of a task halted. |
static int |
TASK_STATE_NOTENDED
state values of a task ready to end. |
static int |
TASK_STATE_PREPARE
state values of a task prepared to start. |
static int |
TASK_STATE_START
state values of a task ready to start. |
static int |
TASK_STATE_STARTED
state values of a task started. |
static int |
TASKLOG_SYSTEM
System type values for the task log. |
static int |
TASKLOG_USER
User type value for the task log. |
static int |
TASKS_ACTIVE
Task type value of getting active tasks. |
static int |
TASKS_ALL
Task type value of getting all tasks. |
static int |
TASKS_DONE
Task type value of getting done tasks. |
static int |
TASKS_NEW
Task type value of getting new tasks. |
static int |
TASKS_OPEN
Task type value of getting open tasks. |
Constructor Summary | |
CmsTaskService(CmsRequestContext context,
CmsSecurityManager securityManager)
Creates a new . |
Method Summary | |
void |
acceptTask(int taskId)
Updates the state of the given task as accepted by the current user. |
CmsTask |
createTask(int projectid,
java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
java.lang.String taskcomment,
int tasktype,
long timeout,
int priority)
Creates a new task. |
CmsTask |
createTask(java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
long timeout,
int priority)
Creates a new task. |
void |
endTask(int taskid)
Ends a task. |
void |
forwardTask(int taskid,
java.lang.String newRoleName,
java.lang.String newUserName)
Forwards a task to a new user. |
java.lang.String |
getTaskPar(int taskid,
java.lang.String parname)
Returns the value of the given parameter for the given task. |
int |
getTaskType(java.lang.String taskname)
Returns the template task id for a given taskname. |
void |
reactivateTask(int taskId)
Reactivates a task. |
CmsUser |
readAgent(CmsTask task)
Reads the agent of a task. |
java.util.List |
readGivenTasks(int projectId,
java.lang.String ownerName,
int taskType,
java.lang.String orderBy,
java.lang.String sort)
Reads all given tasks from a user for a project. |
CmsGroup |
readGroup(CmsTask task)
Reads the group (role) of a task. |
CmsUser |
readOriginalAgent(CmsTask task)
Reads the original agent of a task. |
CmsUser |
readOwner(CmsTask task)
Reads the owner (initiator) of a task. |
CmsUser |
readOwner(CmsTaskLog log)
Reads the owner of a task log. |
CmsProject |
readProject(CmsTask task)
Reads a project of a given task. |
java.util.List |
readProjectLogs(int projectId)
Reads all task log entries for a project. |
CmsTask |
readTask(int id)
Reads the task with the given id. |
java.util.List |
readTaskLogs(int taskid)
Reads log entries for a task. |
java.util.List |
readTasksForProject(int projectId,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a project. |
java.util.List |
readTasksForRole(int projectId,
java.lang.String roleName,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a role in a project. |
java.util.List |
readTasksForUser(int projectId,
java.lang.String userName,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a user in a project. |
void |
setName(int taskId,
java.lang.String name)
Sets a new name for a task. |
void |
setPriority(int taskId,
int priority)
Sets the priority of a task. |
void |
setTaskPar(int taskid,
java.lang.String parname,
java.lang.String parvalue)
Sets a parameter for a task. |
void |
setTimeout(int taskId,
long timeout)
Sets the timeout of a task. |
void |
writeTaskLog(int taskid,
java.lang.String comment)
Writes a new user tasklog for a task. |
void |
writeTaskLog(int taskId,
java.lang.String comment,
int taskType)
Writes a new user tasklog for a task. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TASK_FILTER
public static final java.lang.String TASK_MESSAGES
public static final int TASK_MESSAGES_ACCEPTED
public static final int TASK_MESSAGES_COMPLETED
public static final int TASK_MESSAGES_FORWARDED
public static final int TASK_MESSAGES_MEMBERS
public static final int TASK_PRIORITY_HIGH
public static final int TASK_PRIORITY_LOW
public static final int TASK_PRIORITY_NORMAL
public static final int TASK_STATE_ENDED
public static final int TASK_STATE_HALTED
public static final int TASK_STATE_NOTENDED
public static final int TASK_STATE_PREPARE
public static final int TASK_STATE_START
public static final int TASK_STATE_STARTED
public static final int TASKLOG_SYSTEM
public static final int TASKLOG_USER
public static final int TASKS_ACTIVE
public static final int TASKS_ALL
public static final int TASKS_DONE
public static final int TASKS_NEW
public static final int TASKS_OPEN
protected CmsRequestContext m_context
protected CmsSecurityManager m_securityManager
Constructor Detail |
public CmsTaskService(CmsRequestContext context, CmsSecurityManager securityManager)
CmsTaskService
.
context
- the request context that contains the user authentificationsecurityManager
- the security managerMethod Detail |
public void acceptTask(int taskId) throws CmsException
taskId
- the id of the task to accept
CmsException
- if operation was not successfulpublic CmsTask createTask(int projectid, java.lang.String agentName, java.lang.String roleName, java.lang.String taskname, java.lang.String taskcomment, int tasktype, long timeout, int priority) throws CmsException
projectid
- the id of the current project task of the useragentName
- the user who will edit the taskroleName
- a usergroup for the tasktaskname
- a name of the tasktasktype
- the type of the tasktaskcomment
- a description of the task, which is written as task log entrytimeout
- the time when the task must finishedpriority
- the id for the priority of the task
CmsException
- if something goes wrongpublic CmsTask createTask(java.lang.String agentName, java.lang.String roleName, java.lang.String taskname, long timeout, int priority) throws CmsException
This is just a more limited version of the
method, where: createTask(int, String, String, String, String, int, long, int)
agentName
- the user who will edit the taskroleName
- a usergroup for the tasktaskname
- the name of the tasktimeout
- the time when the task must finishedpriority
- the id for the priority of the task
CmsException
- if something goes wrongpublic void endTask(int taskid) throws CmsException
taskid
- the id of the task to end
CmsException
- if operation was not successfulpublic void forwardTask(int taskid, java.lang.String newRoleName, java.lang.String newUserName) throws CmsException
taskid
- the id of the task which will be forwardednewRoleName
- the new group for the tasknewUserName
- the new user who gets the task. if it is empty, a new agent will automatic selected
CmsException
- if operation was not successfulpublic java.lang.String getTaskPar(int taskid, java.lang.String parname) throws CmsException
taskid
- the id of the taskparname
- the name of the parameter
CmsException
- if operation was not successfulpublic int getTaskType(java.lang.String taskname) throws CmsException
taskname
- the name of the task
CmsException
- if operation was not successfulpublic void reactivateTask(int taskId) throws CmsException
Setting its state to
and
the percentage to zero.TASK_STATE_STARTED
taskId
- the id of the task to reactivate
CmsException
- if something goes wrongpublic CmsUser readAgent(CmsTask task) throws CmsException
task
- the task to read the agent from
CmsException
- if something goes wrongpublic java.util.List readGivenTasks(int projectId, java.lang.String ownerName, int taskType, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
TASKS_ALL
: Reads all tasksTASKS_OPEN
: Reads all open tasksTASKS_DONE
: Reads all finished tasksTASKS_NEW
: Reads all new tasks
projectId
- the id of the project in which the tasks are definedownerName
- the owner of the tasktaskType
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sorting of the tasks
CmsTask
objects for a user for a project
CmsException
- if operation was not successfulpublic CmsGroup readGroup(CmsTask task) throws CmsException
task
- the task to read the group (role) from
CmsException
- if something goes wrongpublic CmsUser readOriginalAgent(CmsTask task) throws CmsException
task
- the task to read the original agent from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsTask task) throws CmsException
task
- the task to read the owner from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsTaskLog log) throws CmsException
log
- the task log
CmsException
- if something goes wrongpublic CmsProject readProject(CmsTask task) throws CmsException
task
- the task for which the project will be read
CmsException
- if operation was not successfulpublic java.util.List readProjectLogs(int projectId) throws CmsException
projectId
- the id of the project for which the tasklog will be read
CmsTaskLog
objects
CmsException
- if operation was not successfulpublic CmsTask readTask(int id) throws CmsException
id
- the id of the task to be read
CmsException
- if operation was not successfulpublic java.util.List readTaskLogs(int taskid) throws CmsException
taskid
- the task for which the tasklog will be read
CmsTaskLog
objects
CmsException
- if operation was not successfulpublic java.util.List readTasksForProject(int projectId, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values are:
TASKS_ALL
: Reads all tasksTASKS_OPEN
: Reads all open tasksTASKS_DONE
: Reads all finished tasksTASKS_NEW
: Reads all new tasks
projectId
- the id of the project in which the tasks are defined. Can be null to select all taskstasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order: C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the project
CmsException
- if operation was not successfulpublic java.util.List readTasksForRole(int projectId, java.lang.String roleName, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
TASKS_ALL
: Reads all tasksTASKS_OPEN
: Reads all open tasksTASKS_DONE
: Reads all finished tasksTASKS_NEW
: Reads all new tasks
projectId
- the id of the Project in which the tasks are definedroleName
- the role who has to process the tasktasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the role
CmsException
- if operation was not successfulpublic java.util.List readTasksForUser(int projectId, java.lang.String userName, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
TASKS_ALL
: Reads all tasksTASKS_OPEN
: Reads all open tasksTASKS_DONE
: Reads all finished tasksTASKS_NEW
: Reads all new tasks
projectId
- the id of the Project in which the tasks are defineduserName
- the user who has to process the tasktasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the user
CmsException
- if operation was not successfulpublic void setName(int taskId, java.lang.String name) throws CmsException
taskId
- the id of the taskname
- the new name of the task
CmsException
- if something goes wrongpublic void setPriority(int taskId, int priority) throws CmsException
taskId
- the id of the taskpriority
- the new priority value
CmsException
- if something goes wrongpublic void setTaskPar(int taskid, java.lang.String parname, java.lang.String parvalue) throws CmsException
taskid
- the id of the taskparname
- the name of the parameterparvalue
- the value of the parameter
CmsException
- if something goes wrongpublic void setTimeout(int taskId, long timeout) throws CmsException
taskId
- the id of the tasktimeout
- the new timeout value
CmsException
- if something goes wrongpublic void writeTaskLog(int taskid, java.lang.String comment) throws CmsException
taskid
- the Id of the taskcomment
- the description for the log
CmsException
- if operation was not successfulpublic void writeTaskLog(int taskId, java.lang.String comment, int taskType) throws CmsException
taskId
- the id of the taskcomment
- the description for the logtaskType
- the type of the tasklog, user task types must be greater than 100
CmsException
- if something goes wrong
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |