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.
  • I can confirm that - for some reason Firefox doesn't load the item page with the processDocuments request, but I don't know why: That's the standard method we use for 9 out of 10 translators (and the translator is very clean&simple) and I wrote and tested this in Firefox originally.
    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.
  • I see that some pages do work:
    http://labordoc.ilo.org/search?ln=en&p=argentina&f=&action_search=Search&c=ILO+publications&c=Other+publications
    so that's even stranger.
  • This behaviour might have been there before. I just noticed that since I will need to create CSL style for us and modify the MARC.js for our data. There has not been changes in the Labordoc.
  • I've looked at this more closely, listened in on http traffic, I have no idea what's going on. This looks exactly the same up to the point where the item page is supposed to load and it doesn't.

    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
  • Great, that works, thanks again! To get pdfs it would be then:

    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?
  • great, I'll put it in.
    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
  • The translator fix is now up. Your version of Zotero will automatically update within 24hs, or you can update manually using the "Update Now" button in the "General" tab of the Zotero preferences.

    Any further problems let us know & thanks again for the quasi-patch, I used it literally.
  • OK, thanks! For your question earlier, ILOMARC is a bit different. It is a long story, legacy reasons mostly. For example I will need to find a document type by looking at certain fields. If some text is found it is a conference paper etc. And this will affect how the item will look like in ILO house style bibliography. Also we use a lot of MARC 900 fields, which are in MARC format reserved for local use.

    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.
  • edited February 19, 2013
    My recommendation would be to modify the existing MARCXML translatorinto ILOMARCXML - if you take a look at the MARCXML, it's a very little translator, that mostly just calls on MARC to do the work. You can then supplement that with custom fields & ideosyncracies.

    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.
  • OK for all. Thanks for being a tutor to Zotero, I may have to change my nickname to anderschydenius:)
Sign In or Register to comment.