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

Last change on this file since 36084 was 36084, checked in by kjdon, 6 months ago

got rid of berry option

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