Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First, it must provide a no-arg constructor, so it can be loaded by the PluginManager.
Thus, all tasks are 'named' plugins, meaning that each must be configured in dspace.cfg as:

Code Block

plugin.named.org.dspace.curate.CurationTask = \

...


org.dspace.curate.ProfileFormats = format-profile \

...


org.dspace.curate.RequiredMetadata = req-metadata \

...


org.dspace.ctask.replicate.Audit = audit \

...


org.dspace.ctask.replicate.Estimate = estimate \

...


org.dspace.ctask.replicate.Generate = generate \

...


org.dspace.ctask.integrity.Checksum = checksum \

...


org.dspace.ctask.integrity.ClamScan = vscan

The 'plugin name' (audit, estimate, etc) is called the task name, and is used instead of the qualified class name
wherever it is needed (on the cmd line, etc) - the CS always dereferences it.

...

The CurationTask interface is almost a 'tagging' interface, and only requires a few very high-level methods be implemented. The most significant is:

Code Block
 int perform(DSpaceObject dso); 

The return value should be a code describing one of 4 conditions:

...

A simple tool 'CurationCli' provides access to CS via command line. For example, to perform a virus check on collection '4':

Code Block
 ./dsrun org.dspace.curateCurationCli \-t vscan \-i 123456789/4 

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.

...

CS provides the ability to attach any number of tasks to standard DSpace workflows. Using a configuration file
(workflow-curation.xml), you can declaratively (without coding) wire tasks to any step in a workflow. An example:

Code Block

...


<taskset name="cautious">

...


<flowstep name="step1">

...


<task name="vscan">

...


<workflow>reject</workflow>

...


<notify on="fail">$flowgroup</notify>

...


<notify on="fail">$colladmin</notify>

...


<notify on="error">$siteadmin</notify>

...


</task>

...


</flowstep>

...


</taskset>

}}This markup would cause the virus scan to occur during step one of workflow, and automatically reject any
submissions with infected files. It would further notify (via email) both the reviewers (step 1 group), and the
collection administrators, if either of these are defined. If it could not perform the scan, the site administrator
would be notified.

...

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

Collection coll = (Collection)HandleManager.resolveToObject(context, "123456789/4");

...


Curator curator = new Curator();

...


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).