Hi Ari,

On 13/07/16 18:07, Ari wrote:
Hi,
I just found that one can write curator tasks with Jython. This seems to be an ideal way for us to do some task without need to code in Java. However, I'm not a java programmer and haven't used Jython before and I'm completely stuck with it and there is very little examples around (I have found one).

How do I access methods of DSpaceObject in Jython, like getMetadata()?

What DSpace version are you working with?

In 5.x, you should be able to use getMetadataByMetadataString("dc.publisher") on an Item object (regardless of Java/Jython).

In current master, I think you will need to go via the one of the new services; I have no idea how to do that in Jython, sorry. There's a Java example here: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/ctask/general/RequiredMetadata.java#L83 -- the item service instance is provided by the AbstractCurationTask superclass in this case, see https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java#L46

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.

Reply via email to