4 j = ws.bootstrap_client("/pines/conf/bootstrap.conf");
9 IF CGI.param('pagesize');
10 pagesize = CGI.param('pagesize');
13 itempage = CGI.param('page');
15 #type,string,location,depth
16 count_meth = 'open-ils.search.biblio.class.count';
18 #type,string,location,depth,limit,offset
19 search_meth = 'open-ils.search.biblio.class';
21 session = ws.init_app_session('open-ils.search');
23 type = CGI.param('mr_search_type');
24 string = CGI.param('mr_search_query');
25 location = CGI.param('mr_search_location');
26 depth = CGI.param('mr_search_depth');
27 max_rank = CGI.param('max_rank');
29 offset = (itempage - 1) * pagesize;
35 count_req = session.request(count_meth, type, string, location, depth);
36 id_req = session.request(search_meth, type, string, location, depth, limit, offset);
38 j = count_req.wait_complete();
39 count = count_req.recv().content();
42 j = id_req.wait_complete();
43 list = id_req.recv().content();
46 IF max_rank == '{relevanceScale}';
53 xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"
54 xmlns:openIll="http://open-ils.org/xml/openIll/1.0">
56 <title>Pines Catalogue Search: [% string | html %] </title>
57 <link>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 %]&pagesize=[% pagesize %]&max_rank=[% max_rank %]</link>
58 <description>Search results for "[% string | html %]" at gapines.org</description>
59 <language>en-us</language>
60 <copyright>&copy;2004-2005, Georga Public Library Service.</copyright>
61 <openSearch:totalResults>[% count %]</openSearch:totalResults>
62 <openSearch:startIndex>[% offset + 1 %]</openSearch:startIndex>
63 <openSearch:itemsPerPage>[% pagesize %]</openSearch:itemsPerPage>
69 FOREACH mr_id IN mr_list;
70 req = session.request('open-ils.search.biblio.metarecord.mods_slim.retrieve', mr_id.0);
71 j = req.wait_complete();
76 ' <openIll:relevanceScale>' _ max_rank _ "</openIll:relevanceScale>\n";
78 rank = mr_id.1 / max_rank;
80 rank = rank.split('\.').0;
82 mods = req.recv().content();
87 <title>[% mods.title() | html %]</title>
88 <link>http://gapines.org/opac/?sub_frame=1&target=record_result&page=0&mrid=[% mr_id.0 %]&hits_per_page=10</link>
89 <openIll:relevance>[% rank %]</openIll:relevance>
94 <div style="float: left;">
95 <a href="http://gapines.org/opac/?sub_frame=1&target=record_result&page=0&mrid=[% mr_id.0 %]&hits_per_page=10">
97 style="padding: 3px; border: none;"
100 src="http://images.amazon.com/images/P/[% mods.isbn().replace('\s+','') %].01.MZZZZZZZ.jpg">
107 <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>
112 <b>Subjects:</b>
114 FOREACH sub IN mods.subject().keys;
123 <a href="http://gapines.org/opac/?sub_frame=1&target=mr_result&mr_search_type=subject&mr_search_query=[% sub | uri | html %]&page=0&mr_search_depth=[% depth %]&mr_search_location=[% location %]">[% sub | html %]</a>[%
129 l = mods.online_loc();
131 '<b>Other Resources:</b>';
134 saw = { 'no' => 'no' };
141 h = l.list.$h | uri | html;
142 t = l.list.$t | html;
153 '<a href="' _ h _ '">' _ t _ '</a>&nbsp;';
162 <b>Copies Available:</b> [% mr_id.2 %]