[EP-tech] Re: cgi/search?myfield=foobar&action=export&format=xml (or whatever the syntax...)
Andy.Reid at lshtm.ac.uk
Thu Sep 24 11:42:46 BST 2015
The situation is that our publications are initially imported to a local Publications database, which has an API to generate EPXML, which is then pulled into eprints by a fiendish Harvester maintained by Rory over at ULCC, where the repository is hosted. The record structure in eprints includes a custom field - lshtm_pub_id - recording the recordID of the source record in the publications database, but because the synchronisation is pulled from the eprints end, the DB never gets to find out what the resulting eprint ID is. In order to link through from the pubsDB to eprints, we have a link that searches on the lshtm_pub_id , e.g.
http://www.lshtm.ac.uk/publications/list.php?filter=list&value=(26205126) the link to ResearchOnline gives something like this (I've stripped out the PMID search elements below for clarity) - I'm not sure that all those parameters are necessary, but it works:
What I'm after is just to use that search in a programmatic context, so that it just returns the matching eprint ID(s), rather than the whole page. I'm sure it's simple when you know how, but the inline documentation of the cgi script is... terse, to put it politely - Even a one line #Usage:.. example would probably make all the difference.
>>> "Field A.N." <af05v at ecs.soton.ac.uk> 24 September 2015 10:53 >>>
EPrints searches are all controlled by cgi parameters, including exporting, so if a configured search exists, then you are able to pull out XML data from it (as long as the XML exporter is enabled). If you send me your repository URL and an example of a search you might want to run, I'll tell you how to build the query you're after.
Business Relationship Manager and Community Lead
+44 (0)23 8059 8814
On 23 Sep 2015, at 18:33, Andy Reid wrote:
> I've searched around but can't find any basic documentation of the cgi/search function, and my mental perl interpreter is struggling with the source code.
> Q: Is it possible with the CGI search interface to send a query string naming a field and a search term, and specify the return format as XML - either full XML for matching records(minus files), or a better still a list of eprint IDs that match the search? It looks like it should be possible, but a simple example would be a whole lot easier than reverse-engineering the whole search script in my head.
> Thanks in anticipation
> Andy Reid
> Research Information Manager
> Room G43, Executive Office
> London School of Hygiene & Tropical Medicine
> Keppel St
> LONDON WC1E 7HT
> +44 020-7927-2618
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Eprints-tech