source: main/trunk/greenstone3/web/interfaces/basic/transform/query.xsl

Last change on this file was 38056, checked in by kjdon, 8 months ago

made this interface work again with current greenstone. didn't do any prettying, just wanted to make it functional

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