source: trunk/gsdl3/web/interfaces/default/transform/style.xsl@ 9011

Last change on this file since 9011 was 8964, checked in by kjdon, 19 years ago

interior renamed to internal

  • Property svn:keywords set to Author Date Id Revision
File size: 10.1 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 <!-- 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 <!-- global style info goes here -->
14 <xsl:template name="globalStyle">
15 <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
16 </xsl:template>
17
18 <!-- the main page layout template is here -->
19 <xsl:template match="page">
20 <html>
21 <xsl:call-template name="pageHead"/>
22 <body>
23 <table border="0" cellspacing="0" cellpadding="0" width="100%">
24 <td valign="top" width="65"><!-- a space for our side bar-->
25 <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/><!-- an image cos netscape ignores the cell width -->
26 </td>
27 <td>
28 <table width="100%">
29 <tr><td>
30 <xsl:apply-templates select="pageResponse"/>
31 <xsl:call-template name="greenstoneFooter"/>
32 </td></tr>
33 </table>
34 </td>
35 </table>
36 </body>
37 </html>
38 </xsl:template>
39
40 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
41 <xsl:template name="pageHead">
42 <head>
43 <title>
44 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
45 </title>
46 <xsl:call-template name="globalStyle"/>
47 <xsl:call-template name="pageStyle"/>
48 </head>
49 </xsl:template>
50
51
52 <xsl:template name="greenstonePageBanner">
53 <center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute></img></center>
54 <xsl:call-template name="dividerBar"/>
55 </xsl:template>
56
57 <xsl:template name="greenstoneFooter">
58 <center>
59 <p/>
60 <small><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/></small>
61 </center>
62 </xsl:template>
63
64 <xsl:template name="standardPageBanner">
65 <xsl:param name="collName"/>
66 <xsl:param name="pageType"/>
67 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
68 <table width="100%">
69 <tr>
70 <td align="left">
71 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
72 <xsl:choose>
73 <xsl:when test="$this-element/displayItem[@name='icon']">
74 <img border="0">
75 <xsl:attribute name="src">
76 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
77 </xsl:attribute>
78 <xsl:attribute name="alt">
79 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
80 </xsl:attribute>
81 <xsl:attribute name="title">
82 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
83 </xsl:attribute>
84 </img>
85 </xsl:when>
86 <xsl:otherwise>
87 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
88 </xsl:otherwise>
89 </xsl:choose>
90 </a>
91 </td>
92 <td align="right">
93 <xsl:call-template name="top-buttons">
94 <xsl:with-param name="collName" select="$collName"/>
95 <xsl:with-param name="pageType" select="$pageType"/>
96 </xsl:call-template>
97 </td>
98 </tr>
99 </table>
100 <p/>
101 </xsl:template>
102
103 <xsl:template name="top-buttons">
104 <xsl:param name="collName"/>
105 <xsl:param name="pageType"/>
106 <table cellspacing='4'>
107 <tr>
108 <td class="gsbutton">
109 <a class="gsbutton" href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
110 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
111 </a>
112 </td>
113 <xsl:choose>
114 <xsl:when test="$pageType='help'">
115 <td class="gsbuttonoff">
116 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
117 </td>
118 </xsl:when>
119 <xsl:otherwise>
120 <td class="gsbutton">
121 <a class="gsbutton" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
122 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
123 </a>
124 </td>
125 </xsl:otherwise>
126 </xsl:choose>
127 <xsl:choose>
128 <xsl:when test="$pageType='pref'">
129 <td class="gsbuttonoff">
130 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
131 </td>
132 </xsl:when>
133 <xsl:otherwise>
134 <td class="gsbutton">
135 <a class="gsbutton" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
136 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
137 </a>
138 </td>
139 </xsl:otherwise>
140 </xsl:choose>
141 </tr>
142 </table>
143
144 </xsl:template>
145
146 <xsl:template name="navigationBar">
147 <xsl:param name="collName"/>
148 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
149 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
150 <xsl:choose>
151 <xsl:when test="$this-element/serviceList/service">
152 <table border='0' cellspacing='0' width='100%'>
153 <tr>
154 <xsl:for-each select="$this-element/serviceList/service">
155 <xsl:variable name="action"><xsl:choose>
156 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
157 <xsl:when test="@type='query'">q</xsl:when>
158 <xsl:when test="@type='browse'">b</xsl:when>
159 <xsl:when test="@type='process'">pr</xsl:when>
160 <xsl:when test="@type='applet'">a</xsl:when>
161 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
162 </xsl:choose></xsl:variable>
163 <xsl:choose>
164 <xsl:when test="$action='CURRENT'">
165 <td class="navbaroff"><nobr><xsl:value-of select="displayItem[@name='name']"/></nobr></td>
166 </xsl:when>
167 <xsl:when test="$action !='DO_NOT_DISPLAY'">
168 <td class="navbar"><a class="navbar" href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><nobr><xsl:value-of select="displayItem[@name='name']"/></nobr></a></td>
169 </xsl:when>
170 </xsl:choose>
171 </xsl:for-each>
172 </tr>
173 </table>
174 </xsl:when>
175 <xsl:otherwise>
176 <table border='0' cellspacing='0' width='100%'><tr><td class="navbar">&#160;</td></tr></table>
177 </xsl:otherwise>
178 </xsl:choose>
179 </xsl:template>
180
181
182 <xsl:template name="dividerBar">
183 <xsl:param name='text'/>
184 <br/><table width='100%' border="0" cellpadding="0" cellspacing="0">
185 <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
186 </xsl:template>
187
188 <!-- Display the appropriate image, depending on the node type -->
189 <xsl:template match="documentNode" mode="displayNodeIcon">
190
191 <!-- Root node: book icon (open or closed) -->
192 <xsl:choose>
193 <xsl:when test="@nodeType='root'">
194 <xsl:choose>
195 <xsl:when test="documentNode">
196 <xsl:call-template name="openbookimg">
197 <xsl:with-param name="title">Close this book</xsl:with-param>
198 </xsl:call-template>
199 </xsl:when>
200 <xsl:otherwise>
201 <xsl:call-template name="closedbookimg">
202 <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
203 </xsl:call-template>
204 </xsl:otherwise>
205 </xsl:choose>
206 </xsl:when>
207
208 <!-- Internal node: folder icon (open or closed) -->
209 <xsl:when test="@nodeType='internal'">
210 <xsl:choose>
211 <xsl:when test="documentNode">
212 <xsl:call-template name="openfolderimg">
213 <xsl:with-param name="title">Close this folder</xsl:with-param>
214 </xsl:call-template>
215 </xsl:when>
216 <xsl:otherwise>
217 <xsl:call-template name="closedfolderimg">
218 <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
219 </xsl:call-template>
220 </xsl:otherwise>
221 </xsl:choose>
222 </xsl:when>
223
224 <!-- Leaf node: page icon, and this is the default -->
225 <xsl:otherwise>
226 <xsl:call-template name="textpageimg">
227 <xsl:with-param name="title">View the document</xsl:with-param>
228 </xsl:call-template>
229 </xsl:otherwise>
230 </xsl:choose>
231 </xsl:template>
232
233 <xsl:template name="openbookimg">
234 <xsl:param name="alt"/>
235 <xsl:param name="title"/>
236 <img border="0" width="28" height="23"
237 src="interfaces/default/images/openbook.gif"
238 alt="{$alt}" title="{$title}"/>
239 </xsl:template>
240
241 <xsl:template name="closedbookimg">
242 <xsl:param name="alt"/>
243 <xsl:param name="title"/>
244 <img border="0" width="18" height="11"
245 src="interfaces/default/images/book.gif"
246 alt="{$alt}" title="{$title}"/>
247 </xsl:template>
248
249 <xsl:template name="openfolderimg">
250 <xsl:param name="alt"/>
251 <xsl:param name="title"/>
252 <img border="0" width="23" height="15"
253 src="interfaces/default/images/openfldr.gif"
254 alt="{$alt}" title="{$title}"/>
255 </xsl:template>
256
257 <xsl:template name="closedfolderimg">
258 <xsl:param name="alt"/>
259 <xsl:param name="title"/>
260 <img border="0" width="23" height="15"
261 src="interfaces/default/images/clsdfldr.gif"
262 alt="{$alt}" title="{$title}"/>
263 </xsl:template>
264
265 <xsl:template name="textpageimg">
266 <xsl:param name="alt"/>
267 <xsl:param name="title"/>
268 <img border="0" width="16" height="21"
269 src="interfaces/default/images/itext.gif"
270 alt="{$alt}" title="{$title}"/>
271 </xsl:template>
272
273 <xsl:template name="bookshelfimg">
274 <xsl:param name="alt"/>
275 <xsl:param name="title"/>
276 <img border="0" width="20" height="16"
277 src="interfaces/default/images/bshelf.gif"
278 alt="{$alt}" title="{$title}"/>
279 </xsl:template>
280</xsl:stylesheet>
281
282
Note: See TracBrowser for help on using the repository browser.