Hi Bill,
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.
Then you can find your own items to work on.
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! You would need to add your
custom code to the additions module; it needs to have a main method.
See
https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/discovery/IndexClient.java#L39
for an example. You'd then need to either add your class to
launcher.xml, or just invoke via ScriptLauncher, in the case I've
linked to you could run [dspace]/bin/dspace dsrun
org.dspace.discovery.IndexClient (in that particular case you don't
have to, since that class _is_ in launcher.xml).
With the configurable workflow, I'd look into putting the code that
populates dc.provenance into a non-interactive action and making
sure that this action is invoked always. But if I recall the
information in your other e-mail correctly, the problem really is
that no action is involved for collections without a workflow -- I
don't know if that's still true when you have non-interactive
actions. Integration with the curation system is a known missing
feature in the configurable workflow
(https://jira.duraspace.org/browse/DS-2058).
Your other option would be to write a non-interactive custom
submission step; I've done that in the past when I needed to add
just a little bit more information at the end of a submission
process.
https://wiki.duraspace.org/display/DSDOC5x/Submission+User+Interface#SubmissionUserInterface-CreatingaNon-InteractiveStep
-- you'd subclass AbstractProcessingStep and then you can modify the
submission _before_ it enters any workflow.
cheers,
Andrea
On 29/04/16 00:54, Bill T wrote:
Andrea,
Thanks, I'm running my task in the usual way now, via
dspace/bin curate. However I was hoping to be a little
selective in the way I select items against which to run tasks
-- for instance only items submitted in the last 24 hours.
There are other ways to accomplish this, but the bit in the
docs about 'arbitrary code' made me believe I could write a
standalone java program to interact directly with the dspace
system. If all else fails, I can do the same with java (or
pretty much any language) to query the database and make a
system call to dspace curate...
By the way, this is all related to the last topic you and I
discussed, the problem with the dc.provenance field lacking a
submitter information since my upgrade to 5.5 and configurable
workflow. I wrote a task to populate that metadata field, and
my goal is to run it periodically for recently deposited
items...
Thanks!
Bill
On Wednesday, April 27, 2016 at 7:11:47 PM UTC-5, Andrea
Schweer wrote:
Hi Bill,
I'm afraid you'll have to give us a little more context.
When/how are you wanting to run the curation task? How are
you launching it right now?
ScriptLauncher.java is probably not a good starting point
at all. If you just want to run a curation task from the
command line, the "arbitrary user code" bit in the
documentation doesn't apply to your situation. Just
configure the curation task in curate.cfg and run it using
[dspace]/bin/dspace curate, using the -t flag to pass in
the name of the task.
cheers,
Andrea
On 28/04/16 06:01, Bill T wrote:
Referring the version 5.5, the
documentation states that curation tasks can be
invoked in 'in arbitrary user code'. Is there a more
complete example than the small code snippet included
in the docs? I feel like I'm close, but when invoking
a (homemade) task that updates a metadata field, an
IllegalStateException is thrown with the message
'DSpace kernel cannot be null'.
Is ScriptLauncher.java a good place to start as a
template?
Thanks for any pointers!
Bill
--
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 dspace-tech...@googlegroups.com.
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.
--
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.
--
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.
|