<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)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1103844197;
        mso-list-type:hybrid;
        mso-list-template-ids:958316786 1229503444 201916419 201916421 201916417 201916419 201916421 201916417 201916419 201916421;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:DengXian;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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 lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Cheers, Martin.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In the plugin I was working on, I’ve created even more complex templates (by setting footerjs in the WRAPPER directive), but that plugin isn’t public at the moment.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Actually, I’m probably going to not publish that plugin in the end, as it wasn’t scalable enough. The synchronous processing was just too slow. It would be tempting to rearchitect it to use asynchronous processing, but we’ll need more work done for on the task queue front for that. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Although this plugin has made me think more about what would be needed there:<o:p></o:p></p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Plugin sends message to RabbitMQ<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>RabbitMQ sends message to Background Worker<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Background Worker invokes desired Plugin method for long-running job<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Plugin or Background Worker stores results somewhere that can be used later by a Koha web user.<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve been learning Gitlab CI lately and it’s essentially the same model (but without the RabbitMQ). <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>David Cook<o:p></o:p></p><p class=MsoNormal>Software Engineer<o:p></o:p></p><p class=MsoNormal>Prosentient Systems<o:p></o:p></p><p class=MsoNormal>72/330 Wattle St<o:p></o:p></p><p class=MsoNormal>Ultimo, NSW 2007<o:p></o:p></p><p class=MsoNormal>Australia<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal>Online: 02 8005 0595<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Koha-devel <koha-devel-bounces@lists.koha-community.org> <b>On Behalf Of </b>Renvoize, Martin<br><b>Sent:</b> Tuesday, 8 September 2020 8:47 PM<br><b>To:</b> Koha Devel <koha-devel@lists.koha-community.org><br><b>Subject:</b> Re: [Koha-devel] Using Template::Toolkit WRAPPER in Koha plugins<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Looks like a nice approach to me, thanks for the example.<o:p></o:p></p><div><p class=MsoNormal><br clear=all><o:p></o:p></p><div><div><div><div><div><div><div><div><div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=410 style='width:307.5pt'><tr><td style='padding:0cm 0cm 0cm 0cm'></td></tr></table><p class=MsoNormal><span style='display:none'><o:p> </o:p></span></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=450 style='width:337.5pt'><tr><td width=300 style='width:225.0pt;padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Martin Renvoize</span></strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'><o:p></o:p></span></p></td><td style='border:none;border-bottom:none black 1.0pt;padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><a href="https://www.ptfs-europe.com/" target="_blank"><span style='font-family:"Times New Roman",serif;text-decoration:none'><img border=0 width=175 height=26 style='width:1.8229in;height:.2708in' id="_x0000_i1025" src="https://www.ptfs-europe.com/wp-content/uploads/2018/10/ptfs-logo-full-email-sig.png"></span></a><span style='font-family:"Times New Roman",serif'><o:p></o:p></span></p></td></tr><tr><td colspan=2 style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Development Team Manager<o:p></o:p></span></p><p style='margin:0cm;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Community Release Manager (19.11, 20.05)<o:p></o:p></span></p></td></tr><tr><td colspan=2 style='padding:0cm 0cm 0cm 0cm'></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Phone:</span></strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'> +44 (0) 1483 378728<o:p></o:p></span></p></td><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Mobile:</span></strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'> +44 (0) 7725 985 636<o:p></o:p></span></p></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Email:</span></strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'> <a href="mailto:martin.renvoize@ptfs-europe.com" target="_blank"><span style='color:#2D5C88'>martin.renvoize@ptfs-europe.com</span></a><o:p></o:p></span></p></td><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Fax:</span></strong><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'> +44 (0) 800 756 6384<o:p></o:p></span></p></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'></td><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm;line-height:15.0pt'><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'><a href="https://www.ptfs-europe.com" target="_blank"><span style='color:#2D5C88'>www.ptfs-europe.com</span></a><o:p></o:p></span></p></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm'><span style='font-family:"Arial",sans-serif'> <o:p></o:p></span></p></td><td style='padding:0cm 0cm 0cm 0cm'></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm'><span style='font-family:"Arial",sans-serif'> <o:p></o:p></span></p></td><td style='padding:0cm 0cm 0cm 0cm'></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p style='margin:0cm'><span style='font-family:"Arial",sans-serif'> <o:p></o:p></span></p></td><td style='padding:0cm 0cm 0cm 0cm'></td></tr></table><p class=MsoNormal><span style='display:none'><o:p> </o:p></span></p><table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='border:none;border-top:solid #C2C2C2 1.0pt'><tr><td style='border:none;padding:15.0pt 0cm 0cm 0cm'><p style='margin:0cm'><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>Registered in the United Kingdom No. 06416372   VAT Reg No. 925 7211 30<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p style='margin:0cm'><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#2D5C88'>The information contained in this email message may be privileged, confidential and protected from disclosure. If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited. If you think that you have received this email message in error, please email the sender at <a href="mailto:info@ptfs-europe.com" target="_blank">info@ptfs-europe.com</a><o:p></o:p></span></p></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p></div></div></div></div></div></div></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, 4 Sep 2020 at 07:26, <<a href="mailto:dcook@prosentient.com.au">dcook@prosentient.com.au</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi all,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I just wanted to share how I’ve used Template::Toolkit WRAPPER in a Koha plugin. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>All the details are available at <a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26381" target="_blank">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26381</a>, but basically it boils down to creating 1 wrapper template, and then invoking that using the WRAPPER directive in individual Koha plugin templates like <a href="http://report-step1.tt" target="_blank">report-step1.tt</a>. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>It reduces the boiler plate required for each plugin template whether that wrapper template is provided by the Koha plugin or by Koha (both approaches have pros and cons). <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>For a long time, I’ve wanted to use WRAPPER with Koha more broadly, but Koha plugins provide a great opportunity for using them with no refactoring of existing code.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Anyway, I hope that others find this useful. I’m going to have a bit of fun with it.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>David Cook<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Software Engineer<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Prosentient Systems<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>72/330 Wattle St<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Ultimo, NSW 2007<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Australia<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Online: 02 8005 0595<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>Koha-devel mailing list<br><a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br><a href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a><br>git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a><br>bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a><o:p></o:p></p></blockquote></div></div></body></html>