Possible Solution for Primo Bug
The primo translator https://github.com/zotero/translators/blob/master/Primo.js is not working for articles because the PNX was not accessible for PrimoCentral. Mehmet Celik from the KU Leuven shows a way, how it is possible for libraries to access the PNX also for PrimoCentral data:
http://www.exlibrisgroup.org/display/PrimoCC/showPNX+Revisited
This solution works with an jsp-file on the primo-server and a little bookmarklet. I think it should now also be possible to use this jsp-file for the primo-translator for zotero. What do you think?
http://www.exlibrisgroup.org/display/PrimoCC/showPNX+Revisited
This solution works with an jsp-file on the primo-server and a little bookmarklet. I think it should now also be possible to use this jsp-file for the primo-translator for zotero. What do you think?
https://dl.dropboxusercontent.com/u/59474281/Primo-with-jsp.js
This is the "normal" Primo.js where there is some more code for primo implementations with the jsp file. The whole idea is here that I suggest to provide *one* translator for all primo sites: If the translator is invoked on a primo site with the jsp-file then there will be some code for that. If the translator is invoked on a primo site without the jsp-file then it will work as before.
How does this look for you?
(1) http://purdue-primo-prod.hosted.exlibrisgroup.com/primo_library/libweb/action/search.do?vid=PURDUE
(2) http://primo.bib.uni-mannheim.de/primo_library/libweb/action/search.do?vid=MAN_UB
(3) http://limo.libis.be/primo_library/libweb/action/search.do?vid=LIBISnet&fromLogin=true
(4.a) http://virtuose.uqam.ca/primo_library/libweb/action/search.do?vid=UQAM
(4.b) http://eudoxe.bib.uqam.ca:1701/primo_library/libweb/action/search.do?vid=UQAM&institution=UQAM
Especially, the first two are interesting, because they contain the articles from the PrimoCentral database. The adapted primo translator worked on all tests I tried so far (Primos with and w/o the JSP file). Please let me know if I can help somehow.
https://github.com/zotero/translators/pull/617
might take a bit until it gets accepted, the guy who does most of the reviewing just went on vacations.
Go to the Oxford Primo at http://solo.bodleian.ox.ac.uk/
and search for
Test Valley street map 2006/2007
That item won't import with your modification - l.150-152
https://github.com/zotero/translators/pull/617/files#L0R150
break the XML.
I'll want to keep the CDATA and clean this up on import further down - it's just too fragile - but probably do want to remove the prim: part. Is there anything other than prim: you're removing with that?
i<?xml version="1.0" encoding="UTF-8"?>
The XML breaks downs because it begins with an "i" and not with the XML declaration.
Here is an example of the XML produces by the jsp file (without errors):
https://dl.dropboxusercontent.com/u/59474281/000871081.xml
Possible namespaces are "prim" and maybe "sear" (I can't remember if there were more).
The cleanup in the lines 148, 149, 151, 152, 153 are critical that the translator is doing something. If you feel that the general regular expression is too critical, we could replace it by more specific one(s).
I found out what the problem with Oxford is. For example the following line in the pnx make problems:
<prim:lln03><![CDATA[$$Uhttp://books.google.com/books?lr=&as_drrb_is=q&as_minm_is=0&as_miny_is=&as_maxm_is=0&as_maxy_is=&q=intitle:Thetis+&as_brr=0&as_pt=ALLTYPES&sa=N&start=0$$DSearch for this title in Google Book Search]]></prim:lln03>
Inside the CDATA there are some elements which contradict to the (strict?) XML specification and this is also the problem that the translator will not be able to extract anything. One would have to demasking those elements. Suggestions?
text = text.replace(/\<(prim|sear):([^\>]*)/g, "<$2");
text = text.replace(/\<\/(prim|sear):([^\>]*)/g, "</$2");
As for the CDATA - do we actually need to remove that for the XML to parse? I don't think so, right? If not, we could just remove this further down, something along the line of
item.title = item.title.replace(....)
Edit: sorry, I meant text() in xpath
The CDATA is also present in the pnx file (of library records) at the moment which one will get by adding '&showPnx=true'. The translator can deal with that at the moment. Therefore, you are right and we don't have to clean this up before using some xpath expression.
This will work with translators equipped with the showPnx.jsp file, fix some other issues, mostly with Primo 4 installations, and frequently provide more/better data for articles.
Now, in my tests the journal title is not transformed to zotero via the translator. The line 301:
item.publication = ZU.xpathText(doc, '//addata/jtitle');
is responsible for that. The XPath looks good, but is item.publication or is it item.publicationTitle?
any news about this issue? I still can't import Primo record via Firefox. However, Chrome/Safari Connectors import Primo record pretty good to my Firefox Zotero library. (Stand-alone version works also.)
http://search.obvsg.at/ACC
Search for e.g. 'zotero' - take a record you like.
http://www.zotero.org/support/known_translator_issues - 'Primo: Most Primo catalogs will fail when trying to import articles.'
I've talked to my colleagues - they have the same problem.