ILO Labordoc translator problem
Firstly, many thanks to adamsmith for creating a translator for our library!
There seems to be problem in the translator though, some records are freezing the import.
1. test1
2. From "Select Items" window, select items and press "OK".
The import does not work.
4. However, in the single item mode the import does work, please try:
test2
This happens in the following environments:
Zotero 3.0.13
Firefox ESR 10.0.6
SUSE Linux Enterprise Server 11 (x86_64)
or
Zotero 3.0.13
Firefox 18.0.2
Microsoft Windows XP, SP3
from the debug log:
....
zotero(4): Translate: Parsing code for COinS
zotero(4): Translate: Parsing code for DOI
zotero(4): Translate: Parsing code for Embedded Metadata
zotero(3): Translate: All translator detect calls and RPC calls complete
zotero(5): Translate: Running handler 0 for translators
zotero(4): Translate: Parsing code for ILO Labordoc
zotero(3): Translate: Beginning translation with ILO Labordoc
zotero(5): Translate: Running handler 0 for select
zotero(3): Created hidden browser (0)
zotero(3): Zotero.HTTP.processDocuments: Loading http://labordoc.ilo.org/record/455778?ln=en
...process hangs
First I thought it has something to do with special characters or single quotes in the title. But I'm not sure anymore, after many tests and debugging I fail to understand what happens to the hidden browser.
And the last curiosity, in this environment it works:
Zotero 3.0.13 Standalone with Zotero Connector 3.0.8.1
Google Chrome Version 24.0.1312.57 m
Microsoft Windows XP, SP3
So is it some Firefox bug?
Thanks for any help.
There seems to be problem in the translator though, some records are freezing the import.
1. test1
2. From "Select Items" window, select items and press "OK".
The import does not work.
4. However, in the single item mode the import does work, please try:
test2
This happens in the following environments:
Zotero 3.0.13
Firefox ESR 10.0.6
SUSE Linux Enterprise Server 11 (x86_64)
or
Zotero 3.0.13
Firefox 18.0.2
Microsoft Windows XP, SP3
from the debug log:
....
zotero(4): Translate: Parsing code for COinS
zotero(4): Translate: Parsing code for DOI
zotero(4): Translate: Parsing code for Embedded Metadata
zotero(3): Translate: All translator detect calls and RPC calls complete
zotero(5): Translate: Running handler 0 for translators
zotero(4): Translate: Parsing code for ILO Labordoc
zotero(3): Translate: Beginning translation with ILO Labordoc
zotero(5): Translate: Running handler 0 for select
zotero(3): Created hidden browser (0)
zotero(3): Zotero.HTTP.processDocuments: Loading http://labordoc.ilo.org/record/455778?ln=en
...process hangs
First I thought it has something to do with special characters or single quotes in the title. But I'm not sure anymore, after many tests and debugging I fail to understand what happens to the hidden browser.
And the last curiosity, in this environment it works:
Zotero 3.0.13 Standalone with Zotero Connector 3.0.8.1
Google Chrome Version 24.0.1312.57 m
Microsoft Windows XP, SP3
So is it some Firefox bug?
Thanks for any help.
It seems like something must have changed on the Labordoc side. How long have you seen this behavior?
There's a small chance that it will just go away in a day or two.
http://labordoc.ilo.org/search?ln=en&p=argentina&f=&action_search=Search&c=ILO+publications&c=Other+publications
so that's even stranger.
We could get around this by going straight to the MarcXML:
you can have a look here
https://gist.github.com/adam3smith/4965440
and install the translator by downloading it using the "Raw" link at the top right and placing it in the Zotero data directory,
www.zotero.org/support/zotero_data
verwriting the old one (which you can always restore)
The downside is that this version doesn't get the pdfs from the page. We could get them from the MARC, though, if they're always in the same place, do you happen to know? (I see them in <datafield tag="856" ind1="4" ind2=" "> e.g. here: http://labordoc.ilo.org/record/440523?ln=en
var docxml = (new DOMParser()).parseFromString(text, "text/xml");
ns = {
"marc": "http://www.loc.gov/MARC21/slim"
};
var xpath = '//marc:datafield[@tag="856"]/marc:subfield[contains(text(),".pdf")]/text()';
var pdflink = ZU.xpath(docxml, xpath, ns);
I have started to make an ILOMARC.js, based on existing MARC.js and
an ILO house style CSL. Once those are ready, I suppose then I send
a message to Zotero development mailing list for those to be added
to Zotero?
For new translators, pull request to
https://github.com/zotero/translators is best - that way we can more easily comment on the code.
ILOMARC is so different from MARC that it requires its own translator? Since I assume a lot of it would be duplicate code it'd be nice to see if we couldn't do this either by modifying MARC or by using the item handler in the Labordoc translator
Any further problems let us know & thanks again for the quasi-patch, I used it literally.
I believe the MARC translator is meant for a general use and it would be annoying for other users, if it is full of exceptions for our catalogue only. That's why the ILOMARC translator. Another questions is that since it is really MARCXML what we have there, should I instead make a new ILOMARCXML translator? I am hesitating a little, modifying the MARC translator is the lazy and faster way. I'm a novice in Zotero, if you have opinions or advices, please let me know.
Also, because you'll work through MARCXML for Labordoc, you'd still have to add an ILOMARCXML translator - which would be exactly the same as MARCXML, but call on ILOMARC instead of MARC.
So yes, it's almost certainly better to do thin with the XML directly.
Any technical questions on translators please post to Zotero dev:
https://groups.google.com/forum/?fromgroups=#!forum/zotero-dev
so this doesn't become too technical & scares away regular users.