<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.pl-smi
        {mso-style-name:pl-smi;}
span.pl-k
        {mso-style-name:pl-k;}
span.pl-c1
        {mso-style-name:pl-c1;}
span.pl-s
        {mso-style-name:pl-s;}
span.pl-pds
        {mso-style-name:pl-pds;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle25
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">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:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="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%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=LNahIGJvI4PvdBwmVsRdvrXFYzqYYnrGnc4mpdw%2BbIw%3D&amp;reserved=0" originalSrc="https://wiki.eprints.org/w/Anatomy_of_a_request" shash="UsEizP61/PKJBpQNIBYRa0hQBKHvhC7IfqhVEcJ4q2F6MXAmf70txFBsfSwjUST6zLzyRBO6GEwjxG6AWMGgDMVSNK5T8VIC5DyNJiWrlwxKmRPTew54NKa92gizu5OlYlxbLKz0D8zIi/eEm5Bmjxfo/2A+dfULF1u91cHufDM=">https://wiki.eprints.org/w/Anatomy_of_a_request</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">- 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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">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<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">More info about that layer of Apache/Perl here:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="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%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=AnM%2BAM53pO4fmpkMO%2BWRx33DpoeTzTb3NSb0didzRf0%3D&amp;reserved=0" originalSrc="https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler" shash="aNMJX+3NvfEpBDZuZE3dkbw45ldctN+Qu8lJUGesh7yV1gmPkNOzYE6h3uWJAlM2aZnQF8spaSfj7ZcJImsUCuxhCYnk5pXY2gturExhvOBy66+pcIXFYAH8b3M0J+BtNmQU/SyvvbhGa9P2CAb8qHSEPycx3R3xYfvvXWIulOA=">https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:windowtext"> eprints-tech-bounces@ecs.soton.ac.uk
 [mailto:eprints-tech-bounces@ecs.soton.ac.uk] <b>On Behalf Of </b>Christöpher Gutteridge via Eprints-tech<br>
<b>Sent:</b> 13 September 2019 12:51<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk; James Kerwin &lt;jkerwin2101@gmail.com&gt;<br>
<b>Subject:</b> Re: [EP-tech] Pins &amp; EPrints::Apache::Template<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p>It's set here:<o:p></o:p></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&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=glWI9%2Fjf7GwNEBZB3qCFsNukB5%2FzjNwZXbtnyKAra3w%3D&amp;reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482" shash="yQA2wv6P5SbD0lIvhDDbHu/TSC05V4OA/0gXoB5bnZfgLMG9FQGugDFWm+Byeck/fYkq6PdWs311Js6wQUwlcg/O1iaO4vsLsvJLk8W/jk10GoLsBzxebx505/3u9sQSvGPLxUfCcHB59MTFyX0ApUrM8XNrwClQiBSBIRjTOpc=">https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Apache/Rewrite.pm#L482</a><o:p></o:p></p>
<p><span class="pl-smi">$r</span><span class="pl-k">-&gt;</span>set_handlers(<span class="pl-c1">PerlResponseHandler</span>
<span class="pl-k">=&gt;</span> [ <span class="pl-pds">'</span><span class="pl-s">EPrints::Apache::Template</span><span class="pl-pds">'</span> ] );<o:p></o:p></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&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=AnM%2BAM53pO4fmpkMO%2BWRx33DpoeTzTb3NSb0didzRf0%3D&amp;reserved=0" originalSrc="https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler" shash="aNMJX+3NvfEpBDZuZE3dkbw45ldctN+Qu8lJUGesh7yV1gmPkNOzYE6h3uWJAlM2aZnQF8spaSfj7ZcJImsUCuxhCYnk5pXY2gturExhvOBy66+pcIXFYAH8b3M0J+BtNmQU/SyvvbhGa9P2CAb8qHSEPycx3R3xYfvvXWIulOA=">
https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler</a><o:p></o:p></p>
<p>The term &quot;pin&quot; 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.<o:p></o:p></p>
<div>
<p class="MsoNormal">On 13/09/2019 12:36, James Kerwin via Eprints-tech wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I've decided to go back and revisit pins to see how they work. Starting with the &quot;main&quot; pin in my repository default template:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<div>
<p class="MsoNormal">&lt;epc:pin ref=&quot;page&quot;/&gt;<o:p></o:p></p>
</div>
</blockquote>
</blockquote>
</blockquote>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<div>
<p class="MsoNormal">sub handler {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</blockquote>
</blockquote>
</blockquote>
<p class="MsoNormal">This subroutine does STUFF to some filename and ends with a call to &quot;prepare_page&quot; which I assume prepares the page.
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Excuse me if this is really obvious or naive, but what causes &quot;handler&quot; 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 &quot;handler&quot; is called? I want to see how the filenames are passed to handler.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">James&nbsp;<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><o:p></o:p></pre>
<pre>*** Archive: <a href="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%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=ktBHaET33ek%2BTVcYoMFSneMJC6PBF1X9bn7z%2BDjv%2Ft4%3D&amp;reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="D8HvhQGJdR2l7c5UzuNoNu6nlOgwjYq6TZ8w1xuVoRN82XS7XjYgA8yk1hLQOGtUrqmi1bplZfPQZifxbBZmp+Hd/wI9YEOeab1G1UH0KLbvJ9RBmHtxMC9KjQySgSBLJOKIltElFtcrJFD3nUvonPN8Bf25wrMZh1btiyasx0s=">http://www.eprints.org/tech.php/</a><o:p></o:p></pre>
<pre>*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=MXYZ%2BUsS9ooCOz510BHCxkTdsVe1T%2B2FWlZ3%2F0Z5Cew%3D&amp;reserved=0" originalSrc="http://wiki.eprints.org/" shash="uwFnAs+rmHFQT8rRvZ3Rwia2XpuPpWhRBprLQspH1KdPxXXXamqVS/Lmr8Fp8OarUjbO8RQaV1phf7F7UNlZ/kUerSs3jQoAuLo85V78iG6tR3N0O/lVW6UjLl4TT/rkudsvZvIoLJh4Y0Au6BS5G4NflXM31iWFvr3PavrfsT0=">http://wiki.eprints.org/</a><o:p></o:p></pre>
<pre>*** EPrints developers Forum: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C362961fa2bdd4cbd400408d73849aeda%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=volqdvYngqX484SkRG0O3vm1hnq2Gs5tENZ9aQjJiAY%3D&amp;reserved=0" originalSrc="http://forum.eprints.org/" shash="ZoNWwkN6DrGRw8bYjeldB+jkL0alddjEH6XdxatDwv+FoEDFeOFJAhAuGlACULrUIUTwvB8Msr6JsqKsftO9qxECsHxVi92tWWBVpw4hn1Blq4iAwO566BPZx6mAKPU5N9sNWzy/1FT1JOvP0VxFMnxGIGw8bil2ZDXhazSy9d0=">http://forum.eprints.org/</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Christopher Gutteridge <a href="mailto:totl@soton.ac.uk">&lt;totl@soton.ac.uk&gt;</a> <o:p></o:p></pre>
<pre>You should read our team blog at <a href="http://blog.soton.ac.uk/webteam/">http://blog.soton.ac.uk/webteam/</a><o:p></o:p></pre>
</div>
</body>
</html>