source: greenstone3/trunk/web/interfaces/default/transform/query.xsl@ 16942

Last change on this file since 16942 was 16942, checked in by kjdon, 16 years ago

always call query-response tenplate from pageResponse, cos we want to display 'no docs matched the query' if there is nothing. shift the if documentNodeList test into the query-response template

  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
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 <!-- style includes global params interface_name, library_name -->
10 <xsl:include href="style.xsl"/>
11 <xsl:include href="service-params.xsl"/>
12 <xsl:include href="querytools.xsl"/>
13 <xsl:include href="berrytools.xsl"/>
14
15 <xsl:output method="html"/>
16
17 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
18
19 <xsl:template name="pageTitle">
20 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
21 </xsl:template>
22
23 <!-- page specific style goes here -->
24 <xsl:template name="pageStyle">
25 <!--<xsl:if test="$berryBaskets = 'true'">-->
26 <xsl:if test="$berrybasketswitch = 'on'">
27 <xsl:call-template name="berryStyleSheet"/>
28 <xsl:call-template name="js-library"/>
29 </xsl:if>
30 </xsl:template>
31
32
33 <xsl:template match="pageResponse">
34 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
35 <xsl:call-template name="standardPageBanner">
36 <xsl:with-param name="collName" select="$collName"/>
37 </xsl:call-template>
38 <xsl:call-template name="navigationBar">
39 <xsl:with-param name="collName" select="$collName"/>
40 </xsl:call-template>
41 <div id="content">
42 <xsl:apply-templates select="service">
43 <xsl:with-param name="collName" select="$collName"/>
44 </xsl:apply-templates>
45
46 <!--<xsl:if test="$berryBaskets = 'true'">-->
47 <xsl:if test="$berrybasketswitch = 'on'">
48 <xsl:call-template name="berrybasket"/>
49 </xsl:if>
50 <xsl:call-template name="query-response">
51 <xsl:with-param name="collName" select="$collName"/>
52 </xsl:call-template>
53
54 </div>
55 </xsl:template>
56
57
58 <!-- layout the response -->
59 <xsl:template name="query-response">
60 <xsl:param name="collName"/>
61 <xsl:call-template name="dividerBar"><xsl:with-param name='text'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results')"/></xsl:with-param></xsl:call-template>
62
63 <!-- If query term information is available, display it -->
64 <xsl:call-template name="termInfo"/>
65 <xsl:call-template name="matchDocs"/>
66
67 <xsl:if test="documentNodeList">
68
69 <!-- next and prev links at top of results-->
70
71 <xsl:call-template name="resultNavigation">
72 <xsl:with-param name="collName" select="$collName"/>
73 </xsl:call-template>
74
75 <!-- Display the matching documents -->
76
77 <xsl:call-template name="resultList">
78 <xsl:with-param name="collName" select="$collName"/>
79 </xsl:call-template>
80
81 <!-- next and prev links at bottom of page -->
82 <xsl:call-template name="resultNavigation">
83 <xsl:with-param name="collName" select="$collName"/>
84 </xsl:call-template>
85 </xsl:if>
86 </xsl:template>
87
88
89 <xsl:template match="service">
90 <xsl:param name="collName"/>
91 <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
92 <div id="queryform">
93 <form name="QueryForm" method="get" action="{$library_name}">
94 <input type="hidden" name="a" value="q"/>
95 <input type="hidden" name="sa" value="{$subaction}"/>
96 <input type="hidden" name="rt" value="rd"/>
97 <input type="hidden" name="s" value="{@name}"/>
98 <input type="hidden" name="c" value="{$collName}"/>
99 <xsl:if test="not(paramList/param[@name='startPage'])">
100 <input type="hidden" name="startPage" value="1"/>
101 </xsl:if>
102 <xsl:apply-templates select="paramList"/>
103 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
104 </form>
105 </div>
106 </xsl:template>
107
108</xsl:stylesheet>
109
110
111
112
113
114
Note: See TracBrowser for help on using the repository browser.