source: main/trunk/greenstone3/web/interfaces/basic-client-xslt/transform/query.xsl@ 32388

Last change on this file since 32388 was 23779, checked in by davidb, 13 years ago

Two new interfaces - 'default' now tries to use the client's XSLT capabilities of the web browser, falling back to the 'traditional' interface if this fails.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 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 extension-element-prefixes="java"
6 exclude-result-prefixes="java">
7
8 <!-- style includes global params interface_name, library_name -->
9 <xsl:include href="style.xsl"/>
10 <xsl:include href="service-params.xsl"/>
11 <xsl:include href="querytools.xsl"/>
12 <xsl:include href="berrytools.xsl"/>
13
14 <xsl:output method="html"/>
15
16 <!-- the main page layout template is here -->
17 <xsl:template match="page">
18 <html>
19 <head>
20 <title>
21 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
22 <xsl:text> </xsl:text>
23 </title>
24 <xsl:call-template name="globalStyle"/>
25 <xsl:call-template name="pageStyle"/>
26 </head>
27 <body>
28
29 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
30 <div id="page-wrapper">
31 <xsl:call-template name="response" />
32 <xsl:call-template name="greenstoneFooter"/>
33 </div>
34 <xsl:call-template name="pageTitle"/>
35 </body>
36 </html>
37 </xsl:template>
38
39 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
40
41 <xsl:template name="pageTitle">
42 <span class="getTextFor null document.title.gsdl"></span>
43 </xsl:template>
44
45 <!-- page specific style goes here -->
46 <xsl:template name="pageStyle">
47 <xsl:if test="$berrybasketswitch = 'on'">
48 <xsl:call-template name="berryStyleSheet"/>
49 <xsl:call-template name="js-library"/>
50 </xsl:if>
51 </xsl:template>
52
53
54 <xsl:template match="pageResponse">
55 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
56 <xsl:variable name="requesttype"><xsl:value-of select="/page/pageRequest/paramList/param[@name='rt']/@value"/></xsl:variable>
57 <xsl:call-template name="standardPageBanner">
58 <xsl:with-param name="collName" select="$collName"/>
59 </xsl:call-template>
60 <xsl:call-template name="navigationBar">
61 <xsl:with-param name="collName" select="$collName"/>
62 </xsl:call-template>
63 <div id="content">
64 <xsl:apply-templates select="service">
65 <xsl:with-param name="collName" select="$collName"/>
66 </xsl:apply-templates>
67
68 <xsl:if test="$berrybasketswitch = 'on'">
69 <xsl:call-template name="berrybasket"/>
70 </xsl:if>
71 <xsl:if test="contains($requesttype, 'r')">
72 <xsl:call-template name="query-response">
73 <xsl:with-param name="collName" select="$collName"/>
74 </xsl:call-template>
75 </xsl:if>
76
77 </div>
78 </xsl:template>
79
80
81 <!-- layout the response -->
82 <xsl:template name="query-response">
83 <xsl:param name="collName"/>
84 <xsl:call-template name="dividerBar"><xsl:with-param name='text'>query.results</xsl:with-param></xsl:call-template>
85
86 <!-- If query term information is available, display it -->
87 <xsl:call-template name="termInfo"/>
88 <xsl:call-template name="matchDocs"/>
89
90 <xsl:if test="documentNodeList">
91
92 <!-- next and prev links at top of results-->
93 <xsl:call-template name="resultNavigation">
94 <xsl:with-param name="collName" select="$collName"/>
95 </xsl:call-template>
96
97 <!-- Display the matching documents -->
98 <xsl:call-template name="resultList">
99 <xsl:with-param name="collName" select="$collName"/>
100 </xsl:call-template>
101
102 <!-- next and prev links at bottom of page -->
103 <xsl:call-template name="resultNavigation">
104 <xsl:with-param name="collName" select="$collName"/>
105 </xsl:call-template>
106 </xsl:if>
107 </xsl:template>
108
109
110 <xsl:template match="service">
111 <xsl:param name="collName"/>
112 <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
113 <div id="queryform">
114 <form name="QueryForm" method="get" action="{$library_name}">
115 <input type="hidden" name="a" value="q"/>
116 <input type="hidden" name="sa" value="{$subaction}"/>
117 <input type="hidden" name="rt" value="rd"/>
118 <input type="hidden" name="s" value="{@name}"/>
119 <input type="hidden" name="c" value="{$collName}"/>
120 <xsl:if test="not(paramList/param[@name='startPage'])">
121 <input type="hidden" name="startPage" value="1"/>
122 </xsl:if>
123 <xsl:apply-templates select="paramList"/>
124 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
125 </form>
126 </div>
127 </xsl:template>
128
129</xsl:stylesheet>
130
131
132
133
134
135
Note: See TracBrowser for help on using the repository browser.