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 | extension-element-prefixes="java util"
|
---|
7 | exclude-result-prefixes="java util">
|
---|
8 |
|
---|
9 | <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>
|
---|
13 | <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)"/>
|
---|
17 | <p />
|
---|
18 | <center>
|
---|
19 | <table cellspacing='0' cellpadding='0' width='537'>
|
---|
20 | <tr>
|
---|
21 | <td align='left'>
|
---|
22 | <xsl:if test="$hn > 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>
|
---|
23 | </td>
|
---|
24 | <td align='right'>
|
---|
25 | <xsl:if test="(($hn * $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>
|
---|
29 | </table>
|
---|
30 | </center>
|
---|
31 | </xsl:if>
|
---|
32 | </xsl:template>
|
---|
33 |
|
---|
34 |
|
---|
35 | <!-- the default doc node template for the query results -->
|
---|
36 | <!-- eventually shouldn't need sib arg here -->
|
---|
37 | <xsl:template match="documentNode">
|
---|
38 | <xsl:param name="collName"/>
|
---|
39 | <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>
|
---|
41 | <xsl:apply-templates select="." mode="displayNodeIcon"/>
|
---|
42 | </a>
|
---|
43 | </td>
|
---|
44 | <td><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></td>
|
---|
45 | </xsl:template>
|
---|
46 |
|
---|
47 | <xsl:template name="greenBarResults">
|
---|
48 | <p/>
|
---|
49 | <center>
|
---|
50 | <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/>
|
---|
51 | </center>
|
---|
52 | </xsl:template>
|
---|
53 |
|
---|
54 | <xsl:template name="termInfo">
|
---|
55 | <xsl:if test="count(termList/term) > 0">
|
---|
56 | <small>
|
---|
57 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
|
---|
58 | <xsl:for-each select="termList/term">
|
---|
59 | <xsl:if test="position() > 1">, </xsl:if>
|
---|
60 | <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/>
|
---|
61 | </xsl:for-each>
|
---|
62 | </small>
|
---|
63 | <br/>
|
---|
64 | </xsl:if>
|
---|
65 | </xsl:template>
|
---|
66 |
|
---|
67 | <xsl:template name="matchDocs">
|
---|
68 | <!-- If the number of matching documents is known, display it -->
|
---|
69 | <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']/@value"/>
|
---|
70 | <xsl:if test="$numDocsMatched">
|
---|
71 | <xsl:choose>
|
---|
72 | <xsl:when test="$numDocsMatched='0'">
|
---|
73 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
|
---|
74 | </xsl:when>
|
---|
75 | <xsl:when test="$numDocsMatched='1'">
|
---|
76 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
|
---|
77 | </xsl:when>
|
---|
78 | <xsl:otherwise>
|
---|
79 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
|
---|
80 | </xsl:otherwise>
|
---|
81 | </xsl:choose>
|
---|
82 | </xsl:if>
|
---|
83 | </xsl:template>
|
---|
84 |
|
---|
85 | <xsl:template name="resultList">
|
---|
86 | <xsl:param name="collName"/>
|
---|
87 | <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>
|
---|
88 | <xsl:variable name="hn" select="/page/pageRequest/paramList/param[@name='hn']/@value"/>
|
---|
89 | <table>
|
---|
90 | <tr valign="top">
|
---|
91 | <xsl:for-each select="documentNodeList/documentNode">
|
---|
92 | <xsl:if test="$hp=-1 or (position()> (($hn - 1)*$hp) and position() <= ($hn * $hp))">
|
---|
93 | <tr>
|
---|
94 | <xsl:apply-templates select=".">
|
---|
95 | <xsl:with-param name="collName" select="$collName"/>
|
---|
96 | </xsl:apply-templates>
|
---|
97 | </tr>
|
---|
98 | </xsl:if>
|
---|
99 | </xsl:for-each>
|
---|
100 | </tr>
|
---|
101 | </table>
|
---|
102 | </xsl:template>
|
---|
103 |
|
---|
104 | </xsl:stylesheet>
|
---|
105 |
|
---|
106 |
|
---|