source: main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl@ 32080

Last change on this file since 32080 was 32080, checked in by kjdon, 3 years ago

display name for a facet should come from a displayItem inside the facet element

File size: 25.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsvar="http://www.greenstone.org/skinning-var"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9 extension-element-prefixes="java util"
10 exclude-result-prefixes="java util gsf">
11
12 <!-- use the 'main' layout -->
13 <xsl:import href="layouts/main.xsl"/>
14 <xsl:import href="map-tools.xsl"/>
15 <xsl:import href="panorama-viewer-tools.xsl"/>
16
17 <!-- set page title -->
18 <xsl:template name="pageTitle">
19 <gslib:serviceName/>
20 </xsl:template>
21
22 <!-- set page breadcrumbs -->
23 <xsl:template name="breadcrumbs">
24 <gslib:siteLink/>
25 <gslib:rightArrow/>
26 <xsl:if test="/page/pageResponse/collection">
27 <gslib:collectionNameLinked/>
28 <gslib:rightArrow/>
29 </xsl:if>
30 </xsl:template>
31
32 <!-- do we display the line 'displaying 0 to 20 of 40 documents'-->
33 <!-- on by default. To turn off, add the following in <search> element in collectionConfig.xml:
34 <gsf:option name="hideStatus" value="true"/> -->
35 <xsl:variable name="display_status_bar">
36 <xsl:if test="/page/pageResponse/format[@type='search']/gsf:option[@name='hideStatus']/@value='true'">false</xsl:if></xsl:variable>
37 <!-- the page content -->
38 <xsl:template match="/page">
39 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'qs']) or /page/pageRequest/paramList/param[@name = 'qs']/@value = ''">
40 <xsl:call-template name="queryPage"/>
41 </xsl:if>
42 <xsl:if test="contains(/page/pageRequest/paramList/param[@name='rt']/@value, 'r')">
43 <xsl:call-template name="resultsPage"/>
44 </xsl:if>
45 </xsl:template>
46
47 <xsl:template name="resultsPage">
48 <xsl:call-template name="resultsPagePre"/>
49 <xsl:call-template name="displayMatchDocs"/>
50 <xsl:call-template name="displayTermInfo"/>
51 <xsl:call-template name="displayBaskets"/>
52 <xsl:call-template name="displayResults"/>
53 <xsl:call-template name="resultsPagePost"/>
54 </xsl:template>
55
56 <!-- optional cgi-params for links to document pages -->
57 <xsl:variable name="opt-doc-link-args">p.s=<gsvar:this-service/>
58 </xsl:variable>
59
60 <xsl:template name="displayBaskets">
61 <xsl:if test="$berryBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
62 <div id="rightSidebar">
63 <xsl:if test="$berryBasketOn">
64 <!-- show the berry basket if it's turned on -->
65 <gslib:berryBasket/>
66 <xsl:text> </xsl:text>
67 </xsl:if>
68 <xsl:if test="$documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
69 <gslib:documentBasket/>
70 <xsl:text> </xsl:text>
71 </xsl:if>
72 </div>
73 </xsl:if>
74 </xsl:template>
75
76 <xsl:template name="displayResults">
77 <xsl:if test="/page/pageResponse/facetList/facet">
78 <script type="text/javascript" src="interfaces/{$interface_name}/js/facet-scripts.js">
79 <xsl:text> </xsl:text>
80 </script>
81 <div id="facetSelector">
82 <xsl:for-each select="/page/pageResponse/facetList/facet">
83 <xsl:if test="count(count) > 0">
84 <ul class="facetTable ui-widget-content" indexName="{@name}">
85 <xsl:variable name="serviceName">
86 <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's']/@value"/>
87 </xsl:variable>
88 <xsl:variable name="indexShortName">
89 <xsl:value-of select="@name"/>
90 </xsl:variable>
91 <xsl:variable name="countSize">
92 <xsl:choose>
93 <xsl:when test="/page/pageResponse/format[@type='search']/gsf:option[@name='facetTableRows']">
94 <xsl:value-of select="/page/pageResponse/format[@type='search']/gsf:option[@name='facetTableRows']/@value"/>
95 </xsl:when>
96 <xsl:otherwise>8</xsl:otherwise>
97 </xsl:choose>
98 </xsl:variable>
99
100 <li class="ui-widget-header" style="text-transform:capitalize; text-align:center;">
101 <xsl:value-of select="displayItem[@name='name']"/>
102 </li>
103 <xsl:for-each select="count">
104 <li>
105 <xsl:attribute name="style">
106 <xsl:if test="position() > $countSize">display:none;<xsl:value-of select="$indexShortName"/>
107 </xsl:if>
108 </xsl:attribute>
109 <input type="checkbox" onclick="performRefinedSearch();"/>
110 <span>
111 <xsl:value-of select="@name"/>
112 </span>(<xsl:value-of select="."/>)
113 </li>
114 </xsl:for-each>
115 <xsl:if test="count(count) > $countSize">
116 <li class="expandFacetList{$indexShortName}">
117 <a class="expandFacetListLink{$indexShortName}" href="javascript:expandFacetList('{$indexShortName}', {$countSize});"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.facet.more')"/></a>
118 </li>
119 <li class="collapseFacetList{$indexShortName}" style="display: none;">
120 <a class="collapseFacetListLink{$indexShortName}" href="javascript:collapseFacetList('{$indexShortName}', {$countSize});"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.facet.less')"/></a>
121 </li>
122 </xsl:if>
123 </ul>
124 </xsl:if>
125 </xsl:for-each>
126 </div>
127 </xsl:if>
128 <div id="resultsArea">
129 <xsl:attribute name="class">
130 <xsl:if test="/page/pageResponse/facetList/facet">facetedResults</xsl:if>
131 </xsl:attribute>
132 <table id="resultsTable">
133 <xsl:for-each select="pageResponse/documentNodeList/documentNode">
134 <tr id="div{@nodeID}" class="document">
135 <xsl:apply-templates select="."/>
136 <!-- The berry (optional) -->
137 <td>
138 <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
139 </td>
140 <xsl:call-template name="highlightSnippet">
141 <xsl:with-param name="nodeHASH">
142 <xsl:value-of select="@nodeID"/>
143 </xsl:with-param>
144 </xsl:call-template>
145 <xsl:call-template name="documentNodePost"/>
146 </tr>
147 </xsl:for-each>
148 <br/>
149 </table>
150
151 <!-- Previous/Next buttons-->
152 <xsl:call-template name="prevNextButtons"/>
153 </div>
154 <xsl:if test="/page/pageResponse/facetList/facet">
155 <div style="clear:both;">
156 <xsl:text> </xsl:text>
157 </div>
158 </xsl:if>
159 </xsl:template>
160
161 <xsl:template name="highlightSnippet">
162 <xsl:param name="nodeHASH">
163 </xsl:param>
164 <xsl:for-each select="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]">
165 <tr>
166 <td>
167 </td>
168 <td>
169 <div class="HighlightSnippet">
170 <xsl:value-of select="." disable-output-escaping="yes"/>
171 </div>
172 </td>
173 </tr>
174 </xsl:for-each>
175 </xsl:template>
176 <xsl:template name="queryPage">
177 <xsl:for-each select="pageResponse/service">
178 <form name="QueryForm" method="get" action="{$library_name}/collection/{$collName}/search/{@name}">
179 <div>
180 <input type="hidden" name="a" value="q"/>
181 <input type="hidden" name="sa">
182 <xsl:attribute name="value">
183 <xsl:value-of select="/page/pageRequest/@subaction"/>
184 </xsl:attribute>
185 </input>
186 <input type="hidden" name="rt" value="rd"/>
187
188 <xsl:variable name="ns">s1.</xsl:variable>
189 <xsl:choose>
190 <xsl:when test="/page/pageResponse/hierarchy and paramList/param[@name ='collection']">
191 <xsl:call-template name="hierarchy">
192 <xsl:with-param name="ns" select="$ns" />
193 </xsl:call-template>
194 </xsl:when>
195 <xsl:otherwise>
196 <xsl:for-each select="paramList/param">
197 <xsl:choose>
198 <xsl:when test="@type='multi'">
199 <xsl:apply-templates select=".">
200 <xsl:with-param name="ns" select="$ns"/>
201 </xsl:apply-templates>
202 </xsl:when>
203 <xsl:otherwise>
204 <xsl:call-template name="param-display">
205 <xsl:with-param name="ns" select="$ns"/>
206 </xsl:call-template>
207 </xsl:otherwise>
208 </xsl:choose>
209 </xsl:for-each>
210 </xsl:otherwise>
211 </xsl:choose>
212 <br/>
213 <input type="submit">
214 <xsl:attribute name="value">
215 <xsl:value-of select="displayItem[@name='submit']"/>
216 </xsl:attribute>
217 </input>
218 </div>
219 </form>
220 </xsl:for-each>
221 </xsl:template>
222
223 <xsl:template name="hierarchy">
224 <xsl:param name="ns" />
225 <div class="paramLabel">
226 <xsl:value-of
227 select="paramList/param[@name='collection']/displayItem[@name='name']/text()" />
228 </div>
229 <div class="paramValue">
230 <select multiple="" size='10'>
231 <xsl:attribute name="name">
232 <xsl:value-of select="$ns"></xsl:value-of>
233 <xsl:text>collection</xsl:text>
234 </xsl:attribute>
235 <xsl:for-each select="/page/pageResponse/hierarchy/*">
236 <xsl:call-template name="hierarchy-display">
237 <xsl:with-param name="padding">
238 0
239 </xsl:with-param>
240 <xsl:with-param name="path">
241 <xsl:text>/</xsl:text>
242 </xsl:with-param>
243 </xsl:call-template>
244 </xsl:for-each>
245 </select>
246 </div>
247 <br class="clear" />
248 <xsl:for-each select="paramList/param[@name !='collection']">
249 <xsl:choose>
250 <xsl:when test="@type='multi'">
251 <xsl:apply-templates select=".">
252 <xsl:with-param name="ns" select="$ns"/>
253 </xsl:apply-templates>
254 </xsl:when>
255 <xsl:otherwise>
256 <xsl:call-template name="param-display">
257 <xsl:with-param name="ns" select="$ns"/>
258 </xsl:call-template>
259 </xsl:otherwise>
260 </xsl:choose>
261 </xsl:for-each>
262 </xsl:template>
263
264 <xsl:template name="hierarchy-display">
265 <xsl:param name="padding" />
266 <xsl:param name="path" />
267 <xsl:choose>
268 <xsl:when test="name(.) = 'group'">
269 <option>
270 <xsl:attribute name="style">
271 <xsl:text>padding-left: </xsl:text>
272 <xsl:value-of select="concat($padding,'px')" />
273 </xsl:attribute>
274 <xsl:attribute name="value">
275 <xsl:text>group</xsl:text>
276 <xsl:value-of select="$path" />
277 <xsl:value-of select="@name" />
278 </xsl:attribute>
279 <xsl:value-of select="@title"></xsl:value-of>
280 <xsl:for-each select="./*">
281 <xsl:call-template name="hierarchy-display">
282 <xsl:with-param name="padding">
283 <xsl:value-of select="$padding + 20" />
284 </xsl:with-param>
285 <xsl:with-param name="path">
286 <xsl:value-of select="$path" />
287 <xsl:text>/</xsl:text>
288 <xsl:value-of select="../@name" />
289 </xsl:with-param>
290 </xsl:call-template>
291 </xsl:for-each>
292 </option>
293 </xsl:when>
294 <xsl:otherwise>
295 <option>
296 <xsl:attribute name="style">
297 <xsl:text>padding-left: </xsl:text>
298 <xsl:value-of select="$padding" />
299 <xsl:text>px</xsl:text>
300 </xsl:attribute>
301 <!-- <xsl:attribute name="class">
302 <xsl:value-of select="$path" />
303 </xsl:attribute> -->
304 <xsl:attribute name="value">
305 <xsl:value-of select="current()/@name"></xsl:value-of>
306 </xsl:attribute>
307 <xsl:value-of
308 select="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'collection']/option[@name = current()/@name]/displayItem[@name = 'name']/text()"></xsl:value-of>
309 </option>
310 </xsl:otherwise>
311 </xsl:choose>
312 </xsl:template>
313
314 <xsl:template name="displayMatchDocs">
315 <div id="matchdocs">
316 <xsl:variable name="numDocsMatched" select="/page/pageResponse/metadataList/metadata[@name='numDocsMatched']"/>
317 <xsl:variable name="numDocsReturned" select="/page/pageResponse/metadataList/metadata[@name='numDocsReturned']"/>
318 <xsl:variable name="docLevel">
319 <xsl:call-template name="documentLevel"/>
320 </xsl:variable>
321 <xsl:variable name="docLevelText">
322 <xsl:call-template name="documentLevelText">
323 <xsl:with-param name="numDocsMatched" select="$numDocsMatched"/>
324 <xsl:with-param name="level" select="$docLevel"/>
325 </xsl:call-template>
326 </xsl:variable>
327 <xsl:choose>
328 <xsl:when test="$numDocsMatched='0' or $numDocsReturned='0'">
329 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch', $docLevelText)"/>
330 </xsl:when>
331 <xsl:when test="$numDocsMatched='1' or $numDocsReturned='1'">
332 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch', $docLevelText)"/>
333 </xsl:when>
334 <xsl:when test="$numDocsMatched">
335 <xsl:variable name="gitArgs1" select="concat($numDocsMatched, ';', $docLevelText)"/>
336 <xsl:variable name="gitArgs2" select="concat($numDocsReturned, ';', $docLevelText)"/>
337
338 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $gitArgs1)"/>
339 <xsl:if test="$numDocsReturned and not($numDocsMatched=$numDocsReturned)"> (<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.docsreturned', $gitArgs2)"/>)</xsl:if>
340 </xsl:when>
341 <xsl:when test="$numDocsReturned">
342 <xsl:variable name="gitArgs" select="concat($numDocsReturned, ';', $docLevelText)"/>
343 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.atleastdocsmatch', $gitArgs)"/>
344 </xsl:when>
345 </xsl:choose>
346 </div>
347
348 </xsl:template>
349
350 <xsl:template name="documentLevel">
351 <xsl:choose>
352 <xsl:when test="/page/pageRequest/paramList/param[@name='level']">
353 <xsl:value-of select="/page/pageRequest/paramList/param[@name='level']/@value" />
354 </xsl:when>
355 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.level']">
356 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.level']/@value" />
357 </xsl:when>
358 <xsl:otherwise>Doc</xsl:otherwise>
359 </xsl:choose>
360 </xsl:template>
361
362 <xsl:template name="documentLevelText">
363 <xsl:param name="numDocsMatched">0</xsl:param>
364 <xsl:param name="level">Doc</xsl:param>
365 <xsl:choose>
366 <xsl:when test="$numDocsMatched = 1">
367 <xsl:choose>
368 <xsl:when test="$level = 'Doc'">
369 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
370 </xsl:when>
371 <xsl:otherwise>
372 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section')"/>
373 </xsl:otherwise>
374 </xsl:choose>
375 </xsl:when>
376 <!-- 0 or more than one use plural. is that the case for all langs??-->
377 <xsl:otherwise>
378 <xsl:choose>
379 <xsl:when test="$level = 'Doc'">
380 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
381 </xsl:when>
382 <xsl:otherwise>
383 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
384 </xsl:otherwise>
385 </xsl:choose>
386 </xsl:otherwise>
387 </xsl:choose>
388 </xsl:template>
389
390 <xsl:template name="displayTermInfo">
391
392 <!-- Find the number of documents displayed per page -->
393 <xsl:variable name="level">
394 <xsl:call-template name="documentLevel"/>
395 </xsl:variable>
396
397 <!-- The list of search terms with their frequency and document count -->
398 <p class="termList">
399 <xsl:if test="count(/page/pageResponse/termList/stopword) &gt; 0">
400 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.common')"/>
401 <xsl:text> </xsl:text>
402 <xsl:for-each select="/page/pageResponse/termList/stopword">
403 <span style="font-style:italic;">
404 <xsl:value-of select="@name"/>
405 </span>
406 <xsl:text> </xsl:text>
407 </xsl:for-each>
408 <br />
409 <br />
410 </xsl:if>
411
412 <!-- If there is only one or two search terms then show the expanded information -->
413 <xsl:choose>
414 <xsl:when test="count(/page/pageResponse/termList/term) &lt; 3">
415
416 <xsl:for-each select="/page/pageResponse/termList/term">
417 <xsl:variable name="levelText">
418 <!-- this gets document, section, documents, sections, depending on level and number -->
419 <xsl:call-template name="documentLevelText">
420 <xsl:with-param name="level" select="$level"/>
421 <xsl:with-param name="numDocsMatched" select="@numDocsMatch"/>
422 </xsl:call-template>
423 </xsl:variable>
424 <span class="termInfo">
425
426 <!-- For solr and mg collections, display:
427 term x occured y times
428 term a occured b times
429 For collections using all other indexers, display:
430 term x occurred y times in n sections/documents
431 term a occurred b times in m sections/docs
432 -->
433 <!-- not all these args are used in every case -->
434 <xsl:variable name="args" select="concat(@name,';', @freq, ';', @numDocsMatch,';', $levelText)"/>
435 <xsl:choose>
436 <xsl:when test="@freq = 0">
437 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.termoccurs.0',$args)"/>
438 </xsl:when>
439 <xsl:when test="@freq = 1">
440 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.termoccurs.1',$args)"/>
441 </xsl:when>
442 <xsl:otherwise> <!-- more than one occurrance -->
443 <xsl:choose>
444 <xsl:when test="/page/pageResponse/collection[@type = 'solr'] or /page/pageResponse/collection[@type = 'mg']">
445 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.termoccurs.x',$args)"/>
446 </xsl:when>
447 <xsl:when test="@numDocsMatch = 1">
448 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.termoccurs.x.1',$args)"/>
449 </xsl:when>
450 <xsl:otherwise>
451 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.termoccurs.x.x',$args)"/>
452 </xsl:otherwise>
453 </xsl:choose>
454 </xsl:otherwise>
455 </xsl:choose>
456
457 </span>
458 <br/>
459 </xsl:for-each>
460 </xsl:when>
461 <xsl:otherwise>
462 <xsl:for-each select="/page/pageResponse/termList/term">
463 <span style="font-style:italic;">
464 <xsl:value-of select="@name"/>
465 </span> (<xsl:value-of select="@freq"/>)
466 </xsl:for-each>
467 </xsl:otherwise>
468 </xsl:choose>
469 </p>
470 </xsl:template>
471
472 <xsl:template name="prevNextButtons">
473 <!-- Current page -->
474 <xsl:variable name="currentPage">
475 <xsl:choose>
476 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.startPage']/@value">
477 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.startPage']/@value" />
478 </xsl:when>
479 <xsl:when test="/page/pageRequest/paramList/param[@name='startPage']/@value">
480 <xsl:value-of select="/page/pageRequest/paramList/param[@name='startPage']/@value" />
481 </xsl:when>
482 <xsl:otherwise>1</xsl:otherwise>
483 </xsl:choose>
484 </xsl:variable>
485 <xsl:variable name="usesS1">
486 <xsl:choose>
487 <xsl:when test="/page/pageResponse/service/paramList/param[@name='startPage']">true</xsl:when>
488 <xsl:otherwise>false</xsl:otherwise>
489 </xsl:choose>
490 </xsl:variable>
491 <!-- Find the total number of documents returned/matched -->
492 <xsl:variable name="docMax">
493 <xsl:choose>
494 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']">
495 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']"/>
496 </xsl:when>
497 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']">
498 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']"/>
499 </xsl:when>
500 <xsl:otherwise>
501 <xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/>
502 </xsl:otherwise>
503 </xsl:choose>
504 </xsl:variable>
505 <!-- Find the number of documents displayed per page -->
506 <xsl:variable name="docsPerPage">
507 <xsl:choose>
508 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.hitsPerPage']">
509 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.hitsPerPage']/@value" />
510 </xsl:when>
511 <xsl:when test="/page/pageResponse/service/paramList/param[@name='hitsPerPage']">
512 <xsl:value-of select="/page/pageResponse/service/paramList/param[@name='hitsPerPage']/@default" />
513 </xsl:when>
514 <xsl:otherwise><xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/></xsl:otherwise>
515 </xsl:choose>
516 </xsl:variable>
517 <!-- Find the level -->
518 <xsl:variable name="level">
519 <xsl:call-template name="documentLevel"/>
520 </xsl:variable>
521
522 <!-- we only need this if number of docs > docsperpage -->
523 <xsl:if test="$docMax &gt; $docsPerPage">
524 <table id="searchResultNavTable">
525 <tr>
526 <xsl:variable name="startPageName">
527 <xsl:if test="$usesS1 = 'true'">s1.</xsl:if>startPage</xsl:variable>
528
529 <!-- Previous button -->
530 <td id="prevArrowTD">
531 <xsl:if test="$currentPage != 1">
532 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
533 <xsl:call-template name="previousArrowImage"/>
534 </a>
535 </xsl:if>
536 </td>
537 <td id="prevTD">
538 <xsl:if test="$currentPage != 1">
539 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results.previous')"/></a>
540 </xsl:if>
541 </td>
542
543 <xsl:if test="$display_status_bar != 'false'">
544 <!-- Search result status bar (in english it reads "Displaying X to Y of Z documents") -->
545 <xsl:if test="$docsPerPage &gt; 0">
546 <xsl:variable name="startdoc" select="($currentPage - 1) * $docsPerPage + 1"/>
547 <xsl:variable name="enddoc">
548 <xsl:choose>
549 <xsl:when test="($currentPage * $docsPerPage + 1) &gt; $docMax">
550 <xsl:value-of select="$docMax"/>
551 </xsl:when>
552 <xsl:otherwise>
553 <xsl:value-of select="$currentPage * $docsPerPage"/>
554 </xsl:otherwise>
555 </xsl:choose>
556 </xsl:variable>
557 <xsl:variable name="levelString">
558 <xsl:choose>
559 <xsl:when test="$level = 'Doc'">
560 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
561 </xsl:when>
562 <xsl:otherwise>
563 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
564 </xsl:otherwise>
565 </xsl:choose>
566 </xsl:variable>
567 <td id="searchResultsStatusBar">
568 <xsl:variable name="gitArgs" select="concat($startdoc,';', $enddoc, ';', $docMax, ';', $levelString)"/>
569 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.displayingnumdocs', $gitArgs)"/>
570 </td>
571 </xsl:if>
572 </xsl:if>
573 <!-- Next button -->
574 <td id="nextTD">
575 <xsl:if test="$docsPerPage &gt; 0 and ($currentPage * $docsPerPage + 1) &lt; $docMax">
576 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results.next')"/></a>
577 </xsl:if>
578 </td>
579 <td id="nextArrowTD">
580 <xsl:if test="$docsPerPage &gt; 0 and ($currentPage * $docsPerPage + 1) &lt; $docMax">
581 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
582 <xsl:call-template name="nextArrowImage"/>
583 </a>
584 </xsl:if>
585 </td>
586 </tr>
587 </table>
588 </xsl:if>
589 </xsl:template>
590
591 <xsl:template name="previousArrowImage">
592 <img src="interfaces/default/images/previous.png"/>
593 </xsl:template>
594 <xsl:template name="nextArrowImage">
595 <img src="interfaces/default/images/next.png"/>
596 </xsl:template>
597 <!-- puts all the params into a=p&p=h type form - need to change this if use
598 multi params -->
599 <xsl:template match="paramList" mode="cgi">
600 <xsl:param name="ns">s1.</xsl:param>
601 <xsl:for-each select="param">
602 <xsl:variable name='pname' select="@name"/>
603 <xsl:text>&amp;</xsl:text>
604 <xsl:value-of select="$ns"/>
605 <xsl:value-of select="@name"/>=<xsl:apply-templates select="." mode="calculate-default">
606 <xsl:with-param name='ns' select='$ns'/>
607 </xsl:apply-templates>
608 </xsl:for-each>
609 </xsl:template>
610
611 <xsl:template name="resultsPagePre">
612 <!-- OVERWRITE TO INSERT CONTENT BEFORE THE RESULTS PAGE -->
613 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
614 <xsl:call-template name="mapFeaturesJSONNodes"/>
615 <xsl:call-template name="mapFeaturesMap"/>
616 </xsl:if>
617 </xsl:template>
618
619 <xsl:template name="resultsPagePost">
620 <!-- OVERWRITE TO INSERT CONTENT AFTER THE RESULTS PAGE -->
621 </xsl:template>
622
623 <xsl:template name="documentNodePre">
624 <!-- OVERWRITE TO INSERT CONTENT BEFORE EVERY DOCUMENT NODE -->
625 </xsl:template>
626
627 <xsl:template name="documentNodePost">
628 <!-- OVERWRITE TO INSERT CONTENT AFTER EVERY DOCUMENT NODE -->
629 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
630 <xsl:call-template name="mapFeaturesIcon"/>
631 </xsl:if>
632
633 <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
634 <xsl:if test=" metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
635 <xsl:call-template name="panoramaViewerFeaturesIcon"/>
636 </xsl:if>
637 </xsl:if>
638
639 </xsl:template>
640
641
642
643</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.