mike stuff + fieldmapper for web stuff
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jun 2005 18:24:50 +0000 (18:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jun 2005 18:24:50 +0000 (18:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@794 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/fieldmapper.pl
Open-ILS/src/extras/opensearch.ttk

index 549b0f8..ab75f5e 100755 (executable)
@@ -8,7 +8,8 @@ my $map = $Fieldmapper::fieldmap;
 # if a true value is provided, we generate the web (light) version of the fieldmapper
 my $web = $ARGV[0];
 # List of classes needed by the opac
-my @web_hints = ("ex", "mvr", "au", "aou","aout", "asv", "asva", "asvr", "asvq");
+my @web_hints = ("ex", "mvr", "au", "aou",
+               "aout", "asv", "asva", "asvr", "asvq", "circ", "acp");
 
 print <<JS;
 
index 25dc2f8..5be64ef 100644 (file)
@@ -31,29 +31,26 @@ IF offset < 0;
        offset = 0;
 END;
 
-req = session.request(count_meth, type, string, location, depth);
-j = req.wait_complete();
+count_req = session.request(count_meth, type, string, location, depth);
+id_req = session.request(search_meth, type, string, location, depth, limit, offset);
 
-count = req.recv().content();
-j = req.finish;
+j = count_req.wait_complete();
+count = count_req.recv().content();
+j = count_req.finish;
 
-IF count > rank_threshold;
-       search_meth = 'open-ils.search.biblio.class.unordered';
-END;
-
-req = session.request(search_meth, type, string, location, depth, limit, offset);
-j = req.wait_complete();
+j = id_req.wait_complete();
+list = id_req.recv().content();
+j = id_req.finish;
 
-list = req.recv().content();
-j = req.finish;
+max_rank = 0;
 
 -%]
 <?xml version="1.0"?>
 <rss version="2.0" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
     <channel>
-      <title>Pines Catalogue Search: [% string %] </title>
-      <link>http://http://gapines.org/opensearch/?target=mr_result&amp;mr_search_type=[% type %]&amp;mr_search_query=[% string %]&amp;page=[% itempage %]&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]</link>
-      <description>Search results for "[% string %]" at gapines.org</description>
+      <title>Pines Catalogue Search: [% string | html %] </title>
+      <link>http://http://gapines.org/opensearch/?target=mr_result&amp;mr_search_type=[% type %]&amp;mr_search_query=[% string | uri | html %]&amp;page=[% itempage %]&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]</link>
+      <description>Search results for "[% string | html %]" at gapines.org</description>
       <language>en-us</language>
       <copyright>&amp;copy;2004-2005, Georga Public Library Service.</copyright>
       <openSearch:totalResults>[% count %]</openSearch:totalResults>
@@ -67,29 +64,48 @@ FOREACH mr_id IN mr_list;
        req = session.request('open-ils.search.biblio.metarecord.mods_slim.retrieve', mr_id.0);
        j = req.wait_complete();
 
+       IF max_rank == 0;
+               max_rank = mr_id.1;
+       END;
+
+       rank = mr_id.1 / max_rank;
+       rank = rank * 100;
+       rank = rank.split('\.').0;
+
        mods = req.recv().content();
        j = req.finish;
 
 -%]
       <item>
-        <title>[% mods.title() %]</title>
-        <link>http://gapines.org/opac/?target=record_result&amp;page=0&amp;mrid=[% mr_id.0 %]&amp;hits_per_page=10</link>
+        <title>[% mods.title() | html %]</title>
+        <link>http://gapines.org/opac/?sub_frame=1&amp;target=record_result&amp;page=0&amp;mrid=[% mr_id.0 %]&amp;hits_per_page=10</link>
+        <rank>[% rank %]</rank>
         <description>
-               &lt;b&gt;Author:&lt;/b&gt; &lt;a href="http://http://gapines.org/opensearch/?target=mr_result&amp;mr_search_type=author&amp;mr_search_query=[% mods.author() %]&amp;page=1&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]"&gt;[% mods.author() %]&lt;/a&gt;&lt;br&gt;
+[%-
+       IF mods.author();
+-%]
+               &lt;b&gt;Author:&lt;/b&gt; &lt;a href="http://gapines.org/opac/?sub_frame=1&amp;target=mr_result&amp;mr_search_type=author&amp;mr_search_query=[% mods.author() | uri | html %]&amp;page=0&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]"&gt;[% mods.author() | html %]&lt;/a&gt;&lt;br&gt;
+[%-
+       END;
+       IF mods.subject();
+-%]
                &lt;b&gt;Subjects:&lt;/b&gt; 
 [%-
        FOREACH sub IN mods.subject();
-               IF loop.count() > 5;
+               IF loop.count() > 3;
                        ', ...';
                        LAST;
                END;
                IF loop.index;
                        ', ';
                END;
-               -%]&lt;a href="http://http://gapines.org/opensearch/?target=mr_result&amp;mr_search_type=subject&amp;mr_search_query=[% sub.list.0 %]&amp;page=1&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]"&gt;[% sub.list.0 %]&lt;/a&gt;[%-
+               -%]&lt;a href="http://gapines.org/opac/?sub_frame=1&amp;target=mr_result&amp;mr_search_type=subject&amp;mr_search_query=[% sub.list.0 | uri | html %]&amp;page=0&amp;mr_search_depth=[% depth %]&amp;mr_search_location=[% location %]"&gt;[% sub.list.0 | html %]&lt;/a&gt;[%-
        END;
 -%]&lt;br&gt;
-               &lt;b&gt;Available:&lt;/b&gt; [% mr_id.2 %] 
+[%-
+       END;
+-%]
+               &lt;b&gt;Copies Available:&lt;/b&gt; [% mr_id.2 %] 
         </description>
       </item>
 [%-