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, 13 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
RevLine 
[19856]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"
[23336]4
[19856]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"
[22516]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"
[22598]12 xmlns:exsl="http://exslt.org/common"
[22516]13
[22598]14 extension-element-prefixes="java util result exsl"
[19856]15 exclude-result-prefixes="util java util">
16
[22458]17 <xsl:include href="xml-to-gui.xsl"/>
[22598]18 <xsl:include href="xml-to-gui-templates.xsl"/>
[22458]19
[19988]20 <!-- put the URL or path of your site here site -->
21 <!-- eg 'http://www.example.com/mysite' or '/mysite' -->
[20380]22 <xsl:template name="siteURL"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteURL']"/></xsl:template>
[19856]23
[19988]24
[19856]25 <!-- the output format for this layout is html -->
[23336]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"/>
[19856]28
29 <!-- the main layout is defined here -->
30 <xsl:template match="/">
31
32 <html>
33
34 <head>
[19988]35 <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
[19856]36 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
[22569]37 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery.js"><xsl:text> </xsl:text></script> -->
[22676]38 <script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>
[22768]39 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8.2.custom.min.js"><xsl:text> </xsl:text></script> -->
[22829]40 <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/ui/jquery-ui.js"><xsl:text> </xsl:text></script>
[23135]41 <script type="text/javascript" src="interfaces/oran/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
[22933]42 <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"><xsl:text> </xsl:text></script> -->
[22516]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
[19856]46 <xsl:call-template name="berryBasketHeadTags"/>
47 </head>
48
[19988]49 <body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/>
[19856]50
[19988]51 <xsl:call-template name="displayErrorsIfAny"/>
52
[19856]53 <div id="container"><div id="container2"><div id="container3"><div id="container4">
54
[22783]55 <div id="gs_banner">
[19856]56
57 <!-- show the title -->
[19988]58 <div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
59 <h2><xsl:call-template name="pageTitle"/></h2>
[19856]60
[20404]61 <xsl:if test="/page/pageResponse/collection">
62 <!-- show home, help, preferences links -->
63 <ul id="bannerLinks">
[19856]64
[20404]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>
[19856]72
[20404]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>
[19856]80
[20404]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>
[19856]87
[20404]88 </ul>
89 </xsl:if>
[19856]90
91 <!-- show the available 'services' (browse, search, etc.) -->
92 <xsl:if test="/page/pageResponse/collection/serviceList/service">
93 <ul id="nav">
[20466]94 <!-- show browse service, if it exists -->
[20465]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>
[20466]100
101 <!-- show search services (collapsed) if they exist -->
[20465]102 <xsl:if test="/page/pageResponse/collection/serviceList/service[@type='query']">
[20466]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>
[20465]112 </xsl:for-each>
113 </xsl:if>
[20466]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
[19856]120 </ul>
121 </xsl:if>
122
123 </div>
124
[22458]125<!-- *************************************************************************************** -->
126
[23135]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
[22458]132<!-- Sam2's div code -->
133
[23336]134 <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
[22473]135 <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
[22516]136
[22598]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
[22458]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
[22516]154 <style type="text/css">
[23046]155 .placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
[22569]156
[23046]157 .placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
[22768]158
[23046]159 .header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px;}
160
[22569]161 .resizable { width: 150px; height: 150px; padding: 0.5em; }
[22598]162
[23046]163 .block { margin-left: 15px; border-left: dashed 1px black;}
[22569]164
[22676]165 .droppable { background-color: #99dd99;}
166 .droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
167
[22569]168 <!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
169
[22598]170 <!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
[22516]171 </style>
[22458]172
[22569]173 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
[22516]174
[22569]175 <table width="100%" border="1">
176
[22598]177 <td width="75%">
[22516]178
[23312]179 <button id="updateFormatStatement" type="button" onclick="createFormatStatement()">Update Format Statement</button>
180
[22516]181 <div id="formatStatement">
[23336]182 <div id="formatRoot">
183
[22458]184 <xsl:call-template name="xml-to-gui">
[23298]185 <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/> -->
[22458]186 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
187 </xsl:call-template>
[23336]188 </div>
[22473]189 </div>
[22516]190 </td>
[22473]191
[22569]192
[22598]193 <td width="25%" valign="top">
[22569]194 <h2> Elements to add </h2>
[23255]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
[23276]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>
[23255]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">
[23046]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>
[23255]204
[23135]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>
[23255]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>
[22569]219 <br/>
[23298]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>
[23276]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>
[22569]224
[22516]225 </td>
226 </table>
227
[23276]228 <!--
[23135]229 <div id="format">
[22458]230 <p>
231 <b>Format string here</b>
232 <i>
233 <xsl:value-of select="$fmt1"/>
234 </i>
235 </p>
[23276]236 </div> -->
[23135]237 <!-- <p>
[22458]238 <i>
239 <xsl:value-of select="$meta"/>
240 </i>
241 </p>
[23046]242 </div> -->
[23135]243 </xsl:if>
[22458]244
245<!-- *************************************************************************************** -->
[23276]246<H2>Preview</H2>
[23312]247
248 <div id="my_categories"><xsl:text> </xsl:text></div>
249
[23298]250 <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe>
[22458]251
[23298]252 <xsl:variable name="preview">
253 <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
[22783]254 <div id="gs_content">
[19856]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"/>
[19988]260
[19856]261 </div>
[23298]262 </xsl:variable>
[19856]263
[23298]264 <script type="text/javascript">
[23276]265 preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
[23298]266 </script>
[23276]267
[23333]268 <div id="result">
269 Here
270 </div>
271
[22783]272 <div id="gs_footer">
[19856]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.