Bug 6147 : Correcting invalid RSS
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-opensearch.tt
blob14a5f3ea95f8783ea0752a23eb22536067d70307
1 <?xml version='1.0' encoding='utf-8' ?>
2 [% IF ( opensearchdescription ) %]
3 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
4 <ShortName>[% LibraryName |html %] Search</ShortName>
5 <Description>Search the [% LibraryName |html %]</Description>
6 <Tags>koha opac [% LibraryName |html %]</Tags>
7 <Contact>[% KohaAdminEmailAddress |html %]</Contact>
8 <Url type="application/rss+xml"
9 template="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?q={searchTerms}&amp;pw={startPage?}&amp;format=rss2"/>
10 </OpenSearchDescription>
12 [% ELSE %]
14 [% IF ( rss2 ) %]
15 <rss version="2.0"
16 xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
17 xmlns:dc="http://purl.org/dc/elements/1.1/"
18 xmlns:atom="http://www.w3.org/2005/Atom">
19 <channel>
20 <title><![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]></title>
21 <link>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2</link>
22 <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;sort_by=[% sort_by |html %]&amp;format=rss2"/>
23 <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %] at [% LibraryName |html %]]]></description>
24 <opensearch:totalResults>[% total %]</opensearch:totalResults>
25 <opensearch:startIndex>[% offset %]</opensearch:startIndex>
26 [% IF ( results_per_page ) %]
27 <opensearch:itemsPerPage>[% results_per_page %]</opensearch:itemsPerPage>
28 [% ELSE %]
29 <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
30 [% END %]
31 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
32 <atom:link rel="search" type="application/opensearchdescription+xml" href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&amp;sort_by=[% SEARCH_RESULT.sort_by |html %]&amp;format=opensearchdescription"/>
33 <opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |url %][% SEARCH_RESULT.limit_desc |url %]" startPage="[% SEARCH_RESULT.page %]" />
34 <item>
35 <title>[% SEARCH_RESULT.title |html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield |html %][% END %]</title>
36 <dc:identifier>ISBN [% SEARCH_RESULT.isbn |html %]</dc:identifier>
37 <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% END %][% END %]</link>
38 <description><![CDATA[
39 [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
40 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %][% END %]" alt="" />
41 [% ELSE %]
42 <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
43 [% END %][% END %][% END %]
45 [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% END %][% END %]
46 <p>[% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author |html %]. [% END %]
47 [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place |html %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode |html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear |html %]
48 [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate |html %][% END %][% END %]
49 [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages |html %][% END %]
50 [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes |html %][% END %]
51 [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size |html %]. [% END %]
52 [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %] </p><p>
53 [% IF ( RequestOnOpac ) %]
54 <a href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
55 [% END %]
56 ]]></description>
57 <guid>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</guid>
58 </item>
59 [% END %]
60 </channel>
61 </rss>
62 [% END %]
64 [% IF ( atom ) %]
65 <feed xmlns="http://www.w3.org/2005/Atom"
66 xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
67 <id>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=atom</id>
68 <title>[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc |html %]'[% END %]</title>
69 <link href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2"/>
70 <updated>[% timestamp %]</updated>
71 <author>
72 <name>[% LibraryName |html %]</name>
73 </author>
74 <!-- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> -->
75 <opensearch:totalResults>[% total %]</opensearch:totalResults>
76 <opensearch:startIndex>[% page %]</opensearch:startIndex>
77 [% IF ( results_per_page ) %]
78 <opensearch:itemsPerPage>[% results_per_page %]</opensearch:itemsPerPage>
79 [% ELSE %]
80 <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
81 [% END %]
82 <opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page |html %]" />
83 <link rel="alternate" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&amp;format=atom" type="application/atom+xml"/>
84 <link rel="self" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]&amp;format=atom" type="application/atom+xml"/>
85 <link rel="first" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=1&amp;format=atom" type="application/atom+xml"/>
86 <link rel="previous" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=2&amp;format=atom" type="application/atom+xml"/>
87 <link rel="next" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=4&amp;format=atom" type="application/atom+xml"/>
88 <link rel="last" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&amp;format=atom" type="application/atom+xml"/>
89 <link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
91 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
92 <entry>
93 <title>[% SEARCH_RESULT.title |html %]</title>
94 <link href="[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]"/>
95 <!-- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> -->
96 <updated>[% SEARCH_RESULT.timestamp %]</updated>
97 <content type="text"><!-- put content here -->
98 </content>
99 <id>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</id>
100 </entry>
101 [% END %]
102 </feed>
103 [% END %]
105 [% END %]