# 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;
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&mr_search_type=[% type %]&mr_search_query=[% string %]&page=[% itempage %]&mr_search_depth=[% depth %]&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&mr_search_type=[% type %]&mr_search_query=[% string | uri | html %]&page=[% itempage %]&mr_search_depth=[% depth %]&mr_search_location=[% location %]</link>
+ <description>Search results for "[% string | html %]" at gapines.org</description>
<language>en-us</language>
<copyright>&copy;2004-2005, Georga Public Library Service.</copyright>
<openSearch:totalResults>[% count %]</openSearch:totalResults>
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&page=0&mrid=[% mr_id.0 %]&hits_per_page=10</link>
+ <title>[% mods.title() | html %]</title>
+ <link>http://gapines.org/opac/?sub_frame=1&target=record_result&page=0&mrid=[% mr_id.0 %]&hits_per_page=10</link>
+ <rank>[% rank %]</rank>
<description>
- <b>Author:</b> <a href="http://http://gapines.org/opensearch/?target=mr_result&mr_search_type=author&mr_search_query=[% mods.author() %]&page=1&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% mods.author() %]</a><br>
+[%-
+ IF mods.author();
+-%]
+ <b>Author:</b> <a href="http://gapines.org/opac/?sub_frame=1&target=mr_result&mr_search_type=author&mr_search_query=[% mods.author() | uri | html %]&page=0&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% mods.author() | html %]</a><br>
+[%-
+ END;
+ IF mods.subject();
+-%]
<b>Subjects:</b>
[%-
FOREACH sub IN mods.subject();
- IF loop.count() > 5;
+ IF loop.count() > 3;
', ...';
LAST;
END;
IF loop.index;
', ';
END;
- -%]<a href="http://http://gapines.org/opensearch/?target=mr_result&mr_search_type=subject&mr_search_query=[% sub.list.0 %]&page=1&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% sub.list.0 %]</a>[%-
+ -%]<a href="http://gapines.org/opac/?sub_frame=1&target=mr_result&mr_search_type=subject&mr_search_query=[% sub.list.0 | uri | html %]&page=0&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% sub.list.0 | html %]</a>[%-
END;
-%]<br>
- <b>Available:</b> [% mr_id.2 %]
+[%-
+ END;
+-%]
+ <b>Copies Available:</b> [% mr_id.2 %]
</description>
</item>
[%-