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

Last change on this file since 23336 was 23336, checked in by sjb48, 11 years ago

Continued work on XHTML parsing for format statement saving. Found js code for ensuring XHTML (innerXHTML). Removed a few unneccessary bits of code from default servlet that were lingering around from when we first started playing with format statements.

File size: 14.2 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="createFormatStatement()">Update Format Statement</button>
180
181 <div id="formatStatement">
182 <div id="formatRoot">
183
184 <xsl:call-template name="xml-to-gui">
185 <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/> -->
186 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
187 </xsl:call-template>
188 </div>
189 </div>
190 </td>
191
192
193 <td width="25%" valign="top">
194 <h2> Elements to add </h2>
195 <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
196 <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/>
197
198 <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>
199
200 <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">
201 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
202 <xsl:with-param name="current" select="ex.Title"/>
203 </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>
204
205 <div class="draggable_gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
206 <option value = "document" selected = "document">Document</option>
207 <option value = "classifier">Classifier</option>
208 <option value = "source">Source</option>
209 <option value = "horizontal">Horizontal</option>
210 </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>
211
212 <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>
213
214 <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>
215
216 <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>
217
218 <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>
219 <br/>
220 <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>
221 <div class="draggable_table css_table" title="gsf:table">NEW TABLE</div>
222 <div class="draggable_tr css_tr" title="gsf:row">NEW TABLE ROW</div>
223 <div class="draggable_td css_td" title="gsf:column">NEW TABLE COLUMN</div>
224
225 </td>
226 </table>
227
228 <!--
229 <div id="format">
230 <p>
231 <b>Format string here</b>
232 <i>
233 <xsl:value-of select="$fmt1"/>
234 </i>
235 </p>
236 </div> -->
237 <!-- <p>
238 <i>
239 <xsl:value-of select="$meta"/>
240 </i>
241 </p>
242 </div> -->
243 </xsl:if>
244
245<!-- *************************************************************************************** -->
246<H2>Preview</H2>
247
248 <div id="my_categories"><xsl:text> </xsl:text></div>
249
250 <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe>
251
252 <xsl:variable name="preview">
253 <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
254 <div id="gs_content">
255 <!--
256 show the content of the page.
257 to customise this part, edit the xsl file for the page you want to edit
258 -->
259 <xsl:apply-templates select="/page"/>
260
261 </div>
262 </xsl:variable>
263
264 <script type="text/javascript">
265 preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
266 </script>
267
268 <div id="result">
269 Here
270 </div>
271
272 <div id="gs_footer">
273 <xsl:call-template name="poweredByGS3TextBar"/>
274 </div>
275
276 <div class="corner" id="cornerTopLeft"><xsl:text> </xsl:text></div>
277 <div class="corner" id="cornerTopRight"><xsl:text> </xsl:text></div>
278 <div class="corner" id="cornerBottomLeft"><xsl:text> </xsl:text></div>
279 <div class="corner" id="cornerBottomRight"><xsl:text> </xsl:text></div>
280
281 </div></div></div></div>
282
283 </body>
284 </html>
285 </xsl:template>
286
287</xsl:stylesheet>
288
289
Note: See TracBrowser for help on using the repository browser.