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

Last change on this file since 4047 was 4047, checked in by kjdon, 21 years ago

interfaces directory moved to inside web directory, this is a copy of the old default interface

  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 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
7 <!--
8 <xsl:output method="html"/>
9 -->
10
11 <!-- the main page layout template is here -->
12 <xsl:template match="page">
13 <html>
14 <xsl:call-template name="pageHead"/>
15 <body xsl:use-attribute-sets="body-style">
16 <table border="0" cellspacing="0" cellpadding="0" width="100%">
17 <td valign="top" width="65">
18 <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/>
19 </td>
20 <td>
21 <center>
22 <table width="537">
23 <tr/>
24 <td/>
25 <xsl:apply-templates select="pageResponse"/>
26 <xsl:call-template name="greenstoneFooter"/>
27 </table>
28 </center>
29 </td>
30 </table>
31 </body>
32 </html>
33 </xsl:template>
34
35 <xsl:attribute-set name="body-style">
36 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
37 <xsl:attribute name="text">#000000</xsl:attribute>
38 <xsl:attribute name="link">#006666</xsl:attribute>
39 <xsl:attribute name="alink">#cc9900</xsl:attribute>
40 <xsl:attribute name="vlink">#666633</xsl:attribute>
41 <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
42 </xsl:attribute-set>
43
44 <!-- this should probably use a greenstone image rather than nzdl image -->
45 <xsl:template name="greenstonePageBanner">
46 <center>
47 <table width="537" cellspacing="0" cellpadding="0">
48 <tr valign="top">
49 <td rowspan="2" align="left"><center><img src="interfaces/default/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
50 <td align="right"></td>
51 </tr>
52
53 <tr>
54 <td align="right"></td>
55 </tr>
56
57 <tr>
58 <td colspan="2"></td>
59 </tr>
60 </table>
61 <xsl:call-template name="greenBar"/>
62
63 </center>
64
65 <!-- end of page banner -->
66
67 </xsl:template>
68
69 <xsl:template name="greenstoneFooter">
70 <center>
71 <p/>
72 <small>powered by greenstone3</small>
73 </center>
74 </xsl:template>
75
76 <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
77 <xsl:template name="collectionPageBanner">
78 <xsl:param name="collName"/>
79 <xsl:variable name="httpPath" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
80 <xsl:variable name="colIcon" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
81 <xsl:variable name="library" select="ancestor::page/config/library_name"/>
82 <table width="537">
83 <tr>
84 <td align="left">
85 <a href="{$library}?a=p&amp;sa=about&amp;c={$collName}">
86 <img width="150" border="1">
87 <xsl:attribute name="src">
88 <xsl:value-of select="$httpPath"/>/images/<xsl:value-of select="$colIcon"/>
89 </xsl:attribute>
90 <xsl:attribute name="alt">
91 <xsl:call-template name="text">
92 <xsl:with-param name="key">aboutpage</xsl:with-param>
93 </xsl:call-template>
94 </xsl:attribute>
95 </img>
96 </a>
97 </td>
98 <td align="right">
99 <a href="{$library}?a=p&amp;sa=home">
100 <xsl:call-template name="text">
101 <xsl:with-param name="key">home</xsl:with-param>
102 </xsl:call-template>
103 </a>
104 </td>
105 </tr>
106 </table>
107
108 <xsl:call-template name="greenBar"/>
109 </xsl:template>
110
111
112 <!-- do we want different stuff for cluster or same as collection -->
113 <xsl:template name="clusterPageBanner">
114 <xsl:param name="clusterName"/>
115 <xsl:variable name="library" select="ancestor::page/config/library_name"/>
116 <table width="537">
117 <tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library}?a=p&amp;sa=home"><xsl:call-template name="text"><xsl:with-param name="key">home</xsl:with-param></xsl:call-template></a></td></tr></table>
118
119 <xsl:call-template name="greenBar"/>
120 </xsl:template>
121
122 <xsl:template name="greenBar">
123 <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
124 </xsl:template>
125
126
127
128 <!-- Display the appropriate image, depending on the node type -->
129 <xsl:template match="documentNode" mode="displayNodeIcon">
130
131 <!-- Root node: book icon (open or closed) -->
132 <xsl:if test="@nodeType='root'">
133 <xsl:choose>
134 <xsl:when test="documentNode">
135 <img border="0" width="28" height="23"
136 src="interfaces/default/images/openbook.gif"
137 alt="Close this book"/>
138 </xsl:when>
139 <xsl:otherwise>
140 <img border="0" width="18" height="11"
141 src="interfaces/default/images/book.gif"
142 alt="Open this document and view contents"/>
143 </xsl:otherwise>
144 </xsl:choose>
145 </xsl:if>
146
147 <!-- Interior node: folder icon (open or closed) -->
148 <xsl:if test="@nodeType='interior'">
149 <xsl:choose>
150 <xsl:when test="documentNode">
151 <img border="0" width="23" height="15"
152 src="interfaces/default/images/openfldr.gif"
153 alt="Close this folder"/>
154 </xsl:when>
155 <xsl:otherwise>
156 <img border="0" width="23" height="15"
157 src="interfaces/default/images/clsdfldr.gif"
158 alt="Open this folder and view contents"/>
159 </xsl:otherwise>
160 </xsl:choose>
161 </xsl:if>
162
163 <!-- Leaf node: page icon -->
164 <xsl:if test="@nodeType='leaf'">
165 <img border="0" width="16" height="21"
166 src="interfaces/default/images/itext.gif"
167 alt="View the document"/>
168 </xsl:if>
169</xsl:template>
170
171
172
173
174<!-- text stuff. can be called via xsl:call-template:
175
176<xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
177
178otherwise can be selected by :
179
180<xsl:apply-templates select="text"/>
181
182the text elem to be processed must be in the form
183<text name="query/about"/>
184
185-->
186
187<xsl:template name="text" match="text">
188<xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
189<xsl:variable name="path">ancestor::page/display/<xsl:value-of select='$key'/></xsl:variable>
190<xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable>
191<xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
192<xsl:otherwise>
193
194<!-- no match found, output the name of the text string -->
195_<xsl:value-of select="$key"/>_</xsl:otherwise>
196</xsl:choose>
197</xsl:template>
198
199
200<!-- may not have to use this anymore-->
201<xsl:template name="text-old" match="text-old">
202
203<xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
204
205<!-- try the current language -->
206
207<xsl:variable name="path1">ancestor::page/translate/current/text/<xsl:value-of select="$key"/></xsl:variable>
208<xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path1)"/></xsl:variable>
209<xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
210<xsl:otherwise>
211
212<!-- try the default language -->
213<xsl:variable name="path2">ancestor::page/translate/default/text/<xsl:value-of select="$key"/></xsl:variable>
214<xsl:variable name="string2"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path2)"/></xsl:variable>
215<xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
216<xsl:otherwise>
217
218<!-- no match found, output the name of the text string -->
219_<xsl:value-of select="$key"/>_</xsl:otherwise>
220</xsl:choose>
221</xsl:otherwise>
222</xsl:choose>
223</xsl:template>
224
225</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.