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

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

Working on saving the format statement. Currently have a button that calls the system action and returns some html. Working on system.xsl but need to get the format string from String to XML. I have found out that HTML is not necessarily valid XML.

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