OpenURL resolution in TPAC - further cleanup
authorDan Scott <dscott@laurentian.ca>
Thu, 22 Dec 2011 22:13:29 +0000 (17:13 -0500)
committerArt <artrhyno@uwindsor.ca>
Thu, 5 Jan 2012 15:25:37 +0000 (10:25 -0500)
We appear to be getting one null or empty value in the args.issns array,
which was causing spurious lookups of null ISSNs, so skip the entry if
it is an empty string.

Also, switch from the product-specific "sfx" variable name to the
product-neutral "openurls" as we have CUFTS in the mix these days.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Art <artrhyno@uwindsor.ca>

Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index e21b086..51798fb 100644 (file)
 </div>
 
 [%- IF openurl.enabled == 'true';
-    sfx = []
-    FOR issn IN args.issns;
-        sfx = sfx.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
+    openurls = []
+    FOREACH issn IN args.issns;
+        NEXT IF issn == '';
+        openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
     END;
-    IF sfx.size && sfx.0 != '';
+    IF openurls.size && openurls.0 != '';
 %]
     <div id='rdetail_openurl'>
         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
         <table><tbody>
 [%-
-        FOR res IN sfx;
+        FOREACH res IN openurls;
 %]
         <tr>
             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
@@ -71,7 +72,7 @@
     [%- END %]
     </tbody></table>
 [%- END %]
-[%- IF sfx.size && sfx.0 != '' %]
+[%- IF openurls.size && openurls.0 != '' %]
     </div>    
 [%- END %]
 [%- merged_uris = args.uris.merge(args.online_res);
index a5a9ea3..8312379 100644 (file)
                                                             </tr>
                                                         [% END %]
                                                         [%- IF openurl.enabled == 'true';
-                                                            FOR issn IN args.issns;
-                                                                sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl);
-                                                                FOR res IN sfx;
+                                                            FOREACH issn IN args.issns;
+                                                                NEXT IF issn == '';
+                                                                res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
+                                                                FOREACH res IN res_urls;
                                                         %]
                                                         <tr name="results_issn_tr">
                                                             <td valign="top">