Support new-style Novelist for TPAC.
authorBill Erickson <berick@esilibrary.com>
Thu, 11 Oct 2012 20:09:12 +0000 (16:09 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 15 Mar 2013 15:45:49 +0000 (11:45 -0400)
Updates the Novelist loading script to use the newer Novelist API.

Includes minor change to example/apache/eg_vhost.conf for environment
variables.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/examples/apache_24/eg_vhost.conf
Open-ILS/src/templates/opac/parts/acjs.tt2
Open-ILS/src/templates/opac/parts/record/awards.tt2

index 2257bf8..a5e3fcf 100644 (file)
@@ -617,6 +617,12 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     #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
+
+    # Novelist
+    # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
+    # SetEnv OILS_NOVELIST_PROFILE <profile>
+    # SetEnv OILS_NOVELIST_PASSWORD <password>
+
     #-------------------------------------------------
 
     <IfModule mod_deflate.c>
index 438daf5..9cf83ec 100644 (file)
                         });
                     });
                 [% END; # IF status unknown
-            END; 
-        END; # IF ident
+            END  %] 
+
+            /* Load novelist content */
+            novSelect.loadContentForQuery(
+                {
+                    ClientIdentifier : '[% ident %]',
+                    ISBN : '[% ident %]',
+                    version : '2.1'
+                }, 
+                '[% ENV.OILS_NOVELIST_PROFILE %]',
+                '[% ENV.OILS_NOVELIST_PASSWORD %]',
+                function(d){
+                    // note if d.length == 0, there is no content to display
+                    // hide the Loading... text
+                    dojo.byId('novelist-loading').innerHTML = '';
+                }
+            );
+
+        [% END; # IF ident
     %]
 </script>
index 94c72a2..915b0e0 100644 (file)
@@ -7,26 +7,13 @@
             <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
             <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center" width="100%"></div>
         </div>
-    
-        <!-- Reviews from added content provider -->
-        [% IF 0 %] 
-        <strong>[% l('Reviews:') %]</strong>
-        <div style="margin-bottom:20px;"></div>
-        [% END %]
 
         <!-- Novelist suggestions-->
         [% IF ENV.OILS_NOVELIST_URL %] 
-        <strong>[% l('Similar Books:') %]</strong>
-        <div class='rdetail_extras_div'>
-            <div id="NoveListSelect" class="NoveListSelect">
-                <div id="NoveListAnchor" class="NoveListSelect"></div>
-                <div id="novsuggestions"></div>
-                <div id="nextreads"></div>
-                <div id="novrelatedauthors"></div>
-                <div id="novrelateditems"></div>
-            </div>
-        </div>
+            <div id='novelist-loading'>[% l('Loading...') %]</div>
+            <div data-novelist-novelistselect="[% attrs.isbn_clean || attrs.upc %]"></div>
         [% END %]
+
     </div>
 </div>