From b05b2f2649a14f6fba24281e354b8ad7614dd572 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 28 Jun 2011 17:04:08 -0400 Subject: [PATCH] Add RefWorks export support for a record details page 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 Signed-off-by: Dan Scott --- .../web/templates/default/opac/parts/config.tt2 | 19 ++++++++++++++++++ .../default/opac/parts/record/refworks.tt2 | 23 ++++++++++++++++++++++ .../default/opac/parts/record/summary.tt2 | 5 +++++ Open-ILS/web/templates/default/opac/record.tt2 | 1 + 4 files changed, 48 insertions(+) create mode 100644 Open-ILS/web/templates/default/opac/parts/config.tt2 create mode 100644 Open-ILS/web/templates/default/opac/parts/record/refworks.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 index 0000000000..fd1c3e9a64 --- /dev/null +++ b/Open-ILS/web/templates/default/opac/parts/config.tt2 @@ -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 index 0000000000..23af9a359f --- /dev/null +++ b/Open-ILS/web/templates/default/opac/parts/record/refworks.tt2 @@ -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; +%] + diff --git a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 index 4dbfadca79..7cdfbc981a 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 @@ -1,6 +1,11 @@ [% ctx.page_title = attrs.title | html_entity %] + +[% IF ctx.refworks.enable == 'true' %] + [% INCLUDE 'default/opac/parts/record/refworks.tt2' %] +[% END %] + diff --git a/Open-ILS/web/templates/default/opac/record.tt2 b/Open-ILS/web/templates/default/opac/record.tt2 index 0149bf18dd..bc5275c3c2 100644 --- a/Open-ILS/web/templates/default/opac/record.tt2 +++ b/Open-ILS/web/templates/default/opac/record.tt2 @@ -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") %] -- 2.11.0