[EP-tech] Re: How to add functions for use in citations ?

Timothy Miles-Board timothy.miles-board at ulcc.ac.uk
Thu Apr 16 05:39:03 BST 2015


Another example -  in a cfg.d/foo.pl file:

https://github.com/eprintsug/carousel/blob/master/lib/cfg.d/carousel.pl

Tim

On 15 Apr 2015 5:12 pm, John Salter <J.Salter at leeds.ac.uk> wrote:
Hi Gilles,
Yes - you can do this!
If you're just adding a new method, it's not too problematic.
If you look at: http://wiki.eprints.org/w/Tips_to_write_plugins, the first code example is basically what you need.

This: http://files.eprints.org/773/ has a good example in it (perl_lib\EPrints\Script\Kultur.pm) that adds methods to EPrints::Script::Compiled.

If you Google for 'site:bazaar.eprints.org Compiled' you'll see other examples of exactly what you want to do.

If you're trying to overwrite a method it's abit more messy, especially if you have multiple archives running under one EPrints install, and they need different things...

Cheers,
John

-----Original Message-----
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Gilles Fournié
Sent: 15 April 2015 16:24
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] How to add functions for use in citations ?

Hi,

I would like to add a function to work on varaibles in citations (like
the ones in perl_lib/EPrints/Script/Compiled.pm).
I have already written the one we need... (basically it changes
occurrences of #...# in titles or abstracts to italics)

I have added a :
     sub run_crd_make_ital { ... }
in perl_lib/EPrints/Script/Compiled.pm.

It works, but I don't like modifying core files.

Is it possible to do something like what we do for Plugins :  write a
module in archives/ID/plugins/EPrints/Scripts/... and make it extend the
core module ?
I tried a few things but none worked.

Do you have any idea about the right way to do it ?

Thanks
GF


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

*** 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150416/6f250993/attachment.html 


More information about the Eprints-tech mailing list