Changeset 4728


Ignore:
Timestamp:
2003-06-18T15:53:53+12:00 (21 years ago)
Author:
kjdon
Message:

moved a lot of teh smaller templates into querytools - so they can be reused by alternate interfaces. basicquery now does mainly the layout of the page, querytools has the tempaltes for the bits to go in it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/default/transform/querytools.xsl

    r4712 r4728  
    77  exclude-result-prefixes="java util">
    88
    9   <xsl:template name="result-navigation">
     9  <xsl:template name="resultNavigation">
    1010   <!-- <xsl:param name="library_name"/>-->
    1111    <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>
     
    3333  </xsl:template>
    3434 
     35
     36  <!-- the default doc node template for the query results -->
     37  <!-- eventually shouldn't need sib arg here -->
     38  <xsl:template match="documentNode">
     39    <xsl:param name="collName"/>
     40    <td>
     41      <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@documentType'/></xsl:attribute>
     42    <xsl:apply-templates select="." mode="displayNodeIcon"/>
     43      </a>
     44    </td>
     45    <td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
     46  </xsl:template>
     47 
     48  <xsl:template name="greenBarResults">
     49    <p/>
     50    <center>
     51      <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/>
     52    </center>
     53  </xsl:template>
     54
     55  <xsl:template match="param" mode="calculate-default">
     56    <xsl:variable name="pname" select="@name"/>
     57    <xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose>
     58  </xsl:template>
     59
     60    <xsl:template name="termInfo">
     61    <xsl:if test="count(termList/term) > 0">
     62      <small>
     63    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
     64    <xsl:for-each select="termList/term">
     65      <xsl:if test="position() > 1">, </xsl:if>
     66      <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/>
     67    </xsl:for-each>
     68      </small>
     69      <br/>
     70    </xsl:if>
     71  </xsl:template>
     72 
     73  <xsl:template name="matchDocs">
     74    <!-- If the number of matching documents is known, display it -->
     75    <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']/@value"/>
     76    <xsl:if test="$numDocsMatched">
     77      <xsl:choose>
     78    <xsl:when test="$numDocsMatched='0'">
     79      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
     80    </xsl:when>
     81    <xsl:when test="$numDocsMatched='1'">
     82      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
     83    </xsl:when>
     84    <xsl:otherwise>
     85      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
     86    </xsl:otherwise>
     87      </xsl:choose>
     88    </xsl:if>
     89  </xsl:template>
     90
     91  <xsl:template name="resultList">
     92    <xsl:param name="collName"/>
     93    <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>
     94    <xsl:variable name="hn" select="/page/pageRequest/paramList/param[@name='hn']/@value"/>     
     95    <table>
     96      <tr valign="top">
     97    <xsl:for-each select="documentNodeList/documentNode">
     98      <xsl:if test="$hp=-1 or (position()&gt; (($hn - 1)*$hp) and position() &lt;= ($hn * $hp))">
     99        <tr>
     100          <xsl:apply-templates select=".">
     101        <xsl:with-param name="collName" select="$collName"/>
     102          </xsl:apply-templates>
     103        </tr>
     104      </xsl:if>
     105    </xsl:for-each>
     106      </tr>
     107    </table>
     108  </xsl:template>
     109
    35110</xsl:stylesheet>
    36111
Note: See TracChangeset for help on using the changeset viewer.