Thanks Andrea, I think I get it! Cheers! Bill
On Sunday, May 1, 2016 at 4:20:46 PM UTC-5, Andrea Schweer wrote: > > Hi Bill, > > On 30/04/16 07:08, Bill T wrote: > > Andrea > >> >> thanks for clarifying, and sorry that I haven't responded further in our >> other conversation, I'm pretty swamped at the moment. When I've wanted >> curation tasks of the type you described, I've always just written them so >> they should be invoked site-wide (handle prefix/0) and have made them >> distributive / only act on DSOs of type Site. >> > > Hmmmm... I'm not sure what you mean by this -- do you mean to have the > task itself filter the items for selection? > > > 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) > > >> If you want to find the items yourself via SQL queries and _then_ run a >> curation task on each, you can do that but it kindof defeats the purpose of >> the curation system! >> > > Which is what I wound up doing for simplicity. I have a standalone java > program that select the items I want to work on, and I use ProcessBuilder > to invoke dspace/bin curate with the --id parameter. Why do you say this > defeats the purpose of the curation system (that's why there's an id > option, right?) I'm not arguing with you, I just want to make sure there's > not something I'm misunderstanding. > > > 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 > > Thanks again for taking the time! Clearly, there's more than one way to > do it!! > > > 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 > > -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
