Add RefWorks export support for a record details page user/dbs/ttopac-refworks
authorDan Scott <dan@coffeecode.net>
Tue, 28 Jun 2011 21:04:08 +0000 (17:04 -0400)
committerDan Scott <dan@coffeecode.net>
Tue, 28 Jun 2011 21:09:16 +0000 (17:09 -0400)
This marks the addition of a config.tt2 file in parts that can be a
consolidation point for skin-specific settings, such as enabling
particular behaviour, setting proxy information, specific URLs, etc.

RefWorks support is currently driven by the marctxt format in supercat;
TBD if we can easily point at an in-db unapi variation of this. Also,
yet to be done is addition of RefWorks export for lists and search
results.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/web/templates/default/opac/parts/config.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/record/refworks.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/record/summary.tt2
Open-ILS/web/templates/default/opac/record.tt2

diff --git a/Open-ILS/web/templates/default/opac/parts/config.tt2 b/Open-ILS/web/templates/default/opac/parts/config.tt2
new file mode 100644 (file)
index 0000000..fd1c3e9
--- /dev/null
@@ -0,0 +1,19 @@
+[% 
+
+# This file contains skin-level configuration settings.
+# Many of these settings will probably migrate into actor.org_unit_settings.
+
+##############################################################################
+# RefWorks configuration
+##############################################################################
+# RefWorks is a Web-based citation manager
+ctx.refworks.enable = 'false';
+
+# Base URL for RefWorks
+ctx.refworks.url = 'http://www.refworks.com';
+
+# Some sites have a hosted RefWorks instance at a different URL;
+# in addition, you might want to proxy access to RefWorks - for example:
+# ctx.refworks.url = 'http://librweb.laurentian.ca/login?url=http://refworks.scholarsportal.info';
+
+%]
diff --git a/Open-ILS/web/templates/default/opac/parts/record/refworks.tt2 b/Open-ILS/web/templates/default/opac/parts/record/refworks.tt2
new file mode 100644 (file)
index 0000000..23af9a3
--- /dev/null
@@ -0,0 +1,23 @@
+[%
+    # Default to aou.id = 1 in the absence of a specific library
+    loc = 1;
+    IF CGI.param('loc');
+        loc = CGI.param('loc');
+    END;
+
+    # Get the full name of the library
+    ou_name = ctx.get_aou(loc).name | uri;
+
+    # Generate the gross RefWorks URL, based on parameters from config.tt2
+    rw_uri = ctx.refworks.url _ 
+        '/express/expressimport.asp?vendor=' _
+        ou_name _
+        '&filter=MARC+Format&database=All+MARC+Formats&' _
+        'encoding=65001&url=http%3A%2F%2F' _
+        CGI.server_name _ 
+        '/opac/extras/supercat/marctxt/record/' _ 
+        ctx.bre_id;
+%]
+<div class="rdetail_refworks">
+    <a href="[% rw_uri %]">[% l('Export to RefWorks') %]</a>
+</div>
index 4dbfadc..7cdfbc9 100644 (file)
@@ -1,6 +1,11 @@
 [% ctx.page_title = attrs.title | html_entity %]
 <!-- ****************** rdetail_summary.xml ***************************** -->
 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
+
+[% IF ctx.refworks.enable == 'true' %]
+    [% INCLUDE 'default/opac/parts/record/refworks.tt2' %]
+[% END %]
+
 <!-- This holds the record summary information -->
 
 <table width="100%" border="0" cellpadding="0" cellspacing="0" id="rdetail_details_table">
index 0149bf1..bc5275c 100644 (file)
@@ -1,4 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
+    PROCESS "default/opac/parts/config.tt2";
     WRAPPER "default/opac/parts/base.tt2";
     INCLUDE "default/opac/parts/topnav.tt2";
     ctx.page_title = l("Record Detail") %]