From d698321e9f96c2d75dab4cfe9a68a91e061cda68 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 8 Jul 2011 12:22:24 -0400 Subject: [PATCH] Support for embedded Content Cafe on details page Added support for two new Apache environment variables OILS_CONTENT_CAFE_USER and OILS_CONTENT_CAFE_PASS. If set, a Content Cafe pane will be loaded (via iframe) directly into a new "Summaries & More" section on the record details page of the TT-pac, when the section is expanded. In addition to the C. Cafe content, we also show the 520 bib summary in the same pane. "Summaries & More" is only visible if either there is 520 data or there is a suitable identifier (isbn or upc) and the content cafe configuration is in place. Signed-off-by: Bill Erickson --- Open-ILS/examples/apache/eg_vhost.conf | 10 ++++++++-- Open-ILS/web/css/skin/default/opac/style.css | 1 + .../templates/default/opac/parts/misc_util.tt2 | 1 + .../default/opac/parts/record/extras.tt2 | 14 +++++++++++++- .../default/opac/parts/record/summaryplus.tt2 | 15 +++++++++++++++ 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index e8ca3ecbbc..e0571c8d9d 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -118,13 +118,12 @@ RewriteRule . - [E=locale:%1] # Specify the initial script URL for Novelist (containing account credentials, etc.) #SetEnv OILS_NOVELIST_URL - + # # Uncomment to force SSL any time a patron is logged in. This protects # authentication tokens. Left commented out for backwards compat for now. #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1 - # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js #SetEnv OILS_OPAC_COMBINED_JS 1 @@ -566,6 +565,13 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] # Expire the HTML quickly since we're loading dynamic data for each page ExpiresActive On ExpiresByType text/html "access plus 5 seconds" + + # For use with embedded Content Cafe content + #SetEnv OILS_CONTENT_CAFE_USER 123 + #SetEnv OILS_CONTENT_CAFE_PASS 456 + # Consider copying/moving other added content configs + # (e.g. NOVELIST) into here or to an outer container shared by + # both /opac and /eg/opac since some are used in both places diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index caba3e06a4..0e7ffda077 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -1001,3 +1001,4 @@ a.dash-link:hover { text-decoration: underline !important; } .rdetail-author-div { padding-bottom: 10px; } .invisible { visibility: hidden; } +.rdetail-extras-summary { margin: 10px; } diff --git a/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 b/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 index 0e7cd2c492..b8e3e9ccf8 100644 --- a/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 @@ -10,6 +10,7 @@ args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; + args.summary = xml.findnodes('//*[@tag="520"]/*[@code="a"]').textContent; args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent || xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent || xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent; diff --git a/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 b/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 index 66b49179a9..2a86d0e22a 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 @@ -2,8 +2,20 @@
[% # Hidden extras are not yet implemented. Some may require JS + + # Let's see if we should hide the content cafe / simple summary content + hide_summary = 1; + IF attrs.summary; hide_summary = 0; ELSE; + # Expose content cafe if it's reasonable to do so. + # This approach only works when using embedded content cafe. + IF ENV.OILS_CONTENT_CAFE_USER; + ident = attrs.isbn_clean || attrs.upc; + IF ident; hide_summary = 0; END; + END; + END; + extras = [ - {name => 'summary', label => l('Summaries & More'), hide => 1}, # Content Cafe + {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary}, {name => 'content', label => l('Contents'), hide => 1}, # ToC {name => 'authors', label => l('Authors')}, {name => 'series', label => l('Series'), hide => 1}, diff --git a/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 new file mode 100644 index 0000000000..32af899d46 --- /dev/null +++ b/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 @@ -0,0 +1,15 @@ +
+ [% IF attrs.summary %] +
+ [% l('Summary: ') %][% attrs.summary %] +
+ [% END %] + + + [% ident = attrs.isbn_clean || attrs.upc %] + +
+ -- 2.43.2