[EP-tech] Re: Adding a custom PerlResponseHandler
Jan Ploski
jpl at plosquare.com
Wed Nov 14 14:29:34 GMT 2012
You can branch on $repository_id in ~/perl_lib/EPrints/Apache/Rewrite.pm.
John Salter wrote:
> Hi,
> I'm trying to work out the best way to add a custom handler for a URL to a specific archive within eprints.
>
> I can either set something like this in the vhost (and add '/foo/' to $c->{rewrite_exceptions} ):
> <Location "/foo/handler">
> SetHandler perl-script
> PerlResponseHandler Foo::FooHandler
> </Location>
>
> - OR -
> I could edit ~/perl_lib/EPrints/Apache/Rewrite.pm, adding something like:
> if ( $uri =~ m! ^$urlpath/foo !x )
> {
> $r->handler( 'perl-script' );
> $r->set_handlers( PerlResponseHandler => [ 'Foo::FooHandler' ] );
> return OK;
> }
>
> BUT I wouldn't /really/ want to do that, as it would affect all archives, not just the one I want it to.
>
> 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?
>
> Cheers,
> John
>
> *** 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/
More information about the Eprints-tech
mailing list