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'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"><<a href="mailto:J.Salter@leeds.ac.uk" target="_blank">J.Salter@leeds.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I'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 '/foo/' to $c->{rewrite_exceptions} ):<br>
<Location "/foo/handler"><br>
SetHandler perl-script<br>
PerlResponseHandler Foo::FooHandler<br>
</Location><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->handler( 'perl-script' );<br>
$r->set_handlers( PerlResponseHandler => [ 'Foo::FooHandler' ] );<br>
return OK;<br>
}<br>
<br>
BUT I wouldn'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>