[19856] | 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"
|
---|
[25882] | 7 | xmlns:gsvar="http://www.greenstone.org/skinning-var"
|
---|
[24998] | 8 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
[19856] | 9 | extension-element-prefixes="java util"
|
---|
[24998] | 10 | exclude-result-prefixes="java util gsf">
|
---|
[26455] | 11 |
|
---|
[19988] | 12 | <!-- use the 'main' layout -->
|
---|
[24998] | 13 | <xsl:import href="layouts/main.xsl"/>
|
---|
[31550] | 14 | <xsl:import href="map-tools.xsl"/>
|
---|
| 15 | <xsl:import href="panorama-viewer-tools.xsl"/>
|
---|
[19856] | 16 |
|
---|
[19988] | 17 | <!-- set page title -->
|
---|
[30478] | 18 | <xsl:template name="pageTitle">
|
---|
| 19 | <gslib:serviceName/>
|
---|
[26455] | 20 | </xsl:template>
|
---|
[19856] | 21 |
|
---|
[19988] | 22 | <!-- set page breadcrumbs -->
|
---|
[30478] | 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>
|
---|
[26455] | 30 | </xsl:template>
|
---|
[19856] | 31 |
|
---|
[30311] | 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>
|
---|
[19988] | 37 | <!-- the page content -->
|
---|
| 38 | <xsl:template match="/page">
|
---|
[26084] | 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>
|
---|
[26477] | 42 | <xsl:if test="contains(/page/pageRequest/paramList/param[@name='rt']/@value, 'r')">
|
---|
[25736] | 43 | <xsl:call-template name="resultsPage"/>
|
---|
[26477] | 44 | </xsl:if>
|
---|
[24998] | 45 | </xsl:template>
|
---|
[26455] | 46 |
|
---|
[24998] | 47 | <xsl:template name="resultsPage">
|
---|
| 48 | <xsl:call-template name="resultsPagePre"/>
|
---|
[26455] | 49 | <xsl:call-template name="displayMatchDocs"/>
|
---|
[24998] | 50 | <xsl:call-template name="displayTermInfo"/>
|
---|
[29278] | 51 | <xsl:call-template name="displayBaskets"/>
|
---|
[24998] | 52 | <xsl:call-template name="displayResults"/>
|
---|
| 53 | <xsl:call-template name="resultsPagePost"/>
|
---|
| 54 | </xsl:template>
|
---|
[25882] | 55 |
|
---|
[26455] | 56 | <!-- optional cgi-params for links to document pages -->
|
---|
[30478] | 57 | <xsl:variable name="opt-doc-link-args">p.s=<gsvar:this-service/>
|
---|
[26455] | 58 | </xsl:variable>
|
---|
| 59 |
|
---|
[29278] | 60 | <xsl:template name="displayBaskets">
|
---|
[29323] | 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)))">
|
---|
[29278] | 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>
|
---|
[29342] | 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))">
|
---|
[29323] | 69 | <gslib:documentBasket/>
|
---|
| 70 | <xsl:text> </xsl:text>
|
---|
| 71 | </xsl:if>
|
---|
[29278] | 72 | </div>
|
---|
| 73 | </xsl:if>
|
---|
| 74 | </xsl:template>
|
---|
| 75 |
|
---|
[24998] | 76 | <xsl:template name="displayResults">
|
---|
[25832] | 77 | <xsl:if test="/page/pageResponse/facetList/facet">
|
---|
[30478] | 78 | <script type="text/javascript" src="interfaces/{$interface_name}/js/facet-scripts.js">
|
---|
| 79 | <xsl:text> </xsl:text>
|
---|
[26455] | 80 | </script>
|
---|
[25832] | 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}">
|
---|
[30478] | 85 | <xsl:variable name="serviceName">
|
---|
| 86 | <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's']/@value"/>
|
---|
[26455] | 87 | </xsl:variable>
|
---|
[30478] | 88 | <xsl:variable name="indexShortName">
|
---|
| 89 | <xsl:value-of select="@name"/>
|
---|
[26455] | 90 | </xsl:variable>
|
---|
[25832] | 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>
|
---|
[26455] | 99 |
|
---|
[25832] | 100 | <li class="ui-widget-header" style="text-transform:capitalize; text-align:center;">
|
---|
[32080] | 101 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
[25832] | 102 | </li>
|
---|
| 103 | <xsl:for-each select="count">
|
---|
| 104 | <li>
|
---|
| 105 | <xsl:attribute name="style">
|
---|
[30478] | 106 | <xsl:if test="position() > $countSize">display:none;<xsl:value-of select="$indexShortName"/>
|
---|
[26455] | 107 | </xsl:if>
|
---|
[25832] | 108 | </xsl:attribute>
|
---|
[30478] | 109 | <input type="checkbox" onclick="performRefinedSearch();"/>
|
---|
| 110 | <span>
|
---|
| 111 | <xsl:value-of select="@name"/>
|
---|
[26455] | 112 | </span>(<xsl:value-of select="."/>)
|
---|
[25832] | 113 | </li>
|
---|
| 114 | </xsl:for-each>
|
---|
| 115 | <xsl:if test="count(count) > $countSize">
|
---|
[30778] | 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>
|
---|
[26455] | 118 | </li>
|
---|
[30778] | 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>
|
---|
[25832] | 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">
|
---|
[26159] | 134 | <tr id="div{@nodeID}" class="document">
|
---|
[25832] | 135 | <xsl:apply-templates select="."/>
|
---|
[29278] | 136 | <!-- The berry (optional) -->
|
---|
| 137 | <td>
|
---|
| 138 | <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
|
---|
| 139 | </td>
|
---|
[30049] | 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>
|
---|
[25832] | 145 | <xsl:call-template name="documentNodePost"/>
|
---|
| 146 | </tr>
|
---|
| 147 | </xsl:for-each>
|
---|
| 148 | <br/>
|
---|
| 149 | </table>
|
---|
[26455] | 150 |
|
---|
[25832] | 151 | <!-- Previous/Next buttons-->
|
---|
| 152 | <xsl:call-template name="prevNextButtons"/>
|
---|
| 153 | </div>
|
---|
| 154 | <xsl:if test="/page/pageResponse/facetList/facet">
|
---|
[30478] | 155 | <div style="clear:both;">
|
---|
| 156 | <xsl:text> </xsl:text>
|
---|
[26455] | 157 | </div>
|
---|
[25832] | 158 | </xsl:if>
|
---|
[24998] | 159 | </xsl:template>
|
---|
[26119] | 160 |
|
---|
[30049] | 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>
|
---|
[24998] | 176 | <xsl:template name="queryPage">
|
---|
| 177 | <xsl:for-each select="pageResponse/service">
|
---|
[25434] | 178 | <form name="QueryForm" method="get" action="{$library_name}/collection/{$collName}/search/{@name}">
|
---|
[24998] | 179 | <div>
|
---|
| 180 | <input type="hidden" name="a" value="q"/>
|
---|
[30478] | 181 | <input type="hidden" name="sa">
|
---|
| 182 | <xsl:attribute name="value">
|
---|
| 183 | <xsl:value-of select="/page/pageRequest/@subaction"/>
|
---|
| 184 | </xsl:attribute>
|
---|
[26455] | 185 | </input>
|
---|
[24998] | 186 | <input type="hidden" name="rt" value="rd"/>
|
---|
[31286] | 187 |
|
---|
[24998] | 188 | <xsl:variable name="ns">s1.</xsl:variable>
|
---|
[31286] | 189 | <xsl:choose>
|
---|
[31346] | 190 | <xsl:when test="/page/pageResponse/hierarchy and paramList/param[@name ='collection']">
|
---|
[31286] | 191 | <xsl:call-template name="hierarchy">
|
---|
| 192 | <xsl:with-param name="ns" select="$ns" />
|
---|
| 193 | </xsl:call-template>
|
---|
| 194 | </xsl:when>
|
---|
| 195 | <xsl:otherwise>
|
---|
[24998] | 196 | <xsl:for-each select="paramList/param">
|
---|
[24025] | 197 | <xsl:choose>
|
---|
[24998] | 198 | <xsl:when test="@type='multi'">
|
---|
[30478] | 199 | <xsl:apply-templates select=".">
|
---|
| 200 | <xsl:with-param name="ns" select="$ns"/>
|
---|
[26455] | 201 | </xsl:apply-templates>
|
---|
[24998] | 202 | </xsl:when>
|
---|
[24025] | 203 | <xsl:otherwise>
|
---|
[30478] | 204 | <xsl:call-template name="param-display">
|
---|
| 205 | <xsl:with-param name="ns" select="$ns"/>
|
---|
[26455] | 206 | </xsl:call-template>
|
---|
[24025] | 207 | </xsl:otherwise>
|
---|
| 208 | </xsl:choose>
|
---|
| 209 | </xsl:for-each>
|
---|
[31286] | 210 | </xsl:otherwise>
|
---|
| 211 | </xsl:choose>
|
---|
[24009] | 212 | <br/>
|
---|
[30478] | 213 | <input type="submit">
|
---|
| 214 | <xsl:attribute name="value">
|
---|
| 215 | <xsl:value-of select="displayItem[@name='submit']"/>
|
---|
| 216 | </xsl:attribute>
|
---|
[26455] | 217 | </input>
|
---|
[24998] | 218 | </div>
|
---|
| 219 | </form>
|
---|
| 220 | </xsl:for-each>
|
---|
[19856] | 221 | </xsl:template>
|
---|
[26400] | 222 |
|
---|
[31286] | 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">
|
---|
[31346] | 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>
|
---|
[31286] | 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>
|
---|
[31346] | 240 | <xsl:with-param name="path">
|
---|
| 241 | <xsl:text>/</xsl:text>
|
---|
| 242 | </xsl:with-param>
|
---|
[31286] | 243 | </xsl:call-template>
|
---|
| 244 | </xsl:for-each>
|
---|
| 245 | </select>
|
---|
| 246 | </div>
|
---|
| 247 | <br class="clear" />
|
---|
[31346] | 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>
|
---|
[31286] | 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">
|
---|
[31346] | 271 | <xsl:text>padding-left: </xsl:text>
|
---|
| 272 | <xsl:value-of select="concat($padding,'px')" />
|
---|
| 273 | </xsl:attribute>
|
---|
[31286] | 274 | <xsl:attribute name="value">
|
---|
[31346] | 275 | <xsl:text>group</xsl:text>
|
---|
| 276 | <xsl:value-of select="$path" />
|
---|
| 277 | <xsl:value-of select="@name" />
|
---|
| 278 | </xsl:attribute>
|
---|
[31286] | 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" />
|
---|
[31346] | 287 | <xsl:text>/</xsl:text>
|
---|
[31286] | 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>
|
---|
[31346] | 301 | <!-- <xsl:attribute name="class">
|
---|
[31286] | 302 | <xsl:value-of select="$path" />
|
---|
[31346] | 303 | </xsl:attribute> -->
|
---|
[31286] | 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 |
|
---|
[26372] | 314 | <xsl:template name="displayMatchDocs">
|
---|
[26455] | 315 | <div id="matchdocs">
|
---|
| 316 | <xsl:variable name="numDocsMatched" select="/page/pageResponse/metadataList/metadata[@name='numDocsMatched']"/>
|
---|
[29553] | 317 | <xsl:variable name="numDocsReturned" select="/page/pageResponse/metadataList/metadata[@name='numDocsReturned']"/>
|
---|
[30478] | 318 | <xsl:variable name="docLevel">
|
---|
| 319 | <xsl:call-template name="documentLevel"/>
|
---|
[26455] | 320 | </xsl:variable>
|
---|
[30478] | 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>
|
---|
[26455] | 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">
|
---|
[30478] | 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>
|
---|
[26455] | 340 | </xsl:when>
|
---|
| 341 | <xsl:when test="$numDocsReturned">
|
---|
[30478] | 342 | <xsl:variable name="gitArgs" select="concat($numDocsReturned, ';', $docLevelText)"/>
|
---|
| 343 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.atleastdocsmatch', $gitArgs)"/>
|
---|
[26455] | 344 | </xsl:when>
|
---|
| 345 | </xsl:choose>
|
---|
| 346 | </div>
|
---|
[26372] | 347 |
|
---|
[26455] | 348 | </xsl:template>
|
---|
[26400] | 349 |
|
---|
[26455] | 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>
|
---|
[26400] | 361 |
|
---|
[26455] | 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 |
|
---|
[26119] | 390 | <xsl:template name="displayTermInfo">
|
---|
[26455] | 391 |
|
---|
[26119] | 392 | <!-- Find the number of documents displayed per page -->
|
---|
[30478] | 393 | <xsl:variable name="level">
|
---|
| 394 | <xsl:call-template name="documentLevel"/>
|
---|
[26455] | 395 | </xsl:variable>
|
---|
| 396 |
|
---|
[26119] | 397 | <!-- The list of search terms with their frequency and document count -->
|
---|
[26455] | 398 | <p class="termList">
|
---|
| 399 | <xsl:if test="count(/page/pageResponse/termList/stopword) > 0">
|
---|
[30478] | 400 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.common')"/>
|
---|
[26639] | 401 | <xsl:text> </xsl:text>
|
---|
[26455] | 402 | <xsl:for-each select="/page/pageResponse/termList/stopword">
|
---|
[30478] | 403 | <span style="font-style:italic;">
|
---|
| 404 | <xsl:value-of select="@name"/>
|
---|
| 405 | </span>
|
---|
[26639] | 406 | <xsl:text> </xsl:text>
|
---|
[26455] | 407 | </xsl:for-each>
|
---|
| 408 | <br />
|
---|
[30478] | 409 | <br />
|
---|
[26455] | 410 | </xsl:if>
|
---|
| 411 |
|
---|
[30478] | 412 | <!-- If there is only one or two search terms then show the expanded information -->
|
---|
[26455] | 413 | <xsl:choose>
|
---|
[30812] | 414 | <xsl:when test="count(/page/pageResponse/termList/term) < 3">
|
---|
[30478] | 415 |
|
---|
[30812] | 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">
|
---|
[30478] | 425 |
|
---|
[30812] | 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>
|
---|
[26455] | 462 | <xsl:for-each select="/page/pageResponse/termList/term">
|
---|
[30478] | 463 | <span style="font-style:italic;">
|
---|
| 464 | <xsl:value-of select="@name"/>
|
---|
[26455] | 465 | </span> (<xsl:value-of select="@freq"/>)
|
---|
| 466 | </xsl:for-each>
|
---|
| 467 | </xsl:otherwise>
|
---|
| 468 | </xsl:choose>
|
---|
| 469 | </p>
|
---|
[26119] | 470 | </xsl:template>
|
---|
[26455] | 471 |
|
---|
[24009] | 472 | <xsl:template name="prevNextButtons">
|
---|
| 473 | <!-- Current page -->
|
---|
| 474 | <xsl:variable name="currentPage">
|
---|
| 475 | <xsl:choose>
|
---|
[25736] | 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>
|
---|
[24009] | 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>
|
---|
[25485] | 485 | <xsl:variable name="usesS1">
|
---|
| 486 | <xsl:choose>
|
---|
[25736] | 487 | <xsl:when test="/page/pageResponse/service/paramList/param[@name='startPage']">true</xsl:when>
|
---|
[25485] | 488 | <xsl:otherwise>false</xsl:otherwise>
|
---|
| 489 | </xsl:choose>
|
---|
| 490 | </xsl:variable>
|
---|
[29553] | 491 | <!-- Find the total number of documents returned/matched -->
|
---|
[24009] | 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>
|
---|
[29553] | 500 | <xsl:otherwise>
|
---|
| 501 | <xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/>
|
---|
[26455] | 502 | </xsl:otherwise>
|
---|
[24009] | 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>
|
---|
[30778] | 511 | <xsl:when test="/page/pageResponse/service/paramList/param[@name='hitsPerPage']">
|
---|
[29553] | 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>
|
---|
[24009] | 515 | </xsl:choose>
|
---|
| 516 | </xsl:variable>
|
---|
[29553] | 517 | <!-- Find the level -->
|
---|
[25485] | 518 | <xsl:variable name="level">
|
---|
[29553] | 519 | <xsl:call-template name="documentLevel"/>
|
---|
[25485] | 520 | </xsl:variable>
|
---|
[30803] | 521 |
|
---|
| 522 | <!-- we only need this if number of docs > docsperpage -->
|
---|
| 523 | <xsl:if test="$docMax > $docsPerPage">
|
---|
[30478] | 524 | <table id="searchResultNavTable">
|
---|
[26455] | 525 | <tr>
|
---|
[30478] | 526 | <xsl:variable name="startPageName">
|
---|
[26455] | 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&sa={/page/pageRequest/@subaction}&c={$collName}&s={/page/pageResponse/service/@name}&rt=rd&{$startPageName}={$currentPage - 1}&qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
|
---|
[30311] | 533 | <xsl:call-template name="previousArrowImage"/>
|
---|
[26455] | 534 | </a>
|
---|
| 535 | </xsl:if>
|
---|
| 536 | </td>
|
---|
| 537 | <td id="prevTD">
|
---|
| 538 | <xsl:if test="$currentPage != 1">
|
---|
[30778] | 539 | <a href="{$library_name}?a=q&sa={/page/pageRequest/@subaction}&c={$collName}&s={/page/pageResponse/service/@name}&rt=rd&{$startPageName}={$currentPage - 1}&qs={/page/pageRequest/paramList/param[@name='qs']/@value}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results.previous')"/></a>
|
---|
[26455] | 540 | </xsl:if>
|
---|
| 541 | </td>
|
---|
| 542 |
|
---|
[30311] | 543 | <xsl:if test="$display_status_bar != 'false'">
|
---|
[26455] | 544 | <!-- Search result status bar (in english it reads "Displaying X to Y of Z documents") -->
|
---|
[29553] | 545 | <xsl:if test="$docsPerPage > 0">
|
---|
[26455] | 546 | <xsl:variable name="startdoc" select="($currentPage - 1) * $docsPerPage + 1"/>
|
---|
[30478] | 547 | <xsl:variable name="enddoc">
|
---|
[26455] | 548 | <xsl:choose>
|
---|
| 549 | <xsl:when test="($currentPage * $docsPerPage + 1) > $docMax">
|
---|
| 550 | <xsl:value-of select="$docMax"/>
|
---|
| 551 | </xsl:when>
|
---|
| 552 | <xsl:otherwise>
|
---|
| 553 | <xsl:value-of select="$currentPage * $docsPerPage"/>
|
---|
| 554 | </xsl:otherwise>
|
---|
[30478] | 555 | </xsl:choose>
|
---|
[26455] | 556 | </xsl:variable>
|
---|
[30478] | 557 | <xsl:variable name="levelString">
|
---|
[30803] | 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>
|
---|
[26455] | 566 | </xsl:variable>
|
---|
| 567 | <td id="searchResultsStatusBar">
|
---|
[30478] | 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)"/>
|
---|
[26455] | 570 | </td>
|
---|
[24025] | 571 | </xsl:if>
|
---|
[30311] | 572 | </xsl:if>
|
---|
[26455] | 573 | <!-- Next button -->
|
---|
| 574 | <td id="nextTD">
|
---|
[29553] | 575 | <xsl:if test="$docsPerPage > 0 and ($currentPage * $docsPerPage + 1) < $docMax">
|
---|
[30778] | 576 | <a href="{$library_name}?a=q&sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&c={$collName}&s={/page/pageResponse/service/@name}&rt=rd&{$startPageName}={$currentPage + 1}&qs={/page/pageRequest/paramList/param[@name='qs']/@value}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results.next')"/></a>
|
---|
[26455] | 577 | </xsl:if>
|
---|
| 578 | </td>
|
---|
| 579 | <td id="nextArrowTD">
|
---|
[29553] | 580 | <xsl:if test="$docsPerPage > 0 and ($currentPage * $docsPerPage + 1) < $docMax">
|
---|
[26455] | 581 | <a href="{$library_name}?a=q&sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&c={$collName}&s={/page/pageResponse/service/@name}&rt=rd&{$startPageName}={$currentPage + 1}&qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
|
---|
[30311] | 582 | <xsl:call-template name="nextArrowImage"/>
|
---|
[26455] | 583 | </a>
|
---|
| 584 | </xsl:if>
|
---|
| 585 | </td>
|
---|
[30478] | 586 | </tr>
|
---|
[26455] | 587 | </table>
|
---|
[30803] | 588 | </xsl:if>
|
---|
[24009] | 589 | </xsl:template>
|
---|
[19856] | 590 |
|
---|
[30311] | 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>
|
---|
[19988] | 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"/>
|
---|
[30478] | 603 | <xsl:text>&</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'/>
|
---|
[26455] | 607 | </xsl:apply-templates>
|
---|
[19988] | 608 | </xsl:for-each>
|
---|
| 609 | </xsl:template>
|
---|
[19856] | 610 |
|
---|
[24998] | 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"/>
|
---|
[31550] | 615 | <xsl:call-template name="mapFeaturesMap"/>
|
---|
[24998] | 616 | </xsl:if>
|
---|
| 617 | </xsl:template>
|
---|
[26455] | 618 |
|
---|
[24998] | 619 | <xsl:template name="resultsPagePost">
|
---|
| 620 | <!-- OVERWRITE TO INSERT CONTENT AFTER THE RESULTS PAGE -->
|
---|
| 621 | </xsl:template>
|
---|
[26455] | 622 |
|
---|
[24998] | 623 | <xsl:template name="documentNodePre">
|
---|
| 624 | <!-- OVERWRITE TO INSERT CONTENT BEFORE EVERY DOCUMENT NODE -->
|
---|
| 625 | </xsl:template>
|
---|
[26455] | 626 |
|
---|
[24998] | 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>
|
---|
[26871] | 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 |
|
---|
[24998] | 639 | </xsl:template>
|
---|
[26455] | 640 |
|
---|
| 641 |
|
---|
| 642 |
|
---|
[19856] | 643 | </xsl:stylesheet>
|
---|