EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #10058
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
RE: [EP-tech] Creators, authors, editors names
- To: "eprints-tech@unitedgames.co.uk" <eprints-tech@unitedgames.co.uk>
- Subject: RE: [EP-tech] Creators, authors, editors names
- From: Will Hughes <w.p.hughes@reading.ac.uk>
- Date: Sat, 22 Mar 2025 23:12:52 +0000
CAUTION: This e-mail originated outside the University of Southampton. Andrew OK, now I have got to grips with compound fields, I have been able to make some progress on rendering multiple authors. I built up this snippet in ..\archives\arcom\cfg\citations\eprint\default.xml I set up three cases: single author, two authors and more. The first two cases were easy, and they work perfectly. But I cannot figure out how to get this third case to work. The epadmin reload fails to even parse the default.xml because of the multi-author part of this snippet: <epc:if test="is_set(creators_name)"> <epc:choose> <epc:when test="length(creators_name) = 1"> <epc:print expr="creators_name" /> </epc:when> <epc:when test="length(creators_name) = 2"> <epc:list join=" and "> <epc:item><epc:print expr="creators_name" /> </epc:item> </epc:list> </epc:when> <epc:otherwise> <epc:foreach expr="creators_name" iterator="name"> <epc:if test="!length(creators_name)=$index"> <epc:print expr="; " /> <epc:item><epc:print expr="$name" /> </epc:if> <epc:if test="length(creators_name)=$index"> <epc:print expr=" and " /> <epc:item><epc:print ; expr="$name" /> </epc:item> </epc:if> </epc:foreach> </epc:otherwise> </epc:choose> </epc:if> The problem comes from trying to deal with joining the final name to the list with " and ", while joining all the other with the semi-colon. If anyone with more experience than me can suggest how to get this to work, that would be great! Thank you in advance Best wishes Will Hughes --------------- -----Original Message----- From: Andrew M <eprints-tech@unitedgames.co.uk> Sent: 21 March 2025 18:05 To: Will Hughes <w.p.hughes@reading.ac.uk> Cc: eprints-tech@ecs.soton.ac.uk Subject: Re: [EP-tech] Creators, authors, editors names Am seeing the same on my AWS demo EPrint 3.4.4 install (excuse the lack of ssl atm): https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2F18.232.191.141%2Fid%2Feprint%2F42%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784646469%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=d%2B6%2Bq2TJp8lct%2BOCRMeEyFpE0kN68nQ2UNDamxxGpUQ%3D&reserved=0 It also is the same on the exciting cutting edge next-generation public preview of EPrints 3.5: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpub.demo35.eprints-hosting.org%2Fid%2Feprint%2F1421%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784671011%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=fzO7av5Iuht7fOrxLBL6LvWwgF%2FoDh7dy41S8i53lDU%3D&reserved=0 Good news: ---------- That means you haven't broken anything, =). Guess work: ----------- Commas appear to be name part delimiters, while "and" appears to be people (entire name) delimiters - so my guess is that's why it's not also a comma out of the box. Maybe there's an argument for a semi colon to be made? Your question - answered off the top of my head: ------------------------------------------------ Would need to look into it / do due diligence, but I believe off the top of my head, that creators_names is a short cut to the names sub field within the creators compound field. Compound fields are described here: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FCompound_field&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784688777%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=DGiN49yzR1GeMxNw2mXNOOJdviAwfOFLgwn1yOrbSyQ%3D&reserved=0 Or you can back up to the parent page to get more of an overview: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FMetadata&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784706499%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=HzrJqEVpezXDc6pnhEcLmLnHD1c%2BUHQhEuosZ2u7wNg%3D&reserved=0 The creators_name will be defined (as far as the publications flavour of EPrints is concerned) here: /opt/eprints3/flavours/pub_lib/cfg.d/eprint_fields.pl You'll see it's a compound, called "creators" consisting of a "name" and "id" sub field. Shortcuts to these therefore are creators_name and creators_id. So the data is in the database; the field is defined in the configuration - in order of user config (eprints3/archives/arcom/cfg/cfg.d) overriding flavour config (eprints3/flavours/pub_lib/cfg.d), overiding base config (eprints3/lib/cfg.d); and workflow templates and citation templates are just templates for how the field and its data are handled. If you are changing code, you can always use source code management tools like git, to track all the changes you make, and revert them back if you think you've screwed up. I often use the git flow workflow, and might do a git diff comparison between how the code was before my alterations, and how it is presently, in order to determine if I did mess anything up. Of course, the original of each release is also on github so can be seen in a web browser too, if you want a less command driven approach to spotting the difference and wish to manually browse the originals in a web browser. I also recall you can pass the desired template to be used during rendering - so if you are messing about with code, but don't want to mess about with the default template, you can create a template with a custom name, and then call it specifically in your code, passing in the custom template name. I.e. if you look at the render_citation method example in the CORE API: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FCore_API&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784723973%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=AimCnkWjKBssj7Oeas9VhoF%2BikxuseV00ihgodIKZzw%3D&reserved=0 ...you'll see the first param it takes after $self - the eprint or other dataobj the method is being called from - is a '$style' - this is basically the file name of your template without the .xml extension - i.e. 'default' for the default.xml template, or 'custom_will_huges_template' for any custom_will_huges_template.xml you attempt. Of course, the easiest way to mess with code without worrying about it, is to make all your changes to copies of the system files in your own /opt/eprints3/archives/arcom/cfg/ directory. That way if you screw up, you can delete your screw up, and things will revert back to the publications flavour files, and fallback to the system files, etc. So it is pretty idiot proof. So this is just a matter of confidence building. You're doing well. Don't be thrown by odd default citation formatting. Yours, Andrew. Quoting Will Hughes <w.p.hughes@reading.ac.uk>: > Andrew > > Thank you for helping me to reflect on this. I have been looking very > closely at the folders you mention and the resources you suggest. I'm > sure I could adapt the code to not have 'and' between every author. > What bothered me was that I had not previously noticed this behaviour. > I assumed that the software would not have been set up to create > malformed citations, and that my tweaks must somehow have knocked a > hole in the code somewhere. I wanted to ascertain whether this was a > simple repair to the installation or where the citation of multiple > authors was normally incorrect! > > Does anyone know whether the 'creators_names' comes from the input > workflow or the citation modules? I'm worried about undoing perfectly > good coding and the cumulative effects of changing basic routines! > > Best wishes > > Will > ____ > ________________________________ > From: eprints-tech-request@ecs.soton.ac.uk > <eprints-tech-request@ecs.soton.ac.uk> on behalf of Andrew M > <eprints-tech@unitedgames.co.uk> > Sent: Thursday, March 20, 2025 4:12:13 PM > To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk> > Subject: Re: [EP-tech] Creators, authors, editors names > > CAUTION: This e-mail originated outside the University of Southampton. > > CAUTION: This e-mail originated outside the University of Southampton. > > I recall from when I worked at EPrints, there were templates > specifically for citations, that governed how authors were presented. > > I've completely forgotten what files these were and where, so will > look it up for you again now. > > Okay - looking at my own installation, there appear to be system > citation templates in the ... > /opt/eprints3/lib/citations/eprint > ...folder, > and flavour level citation templates in the... > /opt/eprints3/flavours/pub_lib/citations/eprint/ > ...folder. > > When I look at the past work I did on a possible improvement to > citations with orcid IDs in them, I see I put some custom citation > templates in... > cfg/citations/eprint/ > ...so presumably that implies you could copy... > /opt/eprints3/flavours/pub_lib/citations/default.xml > ...to your own... > /opt/eprints3/archives/arcom/cfg/citations/eprint/default.xml > ...and then edit it away from there, and hopefully it'll work (may > have to restart apache)? > > Do I really know what I'm talking about? > Erm, might be worth watching the youtube channel again for a recap: > https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-D4hEsRB0g4%26t%3D1697s&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784740990%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=2NoE68Epli2IvAVgpGEBhGqC%2FJHrCrLdotH7V3wdnM4%3D&reserved=0 > ...hmm...that video features a brief mention of the two system > directories, and advice to make your own copy to edit rather than edit > the system ones. > > But yeah, generally, this is a quick reply off the top of my head, and > I haven't checked the paths I've mentioned for typos - so double check > all this with another source like the EPrints Wiki - but the key thing > you're likely looking to change are citation templates for EPrint > records, and armed with that knowledge, you may be able to find your > answers more easily by searching for citation-related stuff. > > If you've already got your xml template, and are just trying to figure > out how to edit the templates, these are some great resources here: > > https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPScript%2FIntroduction&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784759070%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=V%2BWFjh3umwGkBuI8JGftx2jILcijtDBFN%2BvN0IvMgRc%3D&reserved=0 > > https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPScript%2FFunctions&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784777883%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=lu1ZRM62eQvAKFTXECBd2KXcCZ8NcevH9aZsXVG6YzY%3D&reserved=0 > > https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FCategory%3AEPrints_Metadata_Fields%23Other_Prop&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C7609977b196a497748e308dd69971361%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638782819784795308%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=hEHDaMmeBBhtDKrgJksiH5lfguOi5Vc3JdIJhGxRgsE%3D&reserved=0 > erties > > Yours, > Andrew. > > Quoting Will Hughes <w.p.hughes@reading.ac.uk>: > >> CAUTION: This e-mail originated outside the University of Southampton. >> CAUTION: This e-mail originated outside the University of Southampton. >> Hi >> >> Sorry to jump in again. First, thank you to those who have helped me >> with my configuration of my metadata catalogue. It has been quite a >> task but it now works (mostly!) >> >> The puzzle I have been wrestling with today, I am getting no closer >> to solving. It occurs in all citations, in editing, in view, in >> browsing and in search results. Every multiple-authored item (3+) in >> my repo is showing all names separated by 'and' instead of by commas. >> One and Two-author papers show correctly. >> >> I have looked through dozens of .pl, .pm and .xml files, but I cannot >> find where the routine is that would deal with this, and I'm worried >> that something may have got deleted or removed by mistake... >> >> Can anyone help, please? >> >> Best wishes >> >> Will >> ____
- Follow-Ups:
- Re: [EP-tech] Creators, authors, editors names
- From: Florian Heß <hess@ub.uni-heidelberg.de>
- Re: [EP-tech] Creators, authors, editors names
- References:
- Re: [EP-tech] Creators, authors, editors names
- From: Andrew M <eprints-tech@unitedgames.co.uk>
- Re: [EP-tech] Creators, authors, editors names
- From: Will Hughes <w.p.hughes@reading.ac.uk>
- Re: [EP-tech] Creators, authors, editors names
- From: Andrew M <eprints-tech@unitedgames.co.uk>
- Re: [EP-tech] Creators, authors, editors names
- Prev by Date: Re: [EP-tech] Creators, authors, editors names
- Next by Date: [EP-tech] Links dynamically generated lose the "/cgi" part
- Previous by thread: Re: [EP-tech] Creators, authors, editors names
- Next by thread: Re: [EP-tech] Creators, authors, editors names
- Index(es):