EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #10066
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] EPC: calling a function stored in nested config hash
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] EPC: calling a function stored in nested config hash
- From: David Newman <drn@ecs.soton.ac.uk>
- Date: Thu, 27 Mar 2025 20:44:33 +0000
Sent: Thursday, March 27, 2025 4:34:25 PM
To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] EPC: calling a function stored in nested config hash
Hi,
I’m trying to display some information in a workflow. That information would come from a method in a config hash[1], that should be passed an EPrint.
The method is something like this:
$c->{hefce_oa}->{deduce_panel} = sub {
my( $eprint ) = @_;
# do stuff
return “A value”;
};
I can get the function itself e.g. adding this to the workflow:
<component type="XHTML">
<epc:print expr="$config{hefce_oa}{deduce_panel}()"/>
</component>
Results in:
CODE(0x5595701ec338)
This makes sense – as you can get a ‘value’ from the nested config [2].
I’m trying to find a way to call this method. If I try other combinations of brackets/dots/
<epc:print expr="$config{hefce_oa}{deduce_panel}.($item)"/>
<epc:print expr="{$config{hefce_oa}{deduce_panel}}.($item)"/>
I either get the code reference, or an EPScript error.
Am I overlooking something? Is there a way to do this?
Or should I just inject a new run_eprint_deduce_panel wrapper method into EPrints::Script::Compiled?
Cheers,
John
[1] https://wiki.eprints.org/w/EPScript/Data_Types#Hashes
[2]
https://wiki.eprints.org/w/EPScript/Introduction
John Salter
https://orcid.org/0000-0002-8611-8266
White Rose Libraries Technical Officer
Library and Research Management team, IT
University of Leeds
- References:
- [EP-tech] EPC: calling a function stored in nested config hash
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] EPC: calling a function stored in nested config hash
- Prev by Date: [EP-tech] EPC: calling a function stored in nested config hash
- Previous by thread: [EP-tech] EPC: calling a function stored in nested config hash
- Index(es):