<html><body>
<p><font size="2" face="sans-serif">Dear List</font><br>
<br>
<font size="2" face="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.</font><br>
<br>
<font size="2" face="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...</font><br>
<br>
<font size="2" face="sans-serif">What do you recommend?</font><br>
<br>
<font size="2" face="sans-serif">Jens</font><br>
<br>
<font size="2" face="sans-serif">-- <br>
Jens Vieler<br>
Zentrale Informatik<br>
Universität Zürich<br>
Stampfenbachstrasse 73<br>
CH-8006 Zürich<br>
<br>
mail: jens.vieler@id.uzh.ch<br>
phone: +41 44 63 56777<br>
<a href="http://www.id.uzh.ch">http://www.id.uzh.ch</a></font><br>
<br>
<img width="16" height="16" src="cid:1__=4EBB0A4FDFD44AE68f9e8a93df9@lotus.uzh.ch" border="0" 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"><font size="2" color="#424282" face="sans-serif">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</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">Von:        </font><font size="1" face="sans-serif">Andrew Collington <a.p.collington@sussex.ac.uk></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">An:        </font><font size="1" face="sans-serif">"eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Datum:        </font><font size="1" face="sans-serif">07.03.2017 12:44</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Betreff:        </font><font size="1" face="sans-serif">Re: [EP-tech] Easier way to do this in a citation?</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Gesendet von:        </font><font size="1" face="sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<font size="2" color="#1F497D" face="Calibri">Hi John,</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">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!</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">Andy</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" face="Calibri"><b>From:</b></font><font size="2" face="Calibri"> eprints-tech-bounces@ecs.soton.ac.uk [</font><font size="2" face="Calibri"><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a></font><font size="2" face="Calibri">] </font><font size="2" face="Calibri"><b>On Behalf Of </b></font><font size="2" face="Calibri">John Salter</font><font size="2" face="Calibri"><b><br>
Sent:</b></font><font size="2" face="Calibri"> 03 March 2017 15:58</font><font size="2" face="Calibri"><b><br>
To:</b></font><font size="2" face="Calibri"> eprints-tech@ecs.soton.ac.uk</font><font size="2" face="Calibri"><b><br>
Subject:</b></font><font size="2" face="Calibri"> Re: [EP-tech] Easier way to do this in a citation?</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">Hi Andrew,</font><br>
<font size="2" color="#1F497D" face="Calibri">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!).</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">You could alter your existing code to make the tests clearer:</font><br>
<font size="2" color="#1F497D" face="Calibri"><choose></font><br>
<font size="2" color="#1F497D" face="Calibri"> <when test="event_title and event_location and event_dates"></font><br>
<font size="2" color="#1F497D" face="Calibri"> <print expr="event_title" />, <print expr="event_location"/>, <print expr="event_dates"/>.</font><br>
<font size="2" color="#1F497D" face="Calibri"></when></font><br>
<font size="2" color="#1F497D" face="Calibri"><when test="event_title and event_location"></font><br>
<font size="2" color="#1F497D" face="Calibri"> <print expr="event_title" />, <print expr="event_location"/>.</font><br>
<font size="2" color="#1F497D" face="Calibri"></when></font><br>
<font size="2" color="#1F497D" face="Calibri"><when test="event_title "></font><br>
<font size="2" color="#1F497D" face="Calibri"> <print expr="event_title" />.</font><br>
<font size="2" color="#1F497D" face="Calibri"></when></font><br>
<font size="2" color="#1F497D" face="Calibri"></choose></font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">But this does feel a bit noisy too.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">To add (inject) a custom method to EPrints::Script::Compiled, see the example here: </font><a href="https://wiki.eprints.org/w/ORCID#Rendering_the_ORCID_in_a_citation"><font size="2" color="#0563C1" face="Calibri"><u>https://wiki.eprints.org/w/ORCID#Rendering_the_ORCID_in_a_citation</u></font></a><br>
<font size="2" color="#1F497D" face="Calibri">This keeps the added code in the repository config - and should work over upgrades (unless there's a major rewrite of EPrints::Script).</font><br>
<font size="2" color="#1F497D" face="Calibri">In my opinion, any files in <eprints_root>/archives/<archiveid>/cfg/cfg.d/ should be checked as part of an upgrade.</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">For a similar example, in White Rose Research Online, we wanted to render event dates in a more 'friendly' human way.</font><br>
<font size="2" color="#1F497D" face="Calibri">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'.</font><br>
<font size="2" color="#1F497D" face="Calibri">This </font><a href="https://gist.github.com/jesusbagpuss/491086533294f864de63115c66719def"><font size="2" color="#0563C1" face="Calibri"><u>https://gist.github.com/jesusbagpuss/491086533294f864de63115c66719def</u></font></a><font size="2" color="#1F497D" face="Calibri"> adds a method to EPrints::Script::Compiled that does this conversion. The citation uses:</font><br>
<font size="2" face="Calibri"><if test="event_dates"><print expr="wrro_human_event_dates(event_dates)"/></if></font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri">Hope that helps!</font><br>
<font size="2" color="#1F497D" face="Calibri">Cheers,</font><br>
<font size="2" color="#1F497D" face="Calibri">John</font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" color="#1F497D" face="Calibri"> </font><br>
<font size="2" face="Calibri"><b>From:</b></font><font size="2" face="Calibri"> </font><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><font size="2" color="#0563C1" face="Calibri"><u>eprints-tech-bounces@ecs.soton.ac.uk</u></font></a><font size="2" face="Calibri"> [</font><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><font size="2" color="#0563C1" face="Calibri"><u>mailto:eprints-tech-bounces@ecs.soton.ac.uk</u></font></a><font size="2" face="Calibri">] </font><font size="2" face="Calibri"><b>On Behalf Of </b></font><font size="2" face="Calibri">Andrew Collington</font><font size="2" face="Calibri"><b><br>
Sent:</b></font><font size="2" face="Calibri"> 03 March 2017 13:49</font><font size="2" face="Calibri"><b><br>
To:</b></font><font size="2" face="Calibri"> </font><a href="mailto:eprints-tech@ecs.soton.ac.uk"><font size="2" color="#0563C1" face="Calibri"><u>eprints-tech@ecs.soton.ac.uk</u></font></a><font size="2" face="Calibri"><b><br>
Subject:</b></font><font size="2" face="Calibri"> [EP-tech] Easier way to do this in a citation?</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">Hi all,</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">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:</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri"><if test="is_set(event_title)"></font><br>
<font size="2" face="Calibri"><print expr="event_title"/></font><br>
<font size="2" face="Calibri"></if></font><br>
<font size="2" face="Calibri"><if test="event_location"></font><br>
<font size="2" face="Calibri"><if test="is_set(event_title)">, </if></font><br>
<font size="2" face="Calibri"><print expr="event_location"/></font><br>
<font size="2" face="Calibri"></if></font><br>
<font size="2" face="Calibri"><if test="is_set(event_dates)">, <print expr="event_dates"/></if></font><br>
<font size="2" face="Calibri"><if test="is_set(event_title) or is_set(event_location) or is_set(event_dates)">.</if></font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">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.</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">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?</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">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?</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">Many thanks for any advice,</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">Andy</font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri"> </font><br>
<font size="2" face="Calibri">-- <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: </font><a href="mailto:a.p.collington@sussex.ac.uk"><font size="2" color="#0000FF" face="Calibri"><u>a.p.collington@sussex.ac.uk</u></font></a><br>
<font size="2" face="Calibri"> </font><tt><font size="2">*** Options: </font></tt><tt><font size="2"><a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a></font></tt><tt><font size="2"><br>
*** Archive: </font></tt><tt><font size="2"><a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a></font></tt><tt><font size="2"><br>
*** EPrints community wiki: </font></tt><tt><font size="2"><a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a></font></tt><tt><font size="2"><br>
*** EPrints developers Forum: </font></tt><tt><font size="2"><a href="http://forum.eprints.org/">http://forum.eprints.org/</a></font></tt><tt><font size="2"><br>
</font></tt><br>
</body></html>