Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated task reporting for DS-3989

...

The complete list of options:

optionmeaning
-t tasknamename of task to perform.
-T filenamename of file containing a list of tasknames to be performed.
-e epersonID

(email address or netid) will be the superuser if unspecified.

-i identifierID of object to curate.  May be (1) a Handle, (2) a workflow ID, or (3) 'all' to operate on the whole repository.
-q queuename of queue to process.  -i and -q are mutually exclusive.
-l limitmaximum number of objects in Context cache.  If absent, unlimited objects may be added.
-s scopedeclare a scope for database transactions.  Scope must be: (1) 'open' (default value), (2) 'curation' or (3) 'object'.
-vemit verbose output
-r
-
filenameemit reporting to the named file.  '-r -' writes reporting to standard out.  If not specified, report is discarded silently.
-p name=valueset a runtime task parameter name to the value value.  May be repeated as needed.  See "Task parameters" below.

As with other command-line tools, these invocations could be placed in a cron table and run on a fixed schedule, or run on demand by an administrator.

...

Code Block
curate.ui.statusmessages = -3 = Unknown Task
curate.ui.statusmessages = -2 = No Status Set
curate.ui.statusmessages = -1 = Error
curate.ui.statusmessages = 0 = Success
curate.ui.statusmessages = 1 = Fail
curate.ui.statusmessages = 2 = Skip
curate.ui.statusmessages = other = Invalid Status

Report output from tasks run in this way is collected by configuring a Reporter plugin.  You must have exactly one Reporter configured.  The default is to use the FileReporter, which writes a single report of the output of all tasks in the run over all of the selected objects, to a file in the reports directory (configured as report.dir).  See \[DSpace\]/config/modules/submission-configuration.cfg for the value of plugin.single.org.dspace.curate.Reporter.  Other Reporter implementations are provided, or you may supply your own.

As the number of tasks configured for a system grows, a simple drop-down list of all tasks may become too As the number of tasks configured for a system grows, a simple drop-down list of all tasks may become too cluttered or large. DSpace 1.8+ provides a way to address this issue, known as task groups. A task group is a simple collection of tasks that the Admin UI will display in a separate drop-down list. You may define as many or as few groups as you please. If no groups are defined, then all tasks that are listed in the ui.tasknames property will appear in a single drop-down list. If at least one group is defined, then the admin UI will display two drop-down lists. The first is the list of task groups, and the second is the list of task names associated with the selected group. A few key points to keep in mind when setting up task groups:

...

Like configurable submission, you can assign these task rules per collection, as well as having a default for any collection.

As with task invocation from the administrative UI, workflow tasks need to have a Reporter configured in submission-configuration.cfg.

In arbitrary user code

If these pre-defined ways are not sufficient, you can of course manage curation directly in your code. You would use the CS helper classes. For example:

Code Block
languagejava
Collection coll = (Collection)HandleManager.resolveToObject(context, "123456789/4");
Curator curator = new Curator(();
curator.setReporter(System.out);
curator.addTask("vscan").curate(coll);
System.out.println("Result: " + curator.getResult("vscan"));

would do approximately what the command line invocation did. the method "curate" just performs all the tasks configured (you can add multiple tasks to a curator).

The above directs report output to standard out.  Any class which implements Appendable may be set as the reporter class.

Asynchronous (Deferred) Operation

...

For very fine-grained information, a task may write to a reporting stream. This stream is may be sent to a file or to standard out, so is only available when running a task from the command line.  Tasks run from the administrative UI or a workflow use a configured Reporter class to collect report output.  Your own code may collect the report using any implementation of the Appendable interface. Unlike the result string, there is no limit to the amount of data that may be pushed to this stream.

...