From b057cff72846fe42438fd4afb428fbe7b2ee8ff0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 6 Apr 2012 16:32:13 -0400 Subject: [PATCH] kpac : added content work 1. Consolidated added content apache configs under /eg 2. Added (untested) code to support LibraryThing reviews. -- It looks like we'll need to coordinate w/ LT to get it all hooked up. More research pending. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/examples/apache/eg_vhost.conf | 34 +++++++++---------- .../parts/{chilifresh.tt2 => acimport.tt2} | 22 ++++++++++-- Open-ILS/src/templates/kpac/parts/base.tt2 | 2 +- Open-ILS/src/templates/kpac/record.tt2 | 1 + 4 files changed, 38 insertions(+), 21 deletions(-) rename Open-ILS/src/templates/kpac/parts/{chilifresh.tt2 => acimport.tt2} (57%) diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index 62980a2783..4e2ee8fed6 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -572,6 +572,23 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] PerlAddVar OILSWebTemplatePath "/openils/var/templates" #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin" + #------------------------------------------------- + # Added Content Configuration + #------------------------------------------------- + # Content Cafe + #SetEnv OILS_CONTENT_CAFE_USER MYUSER + #SetEnv OILS_CONTENT_CAFE_PASS MYPASS + + # LibraryThing + #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID + #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID + + # ChiliFresh + #SetEnv OILS_CHILIFRESH_ACCOUNT + #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js + #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js + #------------------------------------------------- + SetOutputFilter DEFLATE BrowserMatch ^Mozilla/4 gzip-only-text/html @@ -604,30 +621,13 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] ExpiresActive On ExpiresByType text/html "access plus 5 seconds" PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example" - - # 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 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader" - # 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 - - # Note: the template processor will decline handling anything it does not # have an explicit configuration for, which means it will fall back to # Apache to serve the file. However, in the interest of speed, go ahead diff --git a/Open-ILS/src/templates/kpac/parts/chilifresh.tt2 b/Open-ILS/src/templates/kpac/parts/acimport.tt2 similarity index 57% rename from Open-ILS/src/templates/kpac/parts/chilifresh.tt2 rename to Open-ILS/src/templates/kpac/parts/acimport.tt2 index 9366f602c4..7017cffd6e 100644 --- a/Open-ILS/src/templates/kpac/parts/chilifresh.tt2 +++ b/Open-ILS/src/templates/kpac/parts/acimport.tt2 @@ -1,13 +1,29 @@ -[%- IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT AND ctx.page == 'record'; +[% + # added content only shows on record detail page + IF ctx.page == 'record'; + + # chilifresh + IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT; chili_url = ENV.OILS_CHILIFRESH_URL; IF CGI.https AND ENV.OILS_CHILIFRESH_HTTPS_URL; chili_url = ENV.OILS_CHILIFRESH_HTTPS_URL; - END; -%] + END %] + + [% END; + + # LibraryThing + IF ENV.OILS_LIBRARYTHING_URL; + lt_url = ENV.OILS_LIBRARYTHING_URL; + IF CGI.https AND ENV.OILS_LIBRARYTHING_HTTPS_URL; + lt_url = ENV.OILS_LIBRARYTHING_HTTPS_URL; + END %] + + + [% END %] [%- END %] diff --git a/Open-ILS/src/templates/kpac/parts/base.tt2 b/Open-ILS/src/templates/kpac/parts/base.tt2 index e80a4c18fc..0685035855 100644 --- a/Open-ILS/src/templates/kpac/parts/base.tt2 +++ b/Open-ILS/src/templates/kpac/parts/base.tt2 @@ -16,6 +16,6 @@ [% INCLUDE 'kpac/parts/footer.tt2' %] - [%- INCLUDE 'kpac/parts/chilifresh.tt2' %] + [%- INCLUDE 'kpac/parts/acimport.tt2' %] diff --git a/Open-ILS/src/templates/kpac/record.tt2 b/Open-ILS/src/templates/kpac/record.tt2 index e34ea29145..63888089b8 100644 --- a/Open-ILS/src/templates/kpac/record.tt2 +++ b/Open-ILS/src/templates/kpac/record.tt2 @@ -32,6 +32,7 @@
+