|
Daisy Open Source CMS | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DocumentTaskManager
The DocumentTaskManager is concerned with the execution of a certain task on a set of documents. The task is executed in a background-thread. The task is executed once for each document in the set, and the state of execution for each document is tracked individually. This execution progress is recorded persistently, so it is possible to see afterwards if the task has run on all documents, and what the outcome was (succesful or error), even after server restarts.
The run-information of a task can afterwards be explicitely deleted, or the implementation of DocumentTaskManager may provide automatic cleanup based on an expiration interval.
This is an optional repository extension component.
The DocumentTaskManager is obtained from the Repository as
follows:
DocumentTaskManager docTaskManager = (WorkflowManager)repository.getExtension("DocumentTaskManager");
In the remote repository API, the DocumentTaskManager extension can be registered as follows:
RemoteRepositoryManager repositoryManager = ...;
repositoryManager.registerExtension("DocumentTaskManager",
new Packages.org.outerj.daisy.doctaskrunner.clientimpl.RemoteDocumentTaskManagerProvider());
| Method Summary | |
|---|---|
DocumentSelection |
createEnumerationDocumentSelection(VariantKey[] variantKeys)
|
DocumentSelection |
createQueryDocumentSelection(String query)
|
SimpleActionsTaskSpecification |
createSimpleActionsTaskSpecification(String description,
boolean stopOnFirstError)
|
TaskSpecification |
createTaskSpecification(String description,
String script,
String scriptLanguage,
boolean stopOnFirstError)
|
void |
deleteTask(long id)
Deletes a task. |
Task |
getTask(long id)
|
TaskDocDetails |
getTaskDocDetails(long taskId)
|
Tasks |
getTasks()
For non-administrator users, this returns all tasks belonging to the user. |
void |
interruptTask(long id)
Interrupts a task (i.e. |
long |
runTask(DocumentSelection documentSelection,
TaskSpecification taskSpecification)
Runs a task. |
| Method Detail |
|---|
long runTask(DocumentSelection documentSelection,
TaskSpecification taskSpecification)
throws TaskException,
RepositoryException
The documentSelection can be created via createEnumerationDocumentSelection(org.outerj.daisy.repository.VariantKey[])
or createQueryDocumentSelection(String).
The taskSpecification can be created via createTaskSpecification(String, String, String, boolean) or
createSimpleActionsTaskSpecification(String, boolean).
Non-administrator users can only run tasks created via createSimpleActionsTaskSpecification(String, boolean), since
using generic scripting languages nasty things can be done (infinite loops, calling System.exit, etc.).
After creation of the task, this method returns immediatelly. The state of the task
can then be queried using the getTask(long) method.
TaskException
RepositoryException
Task getTask(long id)
throws TaskException,
RepositoryException
TaskException
RepositoryException
Tasks getTasks()
throws TaskException,
RepositoryException
TaskException
RepositoryException
void deleteTask(long id)
throws TaskException,
RepositoryException
TaskException
RepositoryException
void interruptTask(long id)
throws TaskException,
RepositoryException
TaskException
RepositoryException
TaskDocDetails getTaskDocDetails(long taskId)
throws TaskException,
RepositoryException
TaskException
RepositoryException
TaskSpecification createTaskSpecification(String description,
String script,
String scriptLanguage,
boolean stopOnFirstError)
SimpleActionsTaskSpecification createSimpleActionsTaskSpecification(String description,
boolean stopOnFirstError)
DocumentSelection createQueryDocumentSelection(String query)
DocumentSelection createEnumerationDocumentSelection(VariantKey[] variantKeys)
variantKeys - should not contain any duplicates
|
Daisy Open Source CMS | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||