[OPEN-ILS-DEV] Retrieving and parsing MARC records from the Web
interface
Alexander O'Neill
aoneill at upei.ca
Fri Aug 29 14:44:08 EDT 2008
Hello all, new evergreen person here.
I have a question about retrieving MARC records. I am writing a
modification to the web interface, specifically on the rdetail page,
to print a specific entry from a MARC record just under the main
results table without the user having to click on the MARC Record tab
below to see it.
What I have right now is that I can, when the page loads, call the
FETCH_MARC_HTML (open-ils.search:open-ils.search.biblio.record.html)
request method, and in the callback function print the contents of the
response object.
Now, before I go and parse through the raw HTML, is there a better way
to get the MARC record, as, say, a JSON object? I tried a few
different function calls and none seemed to return any data. I am
using the Debian 1.2.2.3 VMWare image with the default setup.
Here's the code snippet I have right now that does the job before I do
any HTML parsing:
var req = new Request( "open-ils.search:open-
ils.search.biblio.record.html", record.doc_id() );
req.callback(rdetailCategoriesCallback);
req.send();
}
function rdetailCategoriesCallback(r, id) {
var marcrecord;
marcrecord = r.getResultObject();
$('rdetail_categories').appendChild(text(marcrecord));
}
Thanks for your help.
Regards,
-- alexander
---
Alexander O'Neill
Programmer / Analyst
Robertson Library
University of Prince Edward Island
More information about the Open-ils-dev
mailing list