<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p dir="ltr">Another example -&nbsp; in a cfg.d/foo.pl file:</p>
<p dir="ltr">https://github.com/eprintsug/carousel/blob/master/lib/cfg.d/carousel.pl</p>
<p dir="ltr">Tim</p>
<div class="gmail_quote">On 15 Apr 2015 5:12 pm, John Salter &lt;J.Salter@leeds.ac.uk&gt; wrote:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:10pt"></span></font>
<div>Hi Gilles,<br>
Yes - you can do this!<br>
If you're just adding a new method, it's not too problematic.<br>
If you look at: <a href="http://wiki.eprints.org/w/Tips_to_write_plugins">http://wiki.eprints.org/w/Tips_to_write_plugins</a>, the first code example is basically what you need.<br>
<br>
This: <a href="http://files.eprints.org/773/">http://files.eprints.org/773/</a> has a good example in it (perl_lib\EPrints\Script\Kultur.pm) that adds methods to EPrints::Script::Compiled.<br>
<br>
If you Google for 'site:bazaar.eprints.org Compiled' you'll see other examples of exactly what you want to do.<br>
<br>
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...<br>
<br>
Cheers,<br>
John<br>
<br>
-----Original Message-----<br>
From: eprints-tech-bounces@ecs.soton.ac.uk [<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>] On Behalf Of Gilles FourniĆ©<br>
Sent: 15 April 2015 16:24<br>
To: eprints-tech@ecs.soton.ac.uk<br>
Subject: [EP-tech] How to add functions for use in citations ?<br>
<br>
Hi,<br>
<br>
I would like to add a function to work on varaibles in citations (like <br>
the ones in perl_lib/EPrints/Script/Compiled.pm).<br>
I have already written the one we need... (basically it changes <br>
occurrences of #...# in titles or abstracts to italics)<br>
<br>
I have added a :<br>
&nbsp;&nbsp;&nbsp;&nbsp; sub run_crd_make_ital { ... }<br>
in perl_lib/EPrints/Script/Compiled.pm.<br>
<br>
It works, but I don't like modifying core files.<br>
<br>
Is it possible to do something like what we do for Plugins :&nbsp; write a <br>
module in archives/ID/plugins/EPrints/Scripts/... and make it extend the <br>
core module ?<br>
I tried a few things but none worked.<br>
<br>
Do you have any idea about the right way to do it ?<br>
<br>
Thanks<br>
GF<br>
<br>
<br>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">
http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a><br>
<br>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">
http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a><br>
</div>
</div>
</blockquote>
</div>
</body>
</html>