4 j = ws.bootstrap_client("/openils/conf/opensrf_core.xml");
7 base_url = 'http://dev.gapines.org/';
10 IF CGI.param('pagesize');
11 pagesize = CGI.param('pagesize');
14 itempage = CGI.param('page');
16 #type,string,location,depth,limit,offset
17 search_meth = 'open-ils.search.biblio.class';
19 session = ws.init_app_session('open-ils.search');
21 type = CGI.param('mr_search_type');
22 string = CGI.param('mr_search_query');
23 location = CGI.param('mr_search_location');
24 depth = CGI.param('mr_search_depth');
25 max_rank = CGI.param('max_rank') || 0;
27 offset = (itempage - 1) * pagesize;
33 id_req = session.request(search_meth, type, string, location, depth, limit, offset);
35 j = id_req.wait_complete();
36 list = id_req.recv().content();
41 IF max_rank == '{relevanceScale}';
47 <rss version="2.0" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
49 <title>Pines Catalogue Search: [% string | html %] </title>
50 <link>[% base_url %]/opac/extras/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>
51 <description>Search results for "[% string | html %]" at dev.gapines.org</description>
52 <language>en-us</language>
53 <copyright>&copy;2004-2005, Georga Public Library Service.</copyright>
54 <openSearch:totalResults>[% count %]</openSearch:totalResults>
55 <openSearch:startIndex>[% offset + 1 %]</openSearch:startIndex>
56 <openSearch:itemsPerPage>[% pagesize %]</openSearch:itemsPerPage>
62 FOREACH mr_id = mr_list;
63 req = session.request('open-ils.search.biblio.metarecord.mods_slim.retrieve', mr_id.0);
64 j = req.wait_complete();
68 ' <openSearch:relevanceScale>' _ max_rank _ "</openSearch:relevanceScale>\n";
71 rank = mr_id.1 / max_rank;
73 rank = rank.split('\.').0;
75 #'<!-- Got a metarecord... ' _ mr_id.0 _ ' relevance: ' _ mr_id.1 _ ' rank: ' _ rank _ ' scale: ' _ max_rank _ '-->';
77 mods = req.recv().content();
82 <title>[% mods.title() | html %]</title>
83 <link>[% base_url %]/opac/en-US/skin/default/xml/rresult.xml?m=[% mr_id.0 %]&l=[% location %]</link>
84 <openSearch:relevance>[% rank %]</openSearch:relevance>
89 <div style="float: left;">
90 <a href="[% base_url %]/opac/en-US/skin/default/xml/rresult.xml?m=[% mr_id.0 %]&l=[% location %]">
92 style="padding: 3px; border: none;"
95 src="http://images.amazon.com/images/P/[% mods.isbn().split('\s+').0 %].01.MZZZZZZZ.jpg">
102 <b>Author:</b> <a href="[% base_url %]/opac/en-US/skin/default/xml/mresult.xml?tp=author&t=[% mods.author() | uri | html %]&l=[% location %]">[% mods.author() | html %]</a><br>
107 <b>Subjects:</b>
109 FOREACH sub IN mods.subject().keys;
118 <a href="[% base_url %]/opac/en-US/skin/default/xml/mresult.xml?tp=subject&mr_search_query=[% sub | uri | html %]">[% sub | html %]</a>[%
124 l = mods.online_loc();
126 '<b>Other Resources:</b>';
129 saw = { 'no' => 'no' };
136 h = l.list.$h | uri | html;
137 t = l.list.$t | html;
148 '<a href="' _ h _ '">' _ t _ '</a>&nbsp;';