<div dir="ltr">Hi Chris and John,<br><div><br></div><div>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!).</div><div><br></div><div>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.</div><div><br></div><div>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!</div><div><br></div><div>Thanks,</div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 13, 2019 at 1:55 PM John Salter <<a href="mailto:J.Salter@leeds.ac.uk">J.Salter@leeds.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="white" lang="EN-GB">
<div class="gmail-m_-8393046636320617642WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FAnatomy_of_a_request&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=DOiduicFWVO6nQ6G72WhZ%2BvM3nAXA2E3DhIWWSFuLVo%3D&reserved=0" originalSrc="https://wiki.eprints.org/w/Anatomy_of_a_request" shash="Mowbtk4SNhR9dQzwvj1hxdgR5vIemXg/QZUBp3hEIsxvkgrlieeJSI6gLU6cNiDXM754onTaa6uzl176YZgqoxfTmo76txw/gOVEeq0irE2gWS+gsT0BD3BGjAbI33YULs7coadRghcDSV0lnAZKbC5oMyg+1cBbISXH8it7pe0=" target="_blank">https://wiki.eprints.org/w/Anatomy_of_a_request</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">- 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.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">More info about that layer of Apache/Perl here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=hcTtA687eqwIx62jXvYggG44pEJ82DqbB%2B1%2FyN9ujTk%3D&reserved=0" originalSrc="https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler" shash="Gtk85tdJV4F5JXYUorC4oVTAsWtXFEvGm5uXohptxBxPILhVF16L1sKH+OAsyC+CFhlIgTPHIvbRHlrRQoklFNgxtjWY/O3XXA/IjZhASFD5pjAgnZbjel+9BORn0SEum7vehyckdwerO9cJjJAT3FF40e+1RKvqYUphtxQ8dfY=" target="_blank">https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">John<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:windowtext"> <a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@ecs.soton.ac.uk</a>
[mailto:<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@ecs.soton.ac.uk</a>] <b>On Behalf Of </b>Christöpher Gutteridge via Eprints-tech<br>
<b>Sent:</b> 13 September 2019 12:51<br>
<b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk" target="_blank">eprints-tech@ecs.soton.ac.uk</a>; James Kerwin <<a href="mailto:jkerwin2101@gmail.com" target="_blank">jkerwin2101@gmail.com</a>><br>
<b>Subject:</b> Re: [EP-tech] Pins & EPrints::Apache::Template<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p>It's set here:<u></u><u></u></p>
<p><a href="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%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=N9XjB5myeADWEKjmPj1A3tci%2FEwpfv8e%2B8Lj2XRk4Oc%3D&reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482" shash="H+EelL+1mBi7/elqljUOe3HZ3hSYkRhjwm457XPJEXPkPCzl7KrhXKV0YS50fudlsWgEWKqpjUWDt79HFZRV6hjRTBrp62T/4chMjFXamDg581astoyPyQMoLxA18tlzPQ9ZPp0YitM1bL7Eqe4eKBQuHMBvnOQHG7gadIqnV6I=" target="_blank">https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482</a><u></u><u></u></p>
<p><span class="gmail-m_-8393046636320617642pl-smi">$r</span><span class="gmail-m_-8393046636320617642pl-k">-></span>set_handlers(<span class="gmail-m_-8393046636320617642pl-c1">PerlResponseHandler</span>
<span class="gmail-m_-8393046636320617642pl-k">=></span> [ <span class="gmail-m_-8393046636320617642pl-pds">'</span><span class="gmail-m_-8393046636320617642pl-s">EPrints::Apache::Template</span><span class="gmail-m_-8393046636320617642pl-pds">'</span> ] );<u></u><u></u></p>
<p>If the URL is not a document or EPrint URL, and ends in .html then apache is told to use that handler. See
<a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23PerlResponseHandler&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=hcTtA687eqwIx62jXvYggG44pEJ82DqbB%2B1%2FyN9ujTk%3D&reserved=0" originalSrc="https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler" shash="Gtk85tdJV4F5JXYUorC4oVTAsWtXFEvGm5uXohptxBxPILhVF16L1sKH+OAsyC+CFhlIgTPHIvbRHlrRQoklFNgxtjWY/O3XXA/IjZhASFD5pjAgnZbjel+9BORn0SEum7vehyckdwerO9cJjJAT3FF40e+1RKvqYUphtxQ8dfY=" target="_blank">
https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler</a><u></u><u></u></p>
<p>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.<u></u><u></u></p>
<div>
<p class="MsoNormal">On 13/09/2019 12:36, James Kerwin via Eprints-tech wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">Hi All,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I've decided to go back and revisit pins to see how they work. Starting with the "main" pin in my repository default template:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30pt;margin-right:0cm">
<blockquote style="margin-left:30pt;margin-right:0cm">
<blockquote style="margin-left:30pt;margin-right:0cm">
<div>
<p class="MsoNormal"><epc:pin ref="page"/><u></u><u></u></p>
</div>
</blockquote>
</blockquote>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">According to the EPrints wiki Aprints:Apachec:Template.pm is what I want to look at. Going here I can see a sub:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30pt;margin-right:0cm">
<blockquote style="margin-left:30pt;margin-right:0cm">
<blockquote style="margin-left:30pt;margin-right:0cm">
<div>
<p class="MsoNormal">sub handler {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</blockquote>
</blockquote>
</blockquote>
<p class="MsoNormal">This subroutine does STUFF to some filename and ends with a call to "prepare_page" which I assume prepares the page.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">James <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<pre>*** 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><u></u><u></u></pre>
<pre>*** Archive: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=z84e1u0GVnCdgNVwtlpnoMUG%2BBYDA1Ppdut6ivrIO%2BE%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="mw4k+Pz5zb9+nBGTEqqu9rtPWRQFe7KkFsIjeKwoN2SzScpzgKf2A088CK3EaUIByEDFcDuwMrGHQ3EnnTLBE0s06Ju0cSpbGR6nzK0q9Xc6oOdpx7Hfj8AXS8eSuQy/x7CteJ5kbFp9FFfcAEaPRejuB78JjGMjPTYLoR1h49U=" target="_blank">http://www.eprints.org/tech.php/</a><u></u><u></u></pre>
<pre>*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=P3Ct1ItmQneKOAm%2Bbvi%2FjW3x3%2FNDJAF5L%2FohjJQmz2A%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="Z+hb15JR20siWxbkliQ72WxvXljsR24PWPPk7fTd2HJVceWFahGJpxE8fpAEryIQajODhT9IfKAZrm42aY5h/sMW10GyYXAqx7LmLuJutjrYE7iONo3qENCswqmXPHmt5PKBuvNKmbcZmRE3aFTyJyJvpNSMEEUPxLxzHoz5y9k=" target="_blank">http://wiki.eprints.org/</a><u></u><u></u></pre>
<pre>*** EPrints developers Forum: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cd3294949fef84c500b3408d740116cd0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=BZZxZPFGzfUa1RCvP9qMoAjdcC8q1SOiF1xa81IEoH8%3D&reserved=0" originalSrc="http://forum.eprints.org/" shash="RjhBCXCB5qUe87xTFpF1AjAnJLPuaPrU0bqDSpbs9G6JmYpDDUBk0uwA29rxeKy7UsqyNHYgTvoLZuyiCFLOiIaAieWVIqBtQjY7z1AVMa27U9khQLjHB6kHjXAvD32latz05klRvep0r0wFNIQOSm4PFG6oA2rG/EfCXyH1Gro=" target="_blank">http://forum.eprints.org/</a><u></u><u></u></pre>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre>Christopher Gutteridge <a href="mailto:totl@soton.ac.uk" target="_blank"><totl@soton.ac.uk></a> <u></u><u></u></pre>
<pre>You should read our team blog at <a href="http://blog.soton.ac.uk/webteam/" target="_blank">http://blog.soton.ac.uk/webteam/</a><u></u><u></u></pre>
</div>
</div>
</blockquote></div>