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 | <xsl:template name="greenstonePageBanner">
|
---|
45 | <center>
|
---|
46 | <table width="537" cellspacing="0" cellpadding="0">
|
---|
47 | <tr valign="top">
|
---|
48 | <td rowspan="2" align="left"><center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
|
---|
49 | <td align="right"></td>
|
---|
50 | </tr>
|
---|
51 |
|
---|
52 | <tr>
|
---|
53 | <td align="right"></td>
|
---|
54 | </tr>
|
---|
55 |
|
---|
56 | <tr>
|
---|
57 | <td colspan="2"></td>
|
---|
58 | </tr>
|
---|
59 | </table>
|
---|
60 | <xsl:call-template name="greenBar"/>
|
---|
61 |
|
---|
62 | </center>
|
---|
63 |
|
---|
64 | <!-- end of page banner -->
|
---|
65 |
|
---|
66 | </xsl:template>
|
---|
67 |
|
---|
68 | <xsl:template name="greenstoneFooter">
|
---|
69 | <center>
|
---|
70 | <p/>
|
---|
71 | <small>powered by greenstone3</small>
|
---|
72 | </center>
|
---|
73 | </xsl:template>
|
---|
74 |
|
---|
75 | <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
|
---|
76 | <xsl:template name="collectionPageBanner">
|
---|
77 | <xsl:param name="collName"/>
|
---|
78 | <xsl:variable name="httpPath" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
|
---|
79 | <xsl:variable name="colIcon" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
|
---|
80 | <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
|
---|
81 | <table width="537">
|
---|
82 | <tr>
|
---|
83 | <td align="left">
|
---|
84 | <a href="{$library}?a=p&sa=about&c={$collName}">
|
---|
85 | <img width="150" border="0">
|
---|
86 | <xsl:attribute name="src">
|
---|
87 | <xsl:value-of select="$httpPath"/>/images/<xsl:value-of select="$colIcon"/>
|
---|
88 | </xsl:attribute>
|
---|
89 | <xsl:attribute name="alt">
|
---|
90 | <xsl:call-template name="text">
|
---|
91 | <xsl:with-param name="key">aboutpage</xsl:with-param>
|
---|
92 | </xsl:call-template>
|
---|
93 | </xsl:attribute>
|
---|
94 | </img>
|
---|
95 | </a>
|
---|
96 | </td>
|
---|
97 | <td align="right">
|
---|
98 | <a href="{$library}?a=p&sa=home">
|
---|
99 | <xsl:call-template name="text">
|
---|
100 | <xsl:with-param name="key">home</xsl:with-param>
|
---|
101 | </xsl:call-template>
|
---|
102 | </a>
|
---|
103 | </td>
|
---|
104 | </tr>
|
---|
105 | </table>
|
---|
106 |
|
---|
107 | <xsl:call-template name="greenBar"/>
|
---|
108 | </xsl:template>
|
---|
109 |
|
---|
110 |
|
---|
111 | <!-- do we want different stuff for cluster or same as collection -->
|
---|
112 | <xsl:template name="clusterPageBanner">
|
---|
113 | <xsl:param name="clusterName"/>
|
---|
114 | <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
|
---|
115 | <table width="537">
|
---|
116 | <tr><td align="left"><a href="{$library}?a=p&sa=about&c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library}?a=p&sa=home"><xsl:call-template name="text"><xsl:with-param name="key">home</xsl:with-param></xsl:call-template></a></td></tr></table>
|
---|
117 |
|
---|
118 | <xsl:call-template name="greenBar"/>
|
---|
119 | </xsl:template>
|
---|
120 |
|
---|
121 | <xsl:template name="greenBar">
|
---|
122 | <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
|
---|
123 | </xsl:template>
|
---|
124 |
|
---|
125 |
|
---|
126 |
|
---|
127 | <!-- Display the appropriate image, depending on the node type -->
|
---|
128 | <xsl:template match="documentNode" mode="displayNodeIcon">
|
---|
129 |
|
---|
130 | <!-- Root node: book icon (open or closed) -->
|
---|
131 | <xsl:if test="@nodeType='root'">
|
---|
132 | <xsl:choose>
|
---|
133 | <xsl:when test="documentNode">
|
---|
134 | <img border="0" width="28" height="23"
|
---|
135 | src="interfaces/default/images/openbook.gif"
|
---|
136 | alt="Close this book"/>
|
---|
137 | </xsl:when>
|
---|
138 | <xsl:otherwise>
|
---|
139 | <img border="0" width="18" height="11"
|
---|
140 | src="interfaces/default/images/book.gif"
|
---|
141 | alt="Open this document and view contents"/>
|
---|
142 | </xsl:otherwise>
|
---|
143 | </xsl:choose>
|
---|
144 | </xsl:if>
|
---|
145 |
|
---|
146 | <!-- Interior node: folder icon (open or closed) -->
|
---|
147 | <xsl:if test="@nodeType='interior'">
|
---|
148 | <xsl:choose>
|
---|
149 | <xsl:when test="documentNode">
|
---|
150 | <img border="0" width="23" height="15"
|
---|
151 | src="interfaces/default/images/openfldr.gif"
|
---|
152 | alt="Close this folder"/>
|
---|
153 | </xsl:when>
|
---|
154 | <xsl:otherwise>
|
---|
155 | <img border="0" width="23" height="15"
|
---|
156 | src="interfaces/default/images/clsdfldr.gif"
|
---|
157 | alt="Open this folder and view contents"/>
|
---|
158 | </xsl:otherwise>
|
---|
159 | </xsl:choose>
|
---|
160 | </xsl:if>
|
---|
161 |
|
---|
162 | <!-- Leaf node: page icon -->
|
---|
163 | <xsl:if test="@nodeType='leaf'">
|
---|
164 | <img border="0" width="16" height="21"
|
---|
165 | src="interfaces/default/images/itext.gif"
|
---|
166 | alt="View the document"/>
|
---|
167 | </xsl:if>
|
---|
168 | </xsl:template>
|
---|
169 |
|
---|
170 |
|
---|
171 |
|
---|
172 |
|
---|
173 | <!-- text stuff. can be called via xsl:call-template:
|
---|
174 |
|
---|
175 | <xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
|
---|
176 |
|
---|
177 | otherwise can be selected by :
|
---|
178 |
|
---|
179 | <xsl:apply-templates select="text"/>
|
---|
180 |
|
---|
181 | the text elem to be processed must be in the form
|
---|
182 | <text name="query.about"/>
|
---|
183 |
|
---|
184 | -->
|
---|
185 |
|
---|
186 | <!-- should we look in the display element, or dynamically get from resource bundles - would this mean they are reloaded everytime??-->
|
---|
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/pageExtra/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 | <!-- no match found, output the name of the text string -->
|
---|
194 | _<xsl:value-of select="$key"/>_</xsl:otherwise>
|
---|
195 | </xsl:choose>
|
---|
196 | </xsl:template>
|
---|
197 |
|
---|
198 | </xsl:stylesheet>
|
---|