EPrints Technical Mailing List Archive
Message: #05675
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Getting Archive Name as a configuration value
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Getting Archive Name as a configuration value
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Fri, 6 May 2016 13:57:50 +0000
Hi Lizz, I think the magic you need is to change the phrase to a string – using EPrints::Utils::tree_to_utf8( $phrase ); Does that help at all? Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Adam Field From:
<eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Lizz Jennings <E.Jennings@bath.ac.uk> Just trying to set some sensible defaults as configurable values, so when an email is sent, someone doesn’t have to change the functional bit of the script to
change the From Name and so on: I’d like to be able to set something like this: $c->{email_editors_from_name} = $repo->phrase( “archive_name” ); Rather than: $c->{email_editors_from_name} = "University of Bath Research Data Archive"; I can do this for email addresses: $c->{email_editors_from_email} = $c->{adminemail}; Because there’s already a config value for that. Lizz -- Lizz Jennings BA MSc ACLIP MCLIP (Revalidated 2015) Technical Data Officer The Library 4.10, University of Bath, Bath, BA2 7AY UK Ext. 3570 (External 01225 383570) Research Data Management:
http://www.bath.ac.uk/research/data From:
eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Adam Field It is wrong. Sorry, it was the end of a long day, and I was spouting nonsense. archive_name is a phrase. The internal repository id (I.e. the directory name under <root>/archives) is got by doing $repository->id. What are you actually trying to do. From:
<eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Lizz Jennings <E.Jennings@bath.ac.uk> Thanks both! I can get it as a phrase – I was just trying to use that as a value in a configuration setting where you might choose to use something other than the archive name.
e.g. $c->{new_thing} = $c->{archive_name}; But not having the $repo object there I’ve struggled to get the phrase into something like $c->{archive_name} I couldn’t see a way of getting something like: $c->{new_thing} = $repo->phrase( “archive_name” ); It seems slightly wrong to just create a configuration value to get something that’s already in the system as a phrase (in case it changes). Lizz -- Lizz Jennings BA MSc ACLIP MCLIP (Revalidated 2015) Technical Data Officer The Library 4.10, University of Bath, Bath, BA2 7AY UK Ext. 3570 (External 01225 383570) Research Data Management:
http://www.bath.ac.uk/research/data From:eprints-tech-bounces@ecs.soton.ac.uk
[mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Adam Field If you have the repository object, you can do: $repo->get_config('archive_name'); Otherwise, if you don't, in the perl config, you can access stuff that's already been set. E.g. in newfile.pl (in cfg.d), you can do: $c->{new_thing} = $c->{archive_name} . ' BWAHAHAHA'; ...but it needs to be alphabetically after the file in which archive_name is already set. -- Adam
|
- References:
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: "Vials Moore, Adam" <Adam.Moore@liverpool.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: Adam Field <Adam.Field@jisc.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: Lizz Jennings <E.Jennings@bath.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: Adam Field <Adam.Field@jisc.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: Lizz Jennings <E.Jennings@bath.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- From: Adam Field <Adam.Field@jisc.ac.uk>
- Re: [EP-tech] Getting Archive Name as a configuration value
- Prev by Date: Re: [EP-tech] Getting Archive Name as a configuration value
- Next by Date: Re: [EP-tech] Getting Archive Name as a configuration value
- Previous by thread: Re: [EP-tech] Getting Archive Name as a configuration value
- Next by thread: Re: [EP-tech] Getting Archive Name as a configuration value
- Index(es):