EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #07968


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Pins & EPrints::Apache::Template


As a side-comment, this might also be of use to understand some other parts of which might be involved with responses to some requests:

https://wiki.eprints.org/w/Anatomy_of_a_request

- it took me a while to understand most of that - but I didn't dig into the details of the template as a response handler.

 

It's also worth mentioning that the response handlers can be 'stacked' - you can have a queue of things that /could/ respond - with the first one that actually generates a response being the one that sends data to the browser

More info about that layer of Apache/Perl here:

https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler

 

Cheers,

John

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Christöpher Gutteridge via Eprints-tech
Sent: 13 September 2019 12:51
To: eprints-tech@ecs.soton.ac.uk; James Kerwin <jkerwin2101@gmail.com>
Subject: Re: [EP-tech] Pins & EPrints::Apache::Template

 

It's set here:

https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482

$r->set_handlers(PerlResponseHandler => [ 'EPrints::Apache::Template' ] );

If the URL is not a document or EPrint URL, and ends in .html then apache is told to use that handler. See https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler

The term "pin" is short for lynchpin because that was the term for gaps you left in pre-prepared spells to fill them in at the time you cast them, in a roleplay system I was playing when I designed that bit of the system. It's not perfect, but it's not done badly as a solution for web templating.

On 13/09/2019 12:36, James Kerwin via Eprints-tech wrote:

Hi All,

 

I've decided to go back and revisit pins to see how they work. Starting with the "main" pin in my repository default template:

 

<epc:pin ref="page"/>

 

According to the EPrints wiki Aprints:Apachec:Template.pm is what I want to look at. Going here I can see a sub:

 

sub handler {

 

This subroutine does STUFF to some filename and ends with a call to "prepare_page" which I assume prepares the page.

 

Excuse me if this is really obvious or naive, but what causes "handler" to be called in the first instance? I've done so many greps and searched everywhere. I've even looked at bin/generate_static to see if that gives any clues. The notes in this module indicate that it's ran on server start-up, but does anybody know when "handler" is called? I want to see how the filenames are passed to handler.

 

Thanks,

James 



*** 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/
-- 
Christopher Gutteridge <totl@soton.ac.uk> 
You should read our team blog at http://blog.soton.ac.uk/webteam/