Princeton Primo Translator
Hello,
I'm trying to save to Zotero from Princeton's Primo installation and running into constant errors. I always get the message:
"An error occurred while saving this item. Check Known Translator Issues for more information."
The URL to a sample record is here. http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?docId=PRN_VOYAGER2778598&vid=PRINCETON&institution=PRN&showPNX=true
Do you think this would be an easy fix? I am just now reading up about primo integration in general but don't believe we have ShowPNX enabled. Suggestions how to get this working?
I'm trying to save to Zotero from Princeton's Primo installation and running into constant errors. I always get the message:
"An error occurred while saving this item. Check Known Translator Issues for more information."
The URL to a sample record is here. http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?docId=PRN_VOYAGER2778598&vid=PRINCETON&institution=PRN&showPNX=true
Do you think this would be an easy fix? I am just now reading up about primo integration in general but don't believe we have ShowPNX enabled. Suggestions how to get this working?
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
If that's the case, it'd be great if you could report this to Princeton library - they wanted to have their own translator included in Zotero, so they're in charge of maintaining it - we'll be happy to answer any questions, but I don't think that should be that hard for them to fix.
[JavaScript Error: "superCleanString: argument must be a string"]
Since no line is mentioned with the error, it's hard to know where to look. Has anyone encountered this problem before? Are there a few 'hotspots' in a translator file that this problem would be expected?
Submitted a debug report if it helps:556499599
https://github.com/zotero/translators/blob/master/Princeton%20Catalog.js#L136
but the underlying problem is that the translator simply doesn't find a title in the PNX (i.e. Primo's XML) data, which is presumably the case because the PNX format changed - as I say, the regular Primo translator does fine on that page.
http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?docId=PRN_VOYAGER2778598&vid=PRINCETON&institution=PRN&showPNX=true
showPNX=true does not work when this syntax is used. For Primo libraries who use deep links and want to support Zotero a different path to PNX must be provided. In the standard translator some has been put in to handle this:
https://github.com/zotero/translators/blob/master/Primo.js#L96
We will either submit a patch that includes this pass through for the Princeton translator or request that our current custom translator be retired in favor of the standard one which seems much expanded than when we first put in our custom one.
Regards,
Kevin Reiss
Princeton University Library
More info here:
https://forums.zotero.org/discussion/31294/possible-solution-for-primo-bug/
We have a working showPNX.jsp script on our server:
http://searchit.princeton.edu/primo_library/libweb/showPNX.jsp?=PRN_VOYAGER7343340
However when using Primo.js with the followign URL:
http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?docId=PRN_VOYAGER7343340
&vid=PRINCETON&institution=PRN
I get this error logged to the Zotero console:
(3)(+0000001): HTTP GET http://searchit.princeton.edu/primo_library/libweb/showPNX.jsp?id=0
(3)(+0002048): Translate: Function 0 did not work.
(3)(+0000001): HTTP GET http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?institution=PRN&vid=PRINCETON&docId=PRN_VOYAGER7343340&showPnx=true
(3)(+0000279): Translate: Function 1 did not work.
(3)(+0000000): Translate: Could not determine PNX url from http://searchit.princeton.edu/primo_library/libweb/action/dlDisplay.do?institution=PRN&vid=PRINCETON&docId=PRN_VOYAGER7343340
(3)(+0000000): Translate: Translation successful
(5)(+0000000): Translate: Running handler 0 for done
It appears that the translator is having trouble fetching the PNX ID from the dlDisplay.do page.
http://searchit.princeton.edu/primo_library/libweb/showPNX.jsp?id=0
(see e.g. the Mannheim catalog linked or the Oxford catalog in the test)
working off the active session.
It would seem like a more robust solution to work with the actual docIds, but I probably won't have the time to look at that very soon. Obviously we'd accept a patch as long as it doesn't break anything else
http://solo.bodleian.ox.ac.uk/primo_library/libweb/showPNX.jsp?id=0
actually go out and fetch the PNX data for the test URL in the translator.
http://solo.bodleian.ox.ac.uk/primo_library/libweb/action/dlDisplay.do?docId=oxfaleph010311597&vid=OXVU1
It's not the most robust solution - if you have Primo open in two tabs it creates chaos, e.g. - so something more robust would be good.
<?xml version="1.0" encoding="UTF-8"?>
header (of course with an appropriate encoding, since it doesn't seem to be UTF-8)Also, the translator is working fine for me with the "showPnx=true" method. Though the URL it fetches is different from what you see: http://searchit.princeton.edu/primo_library/libweb/action/display.do?dscnt=1&elementId=1&vl(1UI0)=contains&recIdxs=1&frbrVersion=&scp.scps=scope:(OTHERS),scope:(FIRE),scope:(RECAP),scope:(EAD)&tab=location&dstmp=1387230551869&srt=rank&mode=Basic&vl(157986346UI0)=any&indx=2&tb=t&renderMode=poppedOut&vl(freeText0)=war&vid=PRINCETON&fn=search&frbg=&displayMode=full&ct=display&dum=true&recIds=PRN_VOYAGER6129606&doc=PRN_VOYAGER6129606&tabs=detailsTab&fromLogin=true&showPnx=true
Not sure how important that is, but it would obviously be nice if it worked.
Our "getPnx" pass through should return XML in proper character encoding and with the XML declaration and now seems to work quite well with the standard translator in the repository for Primo. Sorry for the delay in responding. The one problem with the getPnx approach is one needs filesystem access to your Primo environment to put it in place.
<addata>
<aulast>Nath</aulast>
<aufirst>Anjali.</aufirst>
<au>Nath, Anjali</au>
<atitle>
Seeing Guantánamo, Blown Up: Banksy’s Installation in Disneyland
</atitle>
<jtitle>American Quarterly</jtitle>
<date>2013</date>
<risdate>2013</risdate>
<volume>65</volume>
<issue>1</issue>
<spage>185</spage>
<epage>192</epage>
<issn>0003-0678</issn>
<eissn>1080-6490</eissn>
<genre>article</genre>
<ristype>JOUR</ristype>
<url>
http://muse.jhu.edu/journals/american_quarterly/v065/65.1.nath.html
</url>
</addata>
Thanks,
Paul