Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library Catalog (Encore).js doesn't work outside of Zotero #16

Open
Halibutt opened this issue Aug 12, 2015 · 9 comments
Open

Library Catalog (Encore).js doesn't work outside of Zotero #16

Halibutt opened this issue Aug 12, 2015 · 9 comments

Comments

@Halibutt
Copy link

Referred from zotero/translators issue #933

Recently the National Library of Poland (www.bn.org.pl) switched to a new OPAC system Encore. The links work perfectly well in Zotero (FF, Chrome, all the same). A book is correctly identified as a book, all the fields get imported correctly, it works like a charm. When I export the citation from Zotero using the native Wikipedia exporter, it looks perfectly healthy.

BUT, it seems the translator does not work outside of the Zotero program, neither on translation-server nor - more importantly for me - in Citoid, the new Wikipedia's citation system based on Zotero's translators. Links that were correctly scraped as books in Zotero either return weird errors or are incorrectly identified as web pages, this book for instance.

I filed a bug at Citoid's Phabricator, but it seems the problem is on translation server side, not with Citoid. The guys over at the translators' git referred me here. Could anyone tell me how to make this beauty work?

@wetneb
Copy link

wetneb commented Sep 1, 2015

If I am not wrong, this translator is not enabled for translation-server (it would require the "v" code):

"browserSupport": "gcsb",

Have you tried with the patch proposed in zotero/translators#920? (Actually, Citoid probably already deals with this problem by default…)

@Halibutt
Copy link
Author

Hmmm... I pinged the Citoid guys to check whether this is the issue, thanks a lot.
Cheers

@mvolz
Copy link
Contributor

mvolz commented Sep 23, 2015

Yeah, we tried enabling it. Doesn't work still :( See comment here: https://phabricator.wikimedia.org/T108772#1530977

Re: zotero/translators#920 Some, but not all, of the disabled translators do not work when enabled. Usually it's a problem with getting the resource via the server versus a browser, we have that trouble with citoid as well. This site also throws the native citoid scraper for a loop too.

@Halibutt
Copy link
Author

Perhaps it's a bug inside Encore itself? I mailed the iii.com guys, hopefully they'll be able to shed some light on it.

@Halibutt
Copy link
Author

Halibutt commented Nov 1, 2015

Sadly, no reply from them as of yet.

@Halibutt
Copy link
Author

Unfortunately, no updates in any of the threads. There is a workaround for the National Library of Poland (their old OPAC system is still online), but all the other libraries out there using Encore are a no-go still.

@dstillman
Copy link
Member

So this isn't my department, but I believe the issue here is that the translator uses processDocuments() to load non-HTML/XML data. This works in the client because the client's processDocuments() uses a hidden browser, which gives you a Document, and the text can be extracted via a virtual pre element. But translation-server's processDocuments() uses XMLHttpRequest's responseType = 'document', which will return null for non-Document response (e.g., MARC data).

This could probably fixed by using doGet() instead in the translator. @simonster could say whether this is something that could be fixed easily in translation-server. Based on 92c698c, it seems like using 'document' (instead of doing conditional parsing of responseText) might be done solely to allow for doc.defaultView, which is only used in three translators.

@Halibutt
Copy link
Author

@dstillman, thank you! I didn't understand much of what you wrote above, but at least there is hope :)

@Halibutt
Copy link
Author

Halibutt commented Nov 3, 2017

So, @simonster & @dstillman , any chance anyone looks into it? How can I help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants