On Tue, Jun 16, 2009 at 11:18 PM, Warren Layton <[email protected]>wrote:
> Also, I'm including a sample patch against the 1.4 OPAC
> (refworks_opac_1_4.diff), and is only provided as a demonstration of
> how this feature could be enabled (for instance, the <VENDOR> and
> <HOSTNAME> tags in the callback URL need to be replaced with proper
> values for each specific site). See [1] and [2] for more
> info.<http://www.refworks.com/DirectExport.htm#DECallback>
>
Hello again,
Attached is a patch against trunk that automatically generates the <VENDOR>
and <HOSTNAME> for the RefWorks link.
Essentially, <VENDOR> is set to the library's shortname, and <HOSTNAME> is
taken from a CGI object's cgi.server_name attribute. If there's a better way
to get these two bits of information, please let me know!
Cheers,
Warren
Index: Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- Open-ILS/web/opac/skin/default/js/rdetail.js (revision 13399)
+++ Open-ILS/web/opac/skin/default/js/rdetail.js (working copy)
@@ -368,6 +368,20 @@
$('rdetail_place_hold').setAttribute(
'href','javascript:holdsDrawEditor({record:"'+record.doc_id()+'",type:"T"});');
+ var here = findOrgUnit(getLocation());
+ var cgi = new CGI();
+
+ $('rdetail_exp_refworks').setAttribute(
+ 'href',
+ 'http://www.refworks.com/express/expressimport.asp?vendor='
+ +here.shortname()
+ +'+Evergreen&filter=MARC+Format&database=All+MARC+Formats&encoding=65001&url=http%3A%2F%2F'
+ +cgi.server_name+'/opac/extras/supercat/marctxt/record/'
+ +record.doc_id());
+
+ $('rdetail_exp_refworks').setAttribute(
+ 'target', 'RefWorksMain');
+
$('rdetail_img_link').setAttribute('href', buildISBNSrc(cleanISBN(record.isbn()), 'large'));
G.ui.rdetail.image.setAttribute("src", buildISBNSrc(cleanISBN(record.isbn())));
runEvt("rdetail", "recordDrawn");