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

John Salter via Eprints-tech <[email protected]>
Newsgroups gmane.comp.web.eprints.devel
Message-ID <EMEW3|57498b056996f641856b85b1483f8f98vA4Gmg14eprints-tech-bounces|ecs.soton.ac.uk|DB6PR03MB29340F801EEEEEFF1606EAAFC47E0@DB6PR03MB2934.eurprd03.prod.outlook.com>
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_]

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/
image003.jpg (image/jpeg, 15.6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.