EPrints Technical Mailing List Archive

Message: #08011


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Workflow - test for document metadata in eprint workflow


Hi,

I was trying to do something like this in the eprint/default.xml workflow, where we're replacing one field with another - but still want to display the field where someone already has set it:

<stage name="files">

    <component type="Upload" show_help="always"/>

    <component type="Documents">

      <epc:if test="OLD_DOCUMENT_FIELD">

          <field ref="OLD_DOCUMENT_FIELD"/>

      </epc:if>

      … (normal document fields) …

    </component>

  </stage>

 

This doesn't work, as the dataobject for the workflow is the EPrint, and the epc:test considers 'OLD_DOCUMENT_FIELD' as an eprint field (which doesn't exist).

 

Is there a way to perform logic relating to document from within an eprint workflow?

I've tried various things (and trawled through the source code) but haven't found a solution yet.

 

If there isn't currently a wat to achieve this, is it something that other people have wanted to do previously, or migth find useful?

 

For my specific needs, creating a new EPScript method e.g. EPrints::Script::Compiled::run_have_any_documents_got_field_set that would be called with the field in question:

<epc:if test="have_any_documents_got_field_set('OLD_DOCUMENT_FIELD')> … </epc:if>

but if there was a wider requirement to be able to to this, then possibly allowing a call to e.g. test="$doc.field" might be a more sustainable approach.

 

Cheers,
John

 

John Salter

http://orcid.org/0000-0002-8611-8266

 

White Rose Libraries Technical Officer
IT - Application Support (Research)
10.23B, IT Services Building
University of Leeds
Leeds
LS2 9JT
0113 34 37385


Online: https://whiteroselibraries.wordpress.com/
WRL_email_signature_thelmas_