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

James Kerwin via Eprints-tech <[email protected]>
Newsgroups gmane.comp.web.eprints.devel
Message-ID <EMEW3|6182be11e3cb8cae6d2118ef9cf4561av8MBXH14eprints-tech-bounces|ecs.soton.ac.uk|CAKkNZ9AFU7txZWyqS5DBCv6LRDqzieFuZ8b8eWz7Cs=AaJ16Wg@mail.gmail.com>
Hi Chris and John,

Apologies for my delayed response; I was distracted last week by an
EPrints/Elements problem so I had to delay my EPrints exploring so I could
do my job (the inconvenience!).

Chris; Thank you for this, it makes much more sense. I'll take a more
thorough look through today now that last weeks drama is over.

John; thank you too, I'll add that to my reading list. One thing to be
encouraged by is that each time I read the various EPrints wiki pages I
somehow understand them a bit more. Which is a nice surprise as I spend
most of my time a bit confused!

Thanks,
James

On Fri, Sep 13, 2019 at 1:55 PM John Salter <[email protected]> wrote:

> 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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FAnatomy_of_a_request&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=DOiduicFWVO6nQ6G72WhZ%2BvM3nAXA2E3DhIWWSFuLVo%3D&amp;reserved=0
>
> - 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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=hcTtA687eqwIx62jXvYggG44pEJ82DqbB%2B1%2FyN9ujTk%3D&amp;reserved=0
>
>
>
> Cheers,
>
> John
>
>
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Christöpher
> Gutteridge via Eprints-tech
> *Sent:* 13 September 2019 12:51
> *To:* [email protected]; James Kerwin <[email protected]>
> *Subject:* Re: [EP-tech] Pins & EPrints::Apache::Template
>
>
>
> It's set here:
>
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fperl_lib%2FEPrints%2FApache%2FRewrite.pm%23L482&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=N9XjB5myeADWEKjmPj1A3tci%2FEwpfv8e%2B8Lj2XRk4Oc%3D&amp;reserved=0
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fperl_lib%2FEPrints%2FApache%2FRewrite.pm%23L482&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=N9XjB5myeADWEKjmPj1A3tci%2FEwpfv8e%2B8Lj2XRk4Oc%3D&amp;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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=hcTtA687eqwIx62jXvYggG44pEJ82DqbB%2B1%2FyN9ujTk%3D&amp;reserved=0
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=hcTtA687eqwIx62jXvYggG44pEJ82DqbB%2B1%2FyN9ujTk%3D&amp;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: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=z84e1u0GVnCdgNVwtlpnoMUG%2BBYDA1Ppdut6ivrIO%2BE%3D&amp;reserved=0 <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=z84e1u0GVnCdgNVwtlpnoMUG%2BBYDA1Ppdut6ivrIO%2BE%3D&amp;reserved=0>
>
> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=P3Ct1ItmQneKOAm%2Bbvi%2FjW3x3%2FNDJAF5L%2FohjJQmz2A%3D&amp;reserved=0 <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=P3Ct1ItmQneKOAm%2Bbvi%2FjW3x3%2FNDJAF5L%2FohjJQmz2A%3D&amp;reserved=0>
>
> *** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=BZZxZPFGzfUa1RCvP9qMoAjdcC8q1SOiF1xa81IEoH8%3D&amp;reserved=0 <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=BZZxZPFGzfUa1RCvP9qMoAjdcC8q1SOiF1xa81IEoH8%3D&amp;reserved=0>
>
> --
>
> Christopher Gutteridge <[email protected]> <[email protected]>
>
> You should read our team blog at http://blog.soton.ac.uk/webteam/
>
>

*** 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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.