|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.db.generic.CmsWorkflowDriver
public class CmsWorkflowDriver
Generic (ANSI-SQL) database server implementation of the workflow driver methods.
| Field Summary | |
|---|---|
protected CmsDriverManager |
m_driverManager
The driver manager. |
protected CmsSqlManager |
m_sqlManager
The SQL manager. |
protected static String |
TABLE_TASK
Table key for tasks. |
protected static String |
TABLE_TASKLOG
Table key for task logs. |
protected static String |
TABLE_TASKPAR
Table key for task par(ameter). |
protected static String |
TABLE_TASKTYPE
Table key for task type. |
| Fields inherited from interface org.opencms.db.I_CmsWorkflowDriver |
|---|
DRIVER_TYPE_ID |
| Constructor Summary | |
|---|---|
CmsWorkflowDriver()
|
|
| Method Summary | |
|---|---|
CmsTask |
createTask(CmsDbContext dbc,
int rootId,
int parentId,
int tasktype,
CmsUUID ownerId,
CmsUUID agentId,
CmsUUID roleId,
String taskname,
Timestamp wakeuptime,
Timestamp timeout,
int priority)
Creates a new task. |
void |
destroy()
Destroys this driver. |
void |
endTask(CmsDbContext dbc,
int taskId)
Ends a task. |
protected void |
finalize()
|
void |
forwardTask(CmsDbContext dbc,
int taskId,
CmsUUID newRoleId,
CmsUUID newUserId)
Forwards a task to a new user. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
void |
init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
List successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver. |
CmsSqlManager |
initSqlManager(String classname)
Initializes the SQL manager for this driver. |
protected CmsTask |
internalCreateTask(ResultSet res)
Semi-constructor to create a CmsTask instance from a JDBC result set. |
protected String |
internalReadTaskTypeCondition(boolean first,
int tasktype)
Constructs a sql condition for the given task type. |
protected void |
internalWriteTaskParameter(CmsDbContext dbc,
int parid,
String parvalue)
Updates a task parameter. |
protected int |
internalWriteTaskParameter(CmsDbContext dbc,
int taskId,
String parname,
String parvalue)
Adds a task parameter to a task. |
protected void |
internalWriteTaskType(CmsDbContext dbc,
int taskId,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
Updates a task. |
protected int |
internalWriteTaskType(CmsDbContext dbc,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
Inserts a new task. |
CmsUUID |
readAgent(CmsDbContext dbc,
CmsUUID roleId)
Finds an agent for a given role (group). |
CmsProject |
readProject(CmsDbContext dbc,
CmsTask task)
Reads a project of a given task. |
List |
readProjectLogs(CmsDbContext dbc,
int projectid)
Reads all task log entries for a project. |
CmsTask |
readTask(CmsDbContext dbc,
int id)
Reads the task with the given id. |
CmsTaskLog |
readTaskLog(CmsDbContext dbc,
int id)
Reads a log for a task. |
List |
readTaskLogs(CmsDbContext dbc,
int taskId)
Reads log entries for a task. |
String |
readTaskParameter(CmsDbContext dbc,
int taskId,
String parname)
Returns the value of the given parameter for the given task. |
List |
readTasks(CmsDbContext dbc,
CmsProject project,
CmsUser agent,
CmsUser owner,
CmsGroup role,
int tasktype,
String orderBy,
String sort)
Reads all given tasks from a user for a project. |
int |
readTaskType(CmsDbContext dbc,
String taskName)
Get the template task id fo a given taskname. |
void |
writeSystemTaskLog(CmsDbContext dbc,
int taskid,
String comment)
Writes a system task log entry. |
CmsTask |
writeTask(CmsDbContext dbc,
CmsTask task)
Writes a task. |
void |
writeTaskLog(CmsDbContext dbc,
int taskId,
CmsUUID userId,
Timestamp starttime,
String comment,
int type)
Writes new log for a task. |
void |
writeTaskParameter(CmsDbContext dbc,
int taskId,
String parname,
String parvalue)
Set a Parameter for a task. |
void |
writeTaskType(CmsDbContext dbc,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
Creates a new tasktype set in the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opencms.db.I_CmsDriver |
|---|
toString |
| Field Detail |
|---|
protected static final String TABLE_TASK
protected static final String TABLE_TASKLOG
protected static final String TABLE_TASKPAR
protected static final String TABLE_TASKTYPE
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
| Constructor Detail |
|---|
public CmsWorkflowDriver()
| Method Detail |
|---|
public CmsTask createTask(CmsDbContext dbc,
int rootId,
int parentId,
int tasktype,
CmsUUID ownerId,
CmsUUID agentId,
CmsUUID roleId,
String taskname,
Timestamp wakeuptime,
Timestamp timeout,
int priority)
throws CmsDataAccessException
I_CmsWorkflowDriver
createTask in interface I_CmsWorkflowDriverdbc - the current database contextrootId - id of the root task projectparentId - id of the parent tasktasktype - type of the taskownerId - id of the owneragentId - id of the agentroleId - id of the roletaskname - name of the taskwakeuptime - time when the task will be wake uptimeout - time when the task times outpriority - priority of the task
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.createTask(org.opencms.db.CmsDbContext, int, int, int, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, java.lang.String, java.sql.Timestamp, java.sql.Timestamp, int)
public void destroy()
throws Throwable
I_CmsWorkflowDriver
destroy in interface I_CmsWorkflowDriverThrowable - if something goes wrongI_CmsWorkflowDriver.destroy()
public void endTask(CmsDbContext dbc,
int taskId)
throws CmsDataAccessException
I_CmsWorkflowDriver
endTask in interface I_CmsWorkflowDriverdbc - the current database contexttaskId - Id of the task to end
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.endTask(org.opencms.db.CmsDbContext, int)
public void forwardTask(CmsDbContext dbc,
int taskId,
CmsUUID newRoleId,
CmsUUID newUserId)
throws CmsDataAccessException
I_CmsWorkflowDriver
forwardTask in interface I_CmsWorkflowDriverdbc - the current database contexttaskId - the Id of the task to forwardnewRoleId - the new group name for the tasknewUserId - the new user who gets the task
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.forwardTask(org.opencms.db.CmsDbContext, int, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public CmsSqlManager getSqlManager()
I_CmsWorkflowDriver
getSqlManager in interface I_CmsWorkflowDriverI_CmsWorkflowDriver.getSqlManager()
public void init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
List successiveDrivers,
CmsDriverManager driverManager)
I_CmsDriver
init in interface I_CmsDriverdbc - the current database contextconfigurationManager - the configuration managersuccessiveDrivers - a list of successive drivers to be initializeddriverManager - the initialized OpenCms driver managerI_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)public CmsSqlManager initSqlManager(String classname)
I_CmsWorkflowDriverTo obtain JDBC connections from different pools, further {online|offline|backup} pool Urls have to be specified.
initSqlManager in interface I_CmsWorkflowDriverclassname - the classname of the SQL manager
I_CmsWorkflowDriver.initSqlManager(String)
public CmsUUID readAgent(CmsDbContext dbc,
CmsUUID roleId)
throws CmsDataAccessException
I_CmsWorkflowDriver
readAgent in interface I_CmsWorkflowDriverdbc - the current database contextroleId - The Id for the role (group)
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readAgent(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsProject readProject(CmsDbContext dbc,
CmsTask task)
throws CmsDataAccessException
I_CmsWorkflowDriver
readProject in interface I_CmsWorkflowDriverdbc - the current database contexttask - the task to read the project of
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readProject(org.opencms.db.CmsDbContext, org.opencms.workflow.CmsTask)
public List readProjectLogs(CmsDbContext dbc,
int projectid)
throws CmsDataAccessException
I_CmsWorkflowDriver
readProjectLogs in interface I_CmsWorkflowDriverdbc - the current database contextprojectid - the id of the project for which the tasklog will be read
CmsTaskLog objects
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readProjectLogs(org.opencms.db.CmsDbContext, int)
public CmsTask readTask(CmsDbContext dbc,
int id)
throws CmsDataAccessException
I_CmsWorkflowDriver
readTask in interface I_CmsWorkflowDriverdbc - the current database contextid - the id for the task to read
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readTask(org.opencms.db.CmsDbContext, int)
public CmsTaskLog readTaskLog(CmsDbContext dbc,
int id)
throws CmsDataAccessException
I_CmsWorkflowDriver
readTaskLog in interface I_CmsWorkflowDriverdbc - the current database contextid - The id for the tasklog
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readTaskLog(org.opencms.db.CmsDbContext, int)
public List readTaskLogs(CmsDbContext dbc,
int taskId)
throws CmsDataAccessException
I_CmsWorkflowDriver
readTaskLogs in interface I_CmsWorkflowDriverdbc - the current satabase contexttaskId - the task for the tasklog to read
CmsTaskLog objects
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readTaskLogs(org.opencms.db.CmsDbContext, int)
public String readTaskParameter(CmsDbContext dbc,
int taskId,
String parname)
throws CmsDataAccessException
I_CmsWorkflowDriver
readTaskParameter in interface I_CmsWorkflowDriverdbc - the current database contexttaskId - the Id of the taskparname - name of the parameter
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readTaskParameter(org.opencms.db.CmsDbContext, int, java.lang.String)
public List readTasks(CmsDbContext dbc,
CmsProject project,
CmsUser agent,
CmsUser owner,
CmsGroup role,
int tasktype,
String orderBy,
String sort)
throws CmsDataAccessException
I_CmsWorkflowDriver
Most parameters can be null,
if you do not want to filter the tasks by them.
The tasktype parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL: Reads all tasksCmsTaskService.TASKS_OPEN: Reads all open tasksCmsTaskService.TASKS_DONE: Reads all finished tasksCmsTaskService.TASKS_NEW: Reads all new tasks
readTasks in interface I_CmsWorkflowDriverdbc - the current database contextproject - the id of the project in which the tasks are definedagent - the owner of the taskowner - the owner of the taskrole - 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
CmsDataAccessException - if operation was not successfulI_CmsWorkflowDriver.readTasks(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsUser, org.opencms.file.CmsUser, org.opencms.file.CmsGroup, int, java.lang.String, java.lang.String)
public int readTaskType(CmsDbContext dbc,
String taskName)
throws CmsDataAccessException
I_CmsWorkflowDriver
readTaskType in interface I_CmsWorkflowDriverdbc - the current database contexttaskName - Name of the Task
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.readTaskType(org.opencms.db.CmsDbContext, java.lang.String)
public void writeSystemTaskLog(CmsDbContext dbc,
int taskid,
String comment)
throws CmsDataAccessException
I_CmsWorkflowDriver
writeSystemTaskLog in interface I_CmsWorkflowDriverdbc - the current database contexttaskid - the id of the taskcomment - the log entry
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.writeSystemTaskLog(org.opencms.db.CmsDbContext, int, java.lang.String)
public CmsTask writeTask(CmsDbContext dbc,
CmsTask task)
throws CmsDataAccessException
I_CmsWorkflowDriver
writeTask in interface I_CmsWorkflowDriverdbc - the current database contexttask - the task to write
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.writeTask(org.opencms.db.CmsDbContext, org.opencms.workflow.CmsTask)
public void writeTaskLog(CmsDbContext dbc,
int taskId,
CmsUUID userId,
Timestamp starttime,
String comment,
int type)
throws CmsDataAccessException
I_CmsWorkflowDriver
writeTaskLog in interface I_CmsWorkflowDriverdbc - the current database contexttaskId - The id of the taskuserId - User who added the Logstarttime - Time when the log is createdcomment - Description for the logtype - Type of the log. 0 = Sytem log, 1 = User Log
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.writeTaskLog(org.opencms.db.CmsDbContext, int, org.opencms.util.CmsUUID, java.sql.Timestamp, java.lang.String, int)
public void writeTaskParameter(CmsDbContext dbc,
int taskId,
String parname,
String parvalue)
throws CmsDataAccessException
I_CmsWorkflowDriver
writeTaskParameter in interface I_CmsWorkflowDriverdbc - the current database contexttaskId - the taskparname - the name of the parameterparvalue - the value of the parameter
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.writeTaskParameter(org.opencms.db.CmsDbContext, int, java.lang.String, java.lang.String)
public void writeTaskType(CmsDbContext dbc,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsDataAccessException
I_CmsWorkflowDriver
writeTaskType in interface I_CmsWorkflowDriverdbc - the current database contextautofinish - tbdescalationtyperef - tbdhtmllink - tbdname - tbdpermission - tbdpriorityref - tbdroleref - tbd
CmsDataAccessException - if something goes wrongI_CmsWorkflowDriver.writeTaskType(org.opencms.db.CmsDbContext, int, int, java.lang.String, java.lang.String, java.lang.String, int, int)
protected void finalize()
throws Throwable
finalize in class ObjectThrowableObject.finalize()
protected CmsTask internalCreateTask(ResultSet res)
throws SQLException
res - the result set from the query
SQLException - if something goes wrong
protected String internalReadTaskTypeCondition(boolean first,
int tasktype)
first - flag to indicate the first conditiontasktype - the type to query
protected void internalWriteTaskParameter(CmsDbContext dbc,
int parid,
String parvalue)
throws CmsDataAccessException
dbc - the current database contextparid - the id of the parameterparvalue - the value of the parameter
CmsDataAccessException - if something goes wrong
protected int internalWriteTaskParameter(CmsDbContext dbc,
int taskId,
String parname,
String parvalue)
throws CmsDataAccessException
dbc - the current database contexttaskId - the id of the taskparname - the name of the parameterparvalue - the value of the parameter
CmsDataAccessException - if something goes wrong
protected void internalWriteTaskType(CmsDbContext dbc,
int taskId,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsDataAccessException
dbc - the current database contexttaskId - the id of the taskautofinish - tbdescalationtyperef - tbdhtmllink - tbdname - tbdpermission - tbdpriorityref - tbdroleref - tbd
CmsDataAccessException - if something goes wrong
protected int internalWriteTaskType(CmsDbContext dbc,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsDataAccessException
dbc - the current database contextautofinish - tbdescalationtyperef - tbdhtmllink - tbdname - tbdpermission - tbdpriorityref - tbdroleref - tbd
CmsDataAccessException - tbd
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||