Changeset 5134
- Timestamp:
- 2003-08-13T12:29:37+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/web/interfaces/default/transform/querytools.xsl
r5119 r5134 7 7 exclude-result-prefixes="java util"> 8 8 9 <!-- have changed this so it uses service hitsPerPage and startPage if available, otherwise uses interface ones --> 9 10 <xsl:template name="resultNavigation"> 10 <xsl:variable name="hp"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 11 <xsl:if test="not($hp=-1)"> 12 <xsl:variable name="hn"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable> 11 <xsl:variable name="param-list" select="/page/pageRequest/paramList"/> 12 <!-- hits per page --> 13 <xsl:variable name="hpp"> 14 <xsl:choose> 15 <xsl:when test="$param-list/param[@name='s1.hitsPerPage']"><xsl:value-of select="$param-list/param[@name='s1.hitsPerPage']/@value"/></xsl:when> 16 <xsl:when test="$param-list/param[@name='hitsPerPage']"><xsl:value-of select="$param-list/param[@name='hitsPerPage']/@value"/></xsl:when> 17 <xsl:otherwise>20</xsl:otherwise> 18 </xsl:choose> 19 </xsl:variable> 20 <!-- hits type --> 21 <xsl:variable name='ht'> 22 <xsl:choose> 23 <xsl:when test="$param-list/param[@name='s1.hitsPerPage']">s</xsl:when> 24 <xsl:otherwise>i</xsl:otherwise> 25 </xsl:choose> 26 </xsl:variable> 27 <!-- total docs --> 28 <xsl:variable name="td"> 29 <xsl:choose> 30 <xsl:when test="$ht='s'"> 31 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='numDocsMatched']/@value"/> 32 </xsl:when> 33 <xsl:otherwise> 34 <xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/> 35 </xsl:otherwise> 36 </xsl:choose> 37 </xsl:variable> 38 <!-- only continue if hpp != -1 and td > hpp --> 39 <xsl:if test="not($hpp=-1) and $td > $hpp"> 40 <!-- start page --> 41 <xsl:variable name="here"> 42 <xsl:choose> 43 <xsl:when test="$param-list/param[@name='s1.startPage']"><xsl:value-of select="$param-list/param[@name='s1.startPage']/@value"/></xsl:when> 44 <xsl:when test="$param-list/param[@name='startPage']"><xsl:value-of select="$param-list/param[@name='startPage']/@value"/></xsl:when> 45 <xsl:otherwise>1</xsl:otherwise> 46 </xsl:choose> 47 </xsl:variable> 13 48 <xsl:variable name="sa" select="/page/pageRequest/@subaction"/> 14 <xsl:variable name="prev" select="$hn - 1"/> 15 <xsl:variable name="next" select="$hn + 1"/> 16 <xsl:variable name="count" select="count(documentNodeList/documentNode)"/> 49 <xsl:variable name="service" select="$param-list/param[@name='s']/@value"/> 50 <xsl:variable name="prev" select="$here - 1"/> 51 <xsl:variable name="next" select="$here + 1"/> 52 <xsl:variable name="page-param"><xsl:if test="$ht='s'">s1.</xsl:if>startPage</xsl:variable> 17 53 <p /> 18 54 <center> 19 <table cellspacing='0' cellpadding='0' width=' 537'>55 <table cellspacing='0' cellpadding='0' width='70%'> 20 56 <tr> 21 57 <td align='left'> 22 <xsl:if test="$h n > 1"><a href="{$library_name}?a=q&rt=r&hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>58 <xsl:if test="$here > 1"><a href="{$library_name}?a=q&sa={$sa}&s={$service}&rt=r&{$page-param}={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hpp + 1)"/> - <xsl:value-of select="number(($prev * $hpp))"/></a></xsl:if> 23 59 </td> 24 60 <td align='right'> 25 <xsl:if test="(($h n * $hp) + 1) < $count">26 <xsl:variable name='m' select="number($next * $hp )"/>27 <xsl:variable name='mm'><xsl:choose><xsl:when test="$m < $ count"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$count'/></xsl:otherwise></xsl:choose></xsl:variable>28 <a href="{$library_name}?a=q&sa={$sa}& rt=r&hn={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>61 <xsl:if test="(($here * $hpp) + 1) < $td"> 62 <xsl:variable name='m' select="number($next * $hpp)"/> 63 <xsl:variable name='mm'><xsl:choose><xsl:when test="$m < $td"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$td'/></xsl:otherwise></xsl:choose></xsl:variable> 64 <a href="{$library_name}?a=q&sa={$sa}&s={$service}&rt=r&{$page-param}={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hpp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr> 29 65 </table> 30 66 </center> … … 38 74 <xsl:param name="collName"/> 39 75 <td> 40 <a><xsl:attribute name="href">< !--<xsl:value-of select='$library_name'/>-->?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if>&dt=<xsl:value-of select='@docType'/></xsl:attribute>76 <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if>&dt=<xsl:value-of select='@docType'/></xsl:attribute> 41 77 <xsl:apply-templates select="." mode="displayNodeIcon"/> 42 78 </a> … … 44 80 <td><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></td> 45 81 </xsl:template> 46 47 <!-- 48 <xsl:template name="greenBarResults"> 49 <table width='100%' border="0" cellpadding="0" cellspacing="0"> 50 <tr><td width='100%' height='17' background='interfaces/default/images/divb.gif' valign='bottom'><font size="+1" color="black"><b>Results</b></font></td></tr></table> 51 </xsl:template> 52 53 54 <xsl:template name="greenBarResultsold"> 55 <p/> 56 57 <img src="interfaces/default/images/qryresb.gif" width="100%" height="17"/> 58 59 </xsl:template> 60 --> 82 61 83 <xsl:template name="termInfo"> 62 84 <xsl:if test="count(termList/term) > 0"> … … 90 112 </xsl:template> 91 113 114 92 115 <xsl:template name="resultList"> 93 116 <xsl:param name="collName"/> 94 <xsl:variable name="hp"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 95 <xsl:variable name="hn" select="/page/pageRequest/paramList/param[@name='hn']/@value"/> 96 <table> 97 <tr valign="top"> 98 <xsl:for-each select="documentNodeList/documentNode"> 99 <xsl:if test="$hp=-1 or (position()> (($hn - 1)*$hp) and position() <= ($hn * $hp))"> 117 <xsl:variable name="param-list" select="/page/pageRequest/paramList"/> 118 <!-- hits per page --> 119 <xsl:variable name="hpp"> 120 <xsl:choose> 121 <xsl:when test="$param-list/param[@name='s1.hitsPerPage']"><xsl:value-of select="$param-list/param[@name='s1.hitsPerPage']/@value"/></xsl:when> 122 <xsl:when test="$param-list/param[@name='hitsPerPage']"><xsl:value-of select="$param-list/param[@name='hitsPerPage']/@value"/></xsl:when> 123 <xsl:otherwise>20</xsl:otherwise> 124 </xsl:choose> 125 </xsl:variable> 126 <xsl:choose> 127 <xsl:when test="$param-list/param[@name='s1.hitsPerPage'] or $hpp=-1"> 128 <!-- the service has handled the paging, just output all the docs --> 129 <table> 130 <xsl:for-each select="documentNodeList/documentNode"> 100 131 <tr> 101 132 <xsl:apply-templates select="."> 102 133 <xsl:with-param name="collName" select="$collName"/> 103 134 </xsl:apply-templates> 104 </tr> 105 </xsl:if> 106 </xsl:for-each> 107 </tr> 108 </table> 135 </tr> 136 </xsl:for-each> 137 </table> 138 </xsl:when> 139 <xsl:otherwise> 140 <!-- we have done the paging, only show a selection of the docs --> 141 <!-- start page --> 142 <xsl:variable name="sp"> 143 <xsl:choose> 144 <xsl:when test="$param-list/param[@name='s1.startPage']"><xsl:value-of select="$param-list/param[@name='s1.startPage']/@value"/></xsl:when> 145 <xsl:when test="$param-list/param[@name='startPage']"><xsl:value-of select="$param-list/param[@name='startPage']/@value"/></xsl:when> 146 <xsl:otherwise>1</xsl:otherwise> 147 </xsl:choose> 148 </xsl:variable> 149 <table> 150 <xsl:for-each select="documentNodeList/documentNode"> 151 <xsl:if test=" (position()> (($sp - 1)*$hpp) and position() <= ($sp * $hpp))"> 152 <tr> 153 <xsl:apply-templates select="."> 154 <xsl:with-param name="collName" select="$collName"/> 155 </xsl:apply-templates> 156 </tr> 157 </xsl:if> 158 </xsl:for-each> 159 </table> 160 </xsl:otherwise> 161 </xsl:choose> 109 162 </xsl:template> 110 163
Note:
See TracChangeset
for help on using the changeset viewer.