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

Christöpher Gutteridge totl at soton.ac.uk
Fri Sep 13 12:51:16 BST 2019


It's set here:

https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fperl_lib%2FEPrints%2FApache%2FRewrite.pm%23L482&data=01%7C01%7C%7C64c6780b6cd448bcab4d08d73840af2d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=1ougz%2F7a24ZTmwa5Skmeq2n2%2B8teJABmiyMPwwJtZjQ%3D&reserved=0>

$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<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&data=01%7C01%7C%7C64c6780b6cd448bcab4d08d73840af2d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=5RMrMt1e7P3DzYwLEjpgiZqqBl0ynzMaAWU%2FMjUxijk%3D&reserved=0>

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/<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7C64c6780b6cd448bcab4d08d73840af2d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=OU81HLzZmfGWmHxkyUaJ6aizFbO82Uw4bLz8TxyQigg%3D&reserved=0>
*** EPrints community wiki: http://wiki.eprints.org/<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7C64c6780b6cd448bcab4d08d73840af2d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=BxW%2FbrCSEWz68e7YBjbhH9vXnikX9D8EA24TmcPJNKM%3D&reserved=0>
*** EPrints developers Forum: http://forum.eprints.org/<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7C%7C64c6780b6cd448bcab4d08d73840af2d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=RSNe4PlgiN6PbJ%2Bt7YUWLIs%2B56wWjV%2BGoz1pU%2BqGULM%3D&reserved=0>


--
Christopher Gutteridge <totl at soton.ac.uk><mailto:totl at soton.ac.uk>
You should read our team blog at http://blog.soton.ac.uk/webteam/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20190913/85cfdaa0/attachment-0001.html 


More information about the Eprints-tech mailing list