|
Hi Bill, On 30/04/16 07:08, Bill T wrote:
That's right -- that's what the Distributive annotation signifies. https://wiki.duraspace.org/display/DSDOC5x/Curation+System#CurationSystem-TaskAnnotations From that page: there is a fundamental problem or ambiguity in how a task is invoked: if the DSO is a collection, should the CS invoke the task on each member of the collection, or does the task "know" how to do that itself? The decision is made by looking for the @Distributive annotation: if present, CS assumes that the task will manage the details, otherwise CS will walk the collection, and invoke the task on each member. (CS=Curation System)
One of the reasons for developing the curation system (IIRC) was to create a way to process specific items / other DSpace objects _without_ having to run SQL queries. To "pay" for that convenience, you get a bit of added overhead with having to register the task, having to add it to the codebase etc. By the time you're using SQL queries to select the items to process, it could be argued that you might as well add the provenance metadata directly via SQL as well and save the overhead. So really I what I mean is, your approach isn't the most straightforward one I can think of and you don't appear to be gaining much by using the curation system for half the job :) But, if it works for you / if that's what you have now, obviously that's great. And your solution isn't "wrong" -- things won't break just because you're doing things the way you describe. I think to go back to your original question, if you wanted to invoke the curation system directly in your standalone Java program in the way mentioned in the docs: Curator curator = new Curator();
curator.addTask("addsubmitterprovenance").curate(item);
Then you should be able to do that by invoking your standalone program via dsrun (assuming your custom class is on the classpath, eg, in the additions module of your DSpace codebase). That way, the classpath and the configuration system etc should all be set up correctly and it should remove the "kernel not initialised" error message. This is the class that runs dspace/bin/dspace curate -- you'll see there is no special magic in there: https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-api/src/main/java/org/dspace/curate/CurationCli.java
Very much so, and whatever works really! cheers, Andrea -- Dr Andrea Schweer Lead Software Developer, ITS Information Systems The University of Waikato, Hamilton, New Zealand +64-7-837 9120 -- |
- [dspace-tech] Executing curation tasks Bill T
- Re: [dspace-tech] Executing curation tasks Andrea Schweer
- Re: [dspace-tech] Executing curation tasks Bill T
- Re: [dspace-tech] Executing curation tasks Andrea Schweer
- Re: [dspace-tech] Executing curation tasks Bill T
- Re: [dspace-tech] Executing curation ... Andrea Schweer
