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 | <!-- some global parameters - these are set by whoever is invoking the transformation -->
|
---|
10 | <xsl:param name="interface_name"/>
|
---|
11 | <xsl:param name="library_name"/>
|
---|
12 |
|
---|
13 | <!-- the main page layout template is here -->
|
---|
14 | <xsl:template match="page">
|
---|
15 | <html>
|
---|
16 | <xsl:call-template name="pageHead"/>
|
---|
17 | <body xsl:use-attribute-sets="body-style">
|
---|
18 | <table border="0" cellspacing="0" cellpadding="0" width="100%">
|
---|
19 | <td valign="top" width="65">
|
---|
20 | <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/>
|
---|
21 | </td>
|
---|
22 | <td>
|
---|
23 | <center>
|
---|
24 | <table width="537">
|
---|
25 | <tr><td>
|
---|
26 | <xsl:apply-templates select="pageResponse"/>
|
---|
27 | <xsl:call-template name="greenstoneFooter"/>
|
---|
28 | </td></tr>
|
---|
29 | </table>
|
---|
30 | </center>
|
---|
31 | </td>
|
---|
32 | </table>
|
---|
33 | </body>
|
---|
34 | </html>
|
---|
35 | </xsl:template>
|
---|
36 |
|
---|
37 | <xsl:template name="headScript">
|
---|
38 | <script>
|
---|
39 | <xsl:text disable-output-escaping="yes">
|
---|
40 | <!--
|
---|
41 | var loaded = new Array();
|
---|
42 | function gbutton (image, onimage) {
|
---|
43 | if (image && image.src && (image.out == null || typeof(image.out) == typeof(void(0)))) {
|
---|
44 | s = image.src;
|
---|
45 | image.out = new Image();
|
---|
46 | image.out.src = s;
|
---|
47 | image.over = new Image();
|
---|
48 | image.over.src = onimage;
|
---|
49 | loaded[image.name] = image;
|
---|
50 | }
|
---|
51 | }
|
---|
52 |
|
---|
53 | function roll (imagename, over) {
|
---|
54 | if (document.images) {
|
---|
55 | if (over) i = "over";
|
---|
56 | else i = "out";
|
---|
57 | image = loaded[imagename];
|
---|
58 | if (image) image.src = eval("image."+i+".src");
|
---|
59 | }
|
---|
60 | }
|
---|
61 | //-->
|
---|
62 | </xsl:text>
|
---|
63 |
|
---|
64 | </script>
|
---|
65 | </xsl:template>
|
---|
66 |
|
---|
67 | <xsl:template name="genericPageBanner">
|
---|
68 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
69 | <center>
|
---|
70 | <table width="537">
|
---|
71 | <tr><td align="left"></td>
|
---|
72 | <td align="right">
|
---|
73 | <a href="{$library_name}?a=p&sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
|
---|
74 | </td>
|
---|
75 | </tr>
|
---|
76 | </table>
|
---|
77 | </center>
|
---|
78 | <xsl:call-template name="dividerBar"/>
|
---|
79 | </xsl:template>
|
---|
80 |
|
---|
81 |
|
---|
82 | <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
|
---|
83 | <xsl:template name="standardPageBanner">
|
---|
84 | <xsl:param name="collName"/>
|
---|
85 | <xsl:param name="pageType"/>
|
---|
86 | <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
|
---|
87 | <xsl:variable name="colIcon" select="/page/pageResponse/collection/displayItem[@name='icon']"/>
|
---|
88 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
89 | <table width="537">
|
---|
90 | <tr>
|
---|
91 | <td align="left" rowspan="2">
|
---|
92 | <a href="{$library_name}?a=p&sa=about&c={$collName}">
|
---|
93 | <img border="1" src="{$httpPath}/images/{$colIcon}">
|
---|
94 | <xsl:attribute name="alt">
|
---|
95 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
|
---|
96 | </xsl:attribute>
|
---|
97 | </img>
|
---|
98 | </a>
|
---|
99 | </td>
|
---|
100 | <td align="right">
|
---|
101 | <a href="{$library_name}?a=p&sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
|
---|
102 | <a href="{$library_name}?a=p&sa=help&c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a>
|
---|
103 | <a href="{$library_name}?a=p&sa=pref&c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a>
|
---|
104 | </td>
|
---|
105 | </tr>
|
---|
106 | <tr>
|
---|
107 | <td align='right'><xsl:if test="$pageType"><img src="interfaces/nzdl/images/{$lang}/h_{$pageType}.gif" width="200" height="57"/></xsl:if></td>
|
---|
108 | </tr>
|
---|
109 |
|
---|
110 | <tr>
|
---|
111 | <td colspan='2'></td>
|
---|
112 | </tr>
|
---|
113 | </table>
|
---|
114 |
|
---|
115 | <xsl:call-template name="navigationBar">
|
---|
116 | <xsl:with-param name="collName" select="$collName"/>
|
---|
117 | </xsl:call-template>
|
---|
118 | </xsl:template>
|
---|
119 |
|
---|
120 | <xsl:template name="navigationBar">
|
---|
121 | <xsl:param name="collName"/>
|
---|
122 | <xsl:variable name="classifiers" select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
|
---|
123 | <xsl:variable name="action" select="/page/pageRequest/@action"/>
|
---|
124 | <xsl:variable name="classifier"><xsl:if test="$action='b'"><xsl:value-of select="/page/pageRequest/paramList/param[@name='cl']/@value"/></xsl:if></xsl:variable>
|
---|
125 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
126 | <!--action=<xsl:value-of select="$action"/>, classifier=<xsl:value-of select="$classifier"/>-->
|
---|
127 | <xsl:text disable-output-escaping='yes'>
|
---|
128 | <!-- Navigation Bar -->
|
---|
129 | </xsl:text>
|
---|
130 | <nobr>
|
---|
131 | <xsl:call-template name="nbSearch">
|
---|
132 | <xsl:with-param name="collName" select="$collName"/>
|
---|
133 | <xsl:with-param name="action" select="$action"/>
|
---|
134 | </xsl:call-template>
|
---|
135 |
|
---|
136 | <xsl:for-each select="$classifiers/classifier">
|
---|
137 | <xsl:apply-templates select="." mode="nav-bar-button">
|
---|
138 | <xsl:with-param name="collName" select="$collName"/>
|
---|
139 | <xsl:with-param name="classifier" select="$classifier"/>
|
---|
140 | </xsl:apply-templates>
|
---|
141 | </xsl:for-each>
|
---|
142 | <xsl:call-template name="nbPhrase"> <!-- this may be nothing if there is no phrase browsing for a collection -->
|
---|
143 | <xsl:with-param name="collName" select="$collName"/>
|
---|
144 | <xsl:with-param name="action" select="$action"/>
|
---|
145 | </xsl:call-template>
|
---|
146 | </nobr>
|
---|
147 | <xsl:text disable-output-escaping='yes'>
|
---|
148 | <!-- End of Navigation Bar -->
|
---|
149 | </xsl:text>
|
---|
150 | </xsl:template>
|
---|
151 |
|
---|
152 | <xsl:template name="dividerBar">
|
---|
153 | <xsl:param name='text'/>
|
---|
154 | <br/><table width='537' border="0" cellpadding="0" cellspacing="0">
|
---|
155 | <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b> <xsl:value-of select='$text'/></b></font></td></tr></table><br/>
|
---|
156 | </xsl:template>
|
---|
157 |
|
---|
158 | <xsl:template name="navBarImage">
|
---|
159 | <xsl:param name="url"/>
|
---|
160 | <xsl:param name="name"/>
|
---|
161 | <xsl:param name="alt"/>
|
---|
162 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
163 | <a href="{$url}" onMouseOver="roll('{$name}', 1);" onMouseOut="roll('{$name}', 0);"><img name="{$name}" src="interfaces/nzdl/images/{$lang}/t{$name}of.gif" onLoad="gbutton(this,'interfaces/nzdl/images/{$lang}/t{$name}on.gif');" border='0' alt="{$alt}" title="{alt}"/></a>
|
---|
164 | </xsl:template>
|
---|
165 |
|
---|
166 | <xsl:template name="nbSearch">
|
---|
167 | <xsl:param name="collName"/>
|
---|
168 | <xsl:param name="action"/>
|
---|
169 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
170 | <xsl:choose>
|
---|
171 | <xsl:when test="$action='q'">
|
---|
172 | <img src="interfaces/nzdl/images/{$lang}/tSearchgr.gif" border='0' alt="Search" title="Search"/>
|
---|
173 | </xsl:when>
|
---|
174 | <xsl:otherwise>
|
---|
175 | <!-- need to check for form search -->
|
---|
176 | <xsl:variable name="query-service">
|
---|
177 | <xsl:choose>
|
---|
178 | <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
|
---|
179 | <xsl:when test="/page/pageRequest/paramList/param[@name='ct']/@value='0'">TextQuery</xsl:when>
|
---|
180 | <xsl:when test="/page/pageRequest/paramList/param[@name='qt']/@value='1'"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']/@value='1'">AdvancedFieldQuery</xsl:when><xsl:otherwise>FieldQuery</xsl:otherwise></xsl:choose></xsl:when>
|
---|
181 | <xsl:otherwise>TextQuery</xsl:otherwise>
|
---|
182 | </xsl:choose>
|
---|
183 | </xsl:variable>
|
---|
184 | <xsl:call-template name="navBarImage">
|
---|
185 | <xsl:with-param name="url">nzdl?a=q&rt=d&s=<xsl:value-of select="$query-service"/>&c=<xsl:value-of select="$collName"/></xsl:with-param>
|
---|
186 | <xsl:with-param name="name">Search</xsl:with-param>
|
---|
187 | <xsl:with-param name="alt">Search</xsl:with-param>
|
---|
188 | </xsl:call-template>
|
---|
189 | </xsl:otherwise>
|
---|
190 | </xsl:choose>
|
---|
191 | </xsl:template>
|
---|
192 |
|
---|
193 | <xsl:template name="nbPhrase">
|
---|
194 | <xsl:param name="collName"/>
|
---|
195 | <xsl:param name="action"/>
|
---|
196 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
197 | <xsl:if test="/page/pageResponse/collection/serviceList/service[@name='PhindApplet']">
|
---|
198 | <xsl:choose>
|
---|
199 | <xsl:when test="$action='a'"><!-- note, this assumes that the phind applet is the only applet -->
|
---|
200 | <img src="interfaces/nzdl/images/{$lang}/tPhrasegr.gif" border='0' alt="Phrase Browse" title="Phrase Browse"/>
|
---|
201 | </xsl:when>
|
---|
202 | <xsl:otherwise>
|
---|
203 | <xsl:call-template name="navBarImage">
|
---|
204 | <xsl:with-param name="url">nzdl?a=a&rt=d&s=PhindApplet&c=<xsl:value-of select="$collName"/></xsl:with-param>
|
---|
205 | <xsl:with-param name="name">Phrase</xsl:with-param>
|
---|
206 | <xsl:with-param name="alt">Phrase Browse</xsl:with-param>
|
---|
207 | </xsl:call-template>
|
---|
208 | </xsl:otherwise>
|
---|
209 | </xsl:choose>
|
---|
210 | </xsl:if>
|
---|
211 | </xsl:template>
|
---|
212 |
|
---|
213 | <xsl:template match="classifier" mode="nav-bar-button">
|
---|
214 | <xsl:param name="collName"/>
|
---|
215 | <xsl:param name="classifier"/>
|
---|
216 | <xsl:variable name="buttonname"><xsl:choose><xsl:when test="@buttonname"><xsl:value-of select="@buttonname"/></xsl:when><xsl:otherwise><xsl:value-of select="@content"/></xsl:otherwise></xsl:choose></xsl:variable>
|
---|
217 | <xsl:variable name="lang" select="/page/@lang"/>
|
---|
218 | <xsl:choose>
|
---|
219 | <xsl:when test="starts-with($classifier, @name)">
|
---|
220 | <img src="interfaces/nzdl/images/{$lang}/t{$buttonname}gr.gif" border='0' alt="{$buttonname}" title="{$buttonname}"/>
|
---|
221 | </xsl:when>
|
---|
222 | <xsl:otherwise>
|
---|
223 | <xsl:call-template name="navBarImage">
|
---|
224 | <xsl:with-param name="url">nzdl?a=b&rt=r&s=ClassifierBrowse&c=<xsl:value-of select="$collName"/>&cl=<xsl:value-of select="@name"/></xsl:with-param>
|
---|
225 | <xsl:with-param name="name" select="$buttonname"/>
|
---|
226 | <xsl:with-param name="alt" select="$buttonname"/>
|
---|
227 | </xsl:call-template>
|
---|
228 | </xsl:otherwise>
|
---|
229 | </xsl:choose>
|
---|
230 | </xsl:template>
|
---|
231 |
|
---|
232 | <xsl:attribute-set name="body-style">
|
---|
233 | <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
|
---|
234 | <xsl:attribute name="text">#000000</xsl:attribute>
|
---|
235 | <xsl:attribute name="link">#006666</xsl:attribute>
|
---|
236 | <xsl:attribute name="alink">#cc9900</xsl:attribute>
|
---|
237 | <xsl:attribute name="vlink">#666633</xsl:attribute>
|
---|
238 | <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
|
---|
239 | </xsl:attribute-set>
|
---|
240 |
|
---|
241 | <!-- this should probably use a greenstone image rather than nzdl image -->
|
---|
242 | <xsl:template name="nzdlPageBanner">
|
---|
243 | <center>
|
---|
244 | <table width="537" cellspacing="0" cellpadding="0">
|
---|
245 | <tr valign="top">
|
---|
246 | <td rowspan="2" align="left"><center><img src="interfaces/nzdl/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></xsl:attribute></img></center></td>
|
---|
247 | <td align="right"></td>
|
---|
248 | </tr>
|
---|
249 |
|
---|
250 | <tr>
|
---|
251 | <td align="right"></td>
|
---|
252 | </tr>
|
---|
253 |
|
---|
254 | <tr>
|
---|
255 | <td colspan="2"></td>
|
---|
256 | </tr>
|
---|
257 | </table>
|
---|
258 | </center>
|
---|
259 |
|
---|
260 | <!-- end of page banner -->
|
---|
261 |
|
---|
262 | </xsl:template>
|
---|
263 |
|
---|
264 | <xsl:template name="greenstoneFooter">
|
---|
265 | <center>
|
---|
266 | <p/>
|
---|
267 | <small>powered by greenstone3</small>
|
---|
268 | </center>
|
---|
269 | </xsl:template>
|
---|
270 |
|
---|
271 |
|
---|
272 | <xsl:template name="iconblankbar">
|
---|
273 | <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
|
---|
274 | </xsl:template>
|
---|
275 |
|
---|
276 | <xsl:template name="imagegreenstone">
|
---|
277 | <img src="interfaces/nzdl/images/gsdl.gif" width="140" height="77" border="0" hspace='0'><xsl:attribute name='alt'><xsl:call-template name='textimagegreenstone'/></xsl:attribute></img>
|
---|
278 | </xsl:template>
|
---|
279 |
|
---|
280 |
|
---|
281 | <!-- Display the appropriate image, depending on the node type -->
|
---|
282 | <xsl:template match="documentNode" mode="displayNodeIcon">
|
---|
283 |
|
---|
284 | <!-- Root node: book icon (open or closed) -->
|
---|
285 | <xsl:if test="@nodeType='root'">
|
---|
286 | <xsl:choose>
|
---|
287 | <xsl:when test="documentNode">
|
---|
288 | <img border="0" width="28" height="23"
|
---|
289 | src="interfaces/default/images/openbook.gif"
|
---|
290 | alt="Close this book"/>
|
---|
291 | </xsl:when>
|
---|
292 | <xsl:otherwise>
|
---|
293 | <img border="0" width="18" height="11"
|
---|
294 | src="interfaces/default/images/book.gif"
|
---|
295 | alt="Open this document and view contents"/>
|
---|
296 | </xsl:otherwise>
|
---|
297 | </xsl:choose>
|
---|
298 | </xsl:if>
|
---|
299 |
|
---|
300 | <!-- Interior node: folder icon (open or closed) -->
|
---|
301 | <xsl:if test="@nodeType='interior'">
|
---|
302 | <xsl:choose>
|
---|
303 | <xsl:when test="documentNode">
|
---|
304 | <img border="0" width="23" height="15"
|
---|
305 | src="interfaces/default/images/openfldr.gif"
|
---|
306 | alt="Close this folder"/>
|
---|
307 | </xsl:when>
|
---|
308 | <xsl:otherwise>
|
---|
309 | <img border="0" width="23" height="15"
|
---|
310 | src="interfaces/default/images/clsdfldr.gif"
|
---|
311 | alt="Open this folder and view contents"/>
|
---|
312 | </xsl:otherwise>
|
---|
313 | </xsl:choose>
|
---|
314 | </xsl:if>
|
---|
315 |
|
---|
316 | <!-- Leaf node: page icon -->
|
---|
317 | <xsl:if test="@nodeType='leaf'">
|
---|
318 | <img border="0" width="16" height="21"
|
---|
319 | src="interfaces/default/images/itext.gif"
|
---|
320 | alt="View the document"/>
|
---|
321 | </xsl:if>
|
---|
322 | </xsl:template>
|
---|
323 |
|
---|
324 |
|
---|
325 | </xsl:stylesheet>
|
---|