<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:"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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
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;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {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;}
/* List Definitions */
@list l0
        {mso-list-id:411203097;
        mso-list-type:hybrid;
        mso-list-template-ids:1943431432 134807569 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Jens,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">We had a similar issue a while ago - which was being caused by on-the-fly (or request-driven) view generation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">For author views, where some authors do not have a unique ID, this is computationally intensive, and it is better addressed by making
sure you are in control of the page generation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If the pages have already been generated, normal bot activity should not be an issue.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">We addressed the issue by:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Changing the max_age of the person view (and in the end, all views) so regeneration is never triggered by a request<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Changing the generate_views to be able to accept multiple viewids<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">3)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Changing the cronjob to generate all views *<b>except</b>* the person one daily, and the person one once a week<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">The details are here:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://github.com/eprints/eprints/pull/417">https://github.com/eprints/eprints/pull/417</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Our 'subject' and 'year' views have
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">max_menu_age => 10*24*60*60, #10 days<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">max_list_age => 10*24*60*60, #10 days<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">But our 'people' view has:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">max_menu_age => 20*24*60*60, #20 days<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">max_list_age => 20*24*60*60, #20 days<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Our crontab looks a bit like this (with the above additions in place):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"># # # Generate subject and year views Mon-Fri<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">10 3 * * 1-5 <eprints_root>/bin/generate_views <archiveid> --view year --view subject<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"># # # Generate people view on Sunday<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">10 5 * * 0 <eprints_root>/bin/generate_views <archiveid> --view people<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">It might be worth checking to see if your person views are being generated on-the-fly - look at the modification time of the browse
pages - compare them to the bot activity. If they are being re-generated by a request the above will help. If not… more thinking to do!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",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:"Calibri",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:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </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:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>jens.vieler@id.uzh.ch<br>
<b>Sent:</b> 07 March 2017 13:30<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> [EP-tech] Bot net Attacks<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Dear List</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">during the last 2 weeks we observe some really tricky bot net attacks. Thousands of requests seem to ask for author information and as a result, we ran into disk space problems during the massive
pagecreation for /view/authorsnew into the cache.</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">We did some interesting experiments with apaches mod_evasive. But unfortunately bot nets change their behaviour to maximum allowed acces per timeframe we configured. Looks like they know what to
do to drive eprints into trouble...</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">What do you recommend?</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">Jens</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">-- <br>
Jens Vieler<br>
Zentrale Informatik<br>
Universität Zürich<br>
Stampfenbachstrasse 73<br>
CH-8006 Zürich<br>
<br>
mail: <a href="mailto:jens.vieler@id.uzh.ch">jens.vieler@id.uzh.ch</a><br>
phone: +41 44 63 56777<br>
<a href="http://www.id.uzh.ch">http://www.id.uzh.ch</a></span><br>
<br>
<img border="0" width="16" height="16" id="_x0000_i1025" src="cid:image001.gif@01D29748.E7CDA820" alt="Inactive hide details for Andrew Collington ---07.03.2017 12:44:27---Hi John, That helps a huge amount, thanks you so much! Th"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#424282">Andrew
Collington ---07.03.2017 12:44:27---Hi John, That helps a huge amount, thanks you so much! This gives me a great base on which to maybe</span><br>
<br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#5F5F5F">Von: </span>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif">Andrew Collington <<a href="mailto:a.p.collington@sussex.ac.uk">a.p.collington@sussex.ac.uk</a>></span><br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#5F5F5F">An: </span>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif">"<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>" <<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>></span><br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#5F5F5F">Datum:
</span><span style="font-size:7.5pt;font-family:"Arial",sans-serif">07.03.2017 12:44</span><br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#5F5F5F">Betreff:
</span><span style="font-size:7.5pt;font-family:"Arial",sans-serif">Re: [EP-tech] Easier way to do this in a citation?</span><br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#5F5F5F">Gesendet von:
</span><span style="font-size:7.5pt;font-family:"Arial",sans-serif"><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a></span><o:p></o:p></p>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi John,</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">That helps a huge amount, thanks you so much! This gives me a great base on which to maybe add some functionality of our own and the citation reworking using the choose/when does
make it a bit clearer until I do (hopefully) get something written. So many thanks for a very helpful response!</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Andy</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a> [<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>]
<b>On Behalf Of </b>John Salter<b><br>
Sent:</b> 03 March 2017 15:58<b><br>
To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><b><br>
Subject:</b> Re: [EP-tech] Easier way to do this in a citation?</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Andrew,</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I don't think there is a easy way to do what you require in the existing epscript functions (but there is a way to add it - more on that below!).</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">You could alter your existing code to make the tests clearer:</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><choose></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> <when test="event_title and event_location and event_dates"></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> <print expr="event_title" />, <print expr="event_location"/>, <print expr="event_dates"/>.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></when></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><when test="event_title and event_location"></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> <print expr="event_title" />, <print expr="event_location"/>.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></when></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><when test="event_title "></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> <print expr="event_title" />.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></when></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></choose></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">But this does feel a bit noisy too.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">To add (inject) a custom method to EPrints::Script::Compiled, see the example here:
</span><a href="https://wiki.eprints.org/w/ORCID#Rendering_the_ORCID_in_a_citation"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#0563C1">https://wiki.eprints.org/w/ORCID#Rendering_the_ORCID_in_a_citation</span></a><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">This keeps the added code in the repository config - and should work over upgrades (unless there's a major rewrite of EPrints::Script).</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">In my opinion, any files in <eprints_root>/archives/<archiveid>/cfg/cfg.d/ should be checked as part of an upgrade.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">For a similar example, in White Rose Research Online, we wanted to render event dates in a more 'friendly' human way.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">They are stored in the database as 'yyyy-mm-dd - yyyy-mm-dd' (or just yyyy-mm-dd if it was a one-day event), and we wanted e.g. '1-3 Mar 2017' '28 Feb - 1 Mar 2017' or '31 Dec 2016
- 2 Jan 2017'.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">This
</span><a href="https://gist.github.com/jesusbagpuss/491086533294f864de63115c66719def"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#0563C1">https://gist.github.com/jesusbagpuss/491086533294f864de63115c66719def</span></a><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> adds
a method to EPrints::Script::Compiled that does this conversion. The citation uses:</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="event_dates"><print expr="wrro_human_event_dates(event_dates)"/></if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hope that helps!</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Cheers,</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">John</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><br>
<b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#0563C1">eprints-tech-bounces@ecs.soton.ac.uk</span></a><span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> [</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#0563C1">mailto:eprints-tech-bounces@ecs.soton.ac.uk</span></a><span style="font-size:10.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Andrew Collington<b><br>
Sent:</b> 03 March 2017 13:49<b><br>
To:</b> </span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#0563C1">eprints-tech@ecs.soton.ac.uk</span></a><b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><br>
Subject:</span></b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> [EP-tech] Easier way to do this in a citation?</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">Hi all,</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">I’ve recently had to add a few new rules in a citation for a conference proceeding. At the moment I have a number of checks that look something like this:</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="is_set(event_title)"></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><print expr="event_title"/></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"></if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="event_location"></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="is_set(event_title)">, </if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><print expr="event_location"/></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"></if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="is_set(event_dates)">, <print expr="event_dates"/></if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"><if test="is_set(event_title) or is_set(event_location) or is_set(event_dates)">.</if></span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">So it’ll only add a comma before the location if the title is supplied, etc. and the full-stop at the end if any event details are shown. But, well, as you can see it’s a pretty messy way to do
things and wondered if there were something a little more streamlined available that would allow you to supply a list of fields and it’ll then automatically put commas between values if the values are there and a full-stop at the end if needs be? I’m only
trying to do this with cite tags in citations/eprints/default.xml.</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">I did see a ‘pretty_list’ function in Compiled.pm that looks like it may do something like what I want, but despite trying I didn’t see how I could pull this into a citation nor could I find any
documentation on the subject. Is that possible?</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">If this kind of functionality doesn’t already exist, then what’s the best course of action to adding new types of actions to cite tags? Is it possible to create my own class do add extra actions,
or should I update existing modules? (which seems like a bad idea if ever wanting to upgrade). Is there any documentation about doing this kind of thing?</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">Many thanks for any advice,</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">Andy</span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif">-- <br>
Andrew Collington<br>
Web Programmer, ITS Client Services<br>
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT<br>
<br>
T: (01273) 872591 (ext. 2591)<br>
E: </span><a href="mailto:a.p.collington@sussex.ac.uk"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif">a.p.collington@sussex.ac.uk</span></a><br>
<span style="font-size:10.0pt;font-family:"Calibri",sans-serif"> </span><tt><span style="font-size:10.0pt">*** Options:
<a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a></span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a></tt><br>
<tt>*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a></tt><br>
<tt>*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a></tt></span><o:p></o:p></p>
</div>
</body>
</html>