Hi,<div><br></div><div>Using EPrints 3.3, you can hang the code off of an EP_TRIGGER_URL_REWRITE trigger (in the config for a specific archive). This also has the advantage that you aren&#39;t modifying the EPrints code.</div>
<div><br></div><div>Otherwise, just test for an archive specific value in the Rewrite script, for example, a config parameter that is only set in one archive.</div><div><br></div><div>G</div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On 14 November 2012 14:21, John Salter <span dir="ltr">&lt;<a href="mailto:J.Salter@leeds.ac.uk" target="_blank">J.Salter@leeds.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I&#39;m trying to work out the best way to add a custom handler for a URL to a specific archive within eprints.<br>
<br>
I can either set something like this in the vhost (and add &#39;/foo/&#39; to $c-&gt;{rewrite_exceptions} ):<br>
&lt;Location &quot;/foo/handler&quot;&gt;<br>
    SetHandler perl-script<br>
    PerlResponseHandler Foo::FooHandler<br>
&lt;/Location&gt;<br>
<br>
 - OR -<br>
I could edit ~/perl_lib/EPrints/Apache/Rewrite.pm, adding something like:<br>
if ( $uri =~ m! ^$urlpath/foo !x )<br>
{<br>
  $r-&gt;handler( &#39;perl-script&#39; );<br>
  $r-&gt;set_handlers( PerlResponseHandler =&gt; [ &#39;Foo::FooHandler&#39; ] );<br>
  return OK;<br>
}<br>
<br>
BUT I wouldn&#39;t /really/ want to do that, as it would affect all archives, not just the one I want it to.<br>
<br>
So, what is the *most* sensible way to do this, making it apply to only one archive? Am I missing some magic that will help me?<br>
<br>
Cheers,<br>
John<br>
<br>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" target="_blank">http://wiki.eprints.org/</a><br>
</blockquote></div><br></div>