[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Forcid.org%2F0000-0002-8611-8266&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C40510fb8faea45f9ec2208d7620f7f49%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=tB9NWDqbCmrXtM3LgW0OJBU7CpfGPBOzK5N7nMCpSS4%3D&amp;reserved=0

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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwhiteroselibraries.wordpress.com%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C40510fb8faea45f9ec2208d7620f7f49%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=NBoz8zMVP58m2t57qNzu12tkDVz30VIVQM%2BCf6XnjU0%3D&amp;reserved=0
[WRL_email_signature_thelmas_]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20191105/0b1f7a02/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 15961 bytes
Desc: image003.jpg
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20191105/0b1f7a02/attachment-0001.jpg