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