DSpace 5 with XMLUI enable curation task in submission form

29 views
Skip to first unread message

Flavien M

unread,
Nov 25, 2019, 8:54:41 AM11/25/19
to DSpace Technical Support
Hello,

I am currently trying to configure the input form.
I would like that at the end of the entry of an item some fields are filled automatically.

Examples:
- dc.redaction.author: automatically put the name of the user who just typed the item;
- dc.redaction.datecreation: automatically set today's date.

If I understand correctly, in DSpace the way to reach my goal is to use the curation tasks.

I created a "/dspace/modules/additions/src/main/java/org/dspace/myproject/curate/AddMetadata.java" task.

But I did not understand how to activate this task.

Here are my questions:
- How to enable this task to run automatically at the end of an item?
- How to retrieve the name of the active user (the one who is entering) in the task?
- How to retrieve the date of the day in the task?

I use DSpace 5.10 and XMLUI.

PS : Sorry for my bad English this is not my native language.

Thank you in advance.
Flavien

Paul Münch

unread,
Dec 5, 2019, 6:40:17 AM12/5/19
to dspac...@googlegroups.com
Hello Flavien,

in our submission process we add metadata automatically. I don't think that the curation tasks are intended  for that. We wrote a separate submission step that runs without any user interaction and configure it in the '[dspace-src]/dspace/config/item-submission.xml'. For example:

'''
<step>
  <processing-class>org.dspace.submit.step.AddMetadata</processing-class>
  <workflow-editable>false</workflow-editable>
</step>
'''

Our step extends the 'AbstractProcessingStep' (http://demo.dspace.org/javadocs/6/apidocs/org/dspace/submit/AbstractProcessingStep.html). In the method 'doProcessing' (http://demo.dspace.org/javadocs/6/apidocs/org/dspace/submit/AbstractProcessingStep.html#doProcessing) you can use the Context-object to get the current user. For the date I would use some Java standard way.

To store all information in specific metadata fields, use the 'itemService.addMetadata'-method (http://demo.dspace.org/javadocs/6/apidocs/org/dspace/content/service/DSpaceObjectService.html#addMetadata). The Item-object that you need for this method will you get from the SubmissionInfo-object.

I hope this helps and kind regards,

Paul Münch

Am 25.11.19 um 12:36 schrieb Flavien M:
--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
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 view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/825c03e8-a8c2-46dc-91a9-457392799822%40googlegroups.com.

signature.asc

Mark H. Wood

unread,
Dec 5, 2019, 9:47:51 AM12/5/19
to dspac...@googlegroups.com
On Thu, Dec 05, 2019 at 12:40:04PM +0100, Paul Münch wrote:
> in our submission process we add metadata automatically. I don't think
> that the curation tasks are intended for that.

I disagree. There is a fair amount of code in the curation system
specifically to implement attachment of curation tasks to workflows.

https://wiki.lyrasis.org/display/DSDOC5x/Curation+System#CurationSystem-Inworkflow

> Am 25.11.19 um 12:36 schrieb Flavien M:
> > I am currently trying to configure the input form.
> > I would like that at the end of the entry of an item some fields are
> > filled automatically.
> >
> > Examples:
> > - dc.redaction.author: automatically put the name of the user who just
> > typed the item;
> > - dc.redaction.datecreation: automatically set today's date.
> >
> > If I understand correctly, in DSpace the way to reach my goal is to
> > use the curation tasks.
> >
> > I created a
> > "/dspace/modules/additions/src/main/java/org/dspace/myproject/curate/AddMetadata.java"
> > task.
> >
> > But I did not understand how to activate this task.
> >
> > Here are my questions:
> > - How to enable this task to run automatically at the end of an item?
> > - How to retrieve the name of the active user (the one who is
> > entering) in the task?
> > - How to retrieve the date of the day in the task?
> >
> > I use DSpace 5.10 and XMLUI.

How to attach a task to a workflow step: see the link above.

How to retrieve the name of the active user: I am not sure what user
this is. The EPerson who submitted the item should be obtainable
using Item.getSubmitter(). The EPerson who is in the current workflow
step would, as Paul Münch said, be in the request, but that may not be
available in a task. (If it is not, we should fix that.)

How to retrieve the date: which date? The date of submission
should be in the metadata field dc.date.submitted. The current date
is of course obtainable from java.util.Date or java.util.Calendar.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Paul Münch

unread,
Dec 6, 2019, 2:03:32 AM12/6/19
to dspac...@googlegroups.com
>I disagree. There is a fair amount of code in the curation system
>specifically to implement attachment of curation tasks to workflows.

>https://wiki.lyrasis.org/display/DSDOC5x/Curation+System#CurationSystem-Inworkflow

Thank you for the correction! I totally forgot this section in the
documentation, because we use the tasks mostly for manually processes.

Kind regards,

Paul Münch

Am 05.12.19 um 15:47 schrieb Mark H. Wood:
signature.asc
Reply all
Reply to author
Forward
0 new messages