source: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl@ 23489

Last change on this file since 23489 was 23489, checked in by sjb48, 13 years ago

Working on saving a format statement to the config file. This looks like it should work but changes in FormatAction have caused major issues with Document/Node violations. This is because saving required the format statement as a Document rather than a string (which did work). Added a check to GSXML for xmlNodeToString to check that attrs is not null (attrs will be null unless the node is an element).

File size: 14.3 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
5 xmlns:java="http://xml.apache.org/xslt/java"
6 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
7 xmlns:gslib="http://www.greenstone.org/skinning"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9
10 xmlns:lxslt="http://xml.apache.org/xslt"
11 xmlns:result="http://www.example.com/results"
12 xmlns:exsl="http://exslt.org/common"
13
14 extension-element-prefixes="java util result exsl"
15 exclude-result-prefixes="util java util">
16
17 <xsl:include href="xml-to-gui.xsl"/>
18 <xsl:include href="xml-to-gui-templates.xsl"/>
19
20 <!-- put the URL or path of your site here site -->
21 <!-- eg 'http://www.example.com/mysite' or '/mysite' -->
22 <xsl:template name="siteURL"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteURL']"/></xsl:template>
23
24
25 <!-- the output format for this layout is html -->
26 <!-- <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes" omit-xml-declaration="yes"/> -->
27 <xsl:output method="html" omit-xml-declaration="yes"/>
28
29 <!-- the main layout is defined here -->
30 <xsl:template match="/">
31
32 <html>
33
34 <head>
35 <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
36 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
37 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery.js"><xsl:text> </xsl:text></script> -->
38 <script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>
39 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8.2.custom.min.js"><xsl:text> </xsl:text></script> -->
40 <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/ui/jquery-ui.js"><xsl:text> </xsl:text></script>
41 <script type="text/javascript" src="interfaces/oran/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
42 <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"><xsl:text> </xsl:text></script> -->
43 <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"><xsl:text> </xsl:text></script> -->
44 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/jquery-1.4.1.js"><xsl:text> </xsl:text></script> -->
45
46 <xsl:call-template name="berryBasketHeadTags"/>
47 </head>
48
49 <body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/>
50
51 <xsl:call-template name="displayErrorsIfAny"/>
52
53 <div id="container"><div id="container2"><div id="container3"><div id="container4">
54
55 <div id="gs_banner">
56
57 <!-- show the title -->
58 <div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
59 <h2><xsl:call-template name="pageTitle"/></h2>
60
61 <xsl:if test="/page/pageResponse/collection">
62 <!-- show home, help, preferences links -->
63 <ul id="bannerLinks">
64
65 <!-- preferences -->
66 <li>
67 <a href="{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c={$collName}">
68 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
69 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
70 </a>
71 </li>
72
73 <!-- help -->
74 <li>
75 <a href="{$library_name}?a=p&amp;amp;sa=help&amp;amp;c={$collName}">
76 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
77 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
78 </a>
79 </li>
80
81 <li>
82 <a href="{$library_name}?a=p&amp;amp;sa=home">
83 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
84 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
85 </a>
86 </li>
87
88 </ul>
89 </xsl:if>
90
91 <!-- show the available 'services' (browse, search, etc.) -->
92 <xsl:if test="/page/pageResponse/collection/serviceList/service">
93 <ul id="nav">
94 <!-- show browse service, if it exists -->
95 <xsl:if test="/page/pageResponse/collection/serviceList/service[@type='browse']">
96 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='browse']">
97 <xsl:call-template name="navigationTab"/>
98 </xsl:for-each>
99 </xsl:if>
100
101 <!-- show search services (collapsed) if they exist -->
102 <xsl:if test="/page/pageResponse/collection/serviceList/service[@type='query']">
103 <xsl:for-each select="/page/pageResponse/collection/serviceList">
104
105 <!--
106 using collapsedNavigationTab instead of navigationTab collapses
107 all the services of the given type onto one tab
108 -->
109 <xsl:call-template name="collapsedNavigationTab">
110 <xsl:with-param name="type">query</xsl:with-param>
111 </xsl:call-template>
112 </xsl:for-each>
113 </xsl:if>
114
115 <!-- all other services -->
116 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[not(@type='query') and not(@type='browse')]">
117 <xsl:call-template name="navigationTab"/>
118 </xsl:for-each>
119
120 </ul>
121 </xsl:if>
122
123 </div>
124
125<!-- *************************************************************************************** -->
126
127 <!-- <xsl:variable name="foo"> -->
128 <!-- <xsl:value-of select="/page/pageRequest/paramList[@name='formatedit']"/> -->
129
130 <xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='1')]">
131
132<!-- Sam2's div code -->
133
134 <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
135 <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
136
137 <xsl:call-template name="xml-to-gui-templates">
138 <xsl:with-param name="node-set" select="test"/>
139 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
140 </xsl:call-template>
141
142 <xsl:variable name="fmt1">
143 <xsl:call-template name="xml-to-string">
144 <xsl:with-param name="node-set" select="//format[@type='browse']"/>
145 </xsl:call-template>
146 </xsl:variable>
147
148 <xsl:variable name="meta">
149 <xsl:call-template name="xml-to-string">
150 <xsl:with-param name="node-set" select="//metadataSetList"/>
151 </xsl:call-template>
152 </xsl:variable>
153
154 <style type="text/css">
155 .placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
156
157 .placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
158
159 .header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px;}
160
161 .resizable { width: 150px; height: 150px; padding: 0.5em; }
162
163 .block { margin-left: 15px; border-left: dashed 1px black;}
164
165 .droppable { background-color: #99dd99;}
166 .droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
167
168 <!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
169
170 <!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
171 </style>
172
173 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
174
175 <table width="100%" border="1">
176
177 <td width="75%">
178
179 <button id="updateFormatStatement" type="button" onclick="updateFormatStatement()">Update Format Statement</button>
180 <button id="saveFormatStatement" type="button" onclick="saveFormatStatement()">Save Format Statement</button>
181
182 <div id="formatStatement">
183 <div id="formatRoot">
184
185 <xsl:call-template name="xml-to-gui">
186 <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/> -->
187 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
188 </xsl:call-template>
189 </div>
190 </div>
191 </td>
192
193
194 <td width="25%" valign="top">
195 <h2> Elements to add </h2>
196 <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
197 <div class="draggable_gsf_template css_gsf_template block" title="gsf:template"><table class="header"><tbody><tr><td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table><table border="1"><tr class="tr"><td class="droppable" width="10px"></td></tr></table></div><br/>
198
199 <div class="draggable_gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata"><table class="header"><tbody><tr><td class="header">CHOOSE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
200
201 <div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
202 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
203 <xsl:with-param name="current" select="ex.Title"/>
204 </xsl:call-template></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
205
206 <div class="draggable_gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
207 <option value = "document" selected = "document">Document</option>
208 <option value = "classifier">Classifier</option>
209 <option value = "source">Source</option>
210 <option value = "horizontal">Horizontal</option>
211 </select></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
212
213 <div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch"><table class="header"><tbody><tr><td class="header">SWITCH</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
214
215 <div class="draggable_gsf_when css_gsf_when block" title="gsf:when"><table class="header"><tbody><tr><td class="header">WHEN<xsl:value-of select="@test"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
216
217 <div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise"><table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
218
219 <div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon"><table class="header"><tbody><tr><td class="header">ICON<select><option value = "document" selected = "document">Document</option><option value = "classifier">Classifier</option><option value = "source">Source</option></select></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
220 <br/>
221 <div class="draggable_gsf_text css_text" title="text"><table class="header"><tbody><tr><td class="header"><input type="text" name="rawtextinput" size="10" value=""/></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
222 <div class="draggable_table css_table" title="gsf:table">NEW TABLE</div>
223 <div class="draggable_tr css_tr" title="gsf:row">NEW TABLE ROW</div>
224 <div class="draggable_td css_td" title="gsf:column">NEW TABLE COLUMN</div>
225
226 </td>
227 </table>
228
229 <!--
230 <div id="format">
231 <p>
232 <b>Format string here</b>
233 <i>
234 <xsl:value-of select="$fmt1"/>
235 </i>
236 </p>
237 </div> -->
238 <!-- <p>
239 <i>
240 <xsl:value-of select="$meta"/>
241 </i>
242 </p>
243 </div> -->
244 </xsl:if>
245
246<!-- *************************************************************************************** -->
247<H2>Preview</H2>
248
249 <div id="my_categories"><xsl:text> </xsl:text></div>
250
251 <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe>
252
253 <xsl:variable name="preview">
254 <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
255 <div id="gs_content">
256 <!--
257 show the content of the page.
258 to customise this part, edit the xsl file for the page you want to edit
259 -->
260 <xsl:apply-templates select="/page"/>
261
262 </div>
263 </xsl:variable>
264
265 <script type="text/javascript">
266 preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
267 </script>
268
269 <div id="result">
270 Here
271 </div>
272
273 <div id="gs_footer">
274 <xsl:call-template name="poweredByGS3TextBar"/>
275 </div>
276
277 <div class="corner" id="cornerTopLeft"><xsl:text> </xsl:text></div>
278 <div class="corner" id="cornerTopRight"><xsl:text> </xsl:text></div>
279 <div class="corner" id="cornerBottomLeft"><xsl:text> </xsl:text></div>
280 <div class="corner" id="cornerBottomRight"><xsl:text> </xsl:text></div>
281
282 </div></div></div></div>
283
284 </body>
285 </html>
286 </xsl:template>
287
288</xsl:stylesheet>
289
290
Note: See TracBrowser for help on using the repository browser.