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

[EP-tech] Getting Archive Name as a configuration value



You should use phrases for this.  Then you can just include phrases in phrases.


[Jisc]<http://www.jisc.ac.uk/>

Adam Field
SHERPA services analyst developer


From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of Lizz Jennings <E.Jennings at bath.ac.uk<mailto:E.Jennings at bath.ac.uk>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Friday, 6 May 2016 13:44
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Getting Archive Name as a configuration value

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)
E.Jennings at bath.ac.uk<mailto:E.Jennings at bath.ac.uk>
Research Data Management: http://www.bath.ac.uk/research/data


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 06 May 2016 13:29
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Getting Archive Name as a configuration value

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.


[Jisc]<http://www.jisc.ac.uk/>

Adam Field
SHERPA services analyst developer


From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of Lizz Jennings <E.Jennings at bath.ac.uk<mailto:E.Jennings at bath.ac.uk>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Friday, 6 May 2016 12:54
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Getting Archive Name as a configuration value

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)
E.Jennings at bath.ac.uk<mailto:E.Jennings at bath.ac.uk>
Research Data Management: http://www.bath.ac.uk/research/data


From:eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 05 May 2016 18:51
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Getting Archive Name as a configuration value

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

On 5 May 2016, at 09:49, Vials Moore, Adam <Adam.Moore at liverpool.ac.uk<mailto:Adam.Moore at liverpool.ac.uk>> wrote:

Hmmm . . .

In phrases (like index.xpage) you use

<epc:phrase ref="archive_name"/>

Is that what you?re after? Or which config file and I?ll see If I have something similar . . .

A

From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of "Lizz uk>" <e.jennings at bath.ac.uk<mailto:e.jennings at bath.ac.uk>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Wednesday, 4 May 2016 at 12:32
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: [EP-tech] Getting Archive Name as a configuration value

Hello,

I feel I?m probably missing something really obvious, but I?m trying to use the Archive name phrase in configuration values.  I can?t seem to figure out how to do it.

Any ideas?

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)
E.Jennings at bath.ac.uk<mailto:E.Jennings at bath.ac.uk>
Research Data Management: http://www.bath.ac.uk/research/data


*** 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/


Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc?s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160506/9a423c27/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1264 bytes
Desc: image001.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160506/9a423c27/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6B9928AE-9C97-4E75-8330-7E24168F02D7[1].png
Type: image/png
Size: 1264 bytes
Desc: 6B9928AE-9C97-4E75-8330-7E24168F02D7[1].png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160506/9a423c27/attachment-0003.png