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

Last change on this file since 24417 was 24417, checked in by sjm84, 13 years ago

Tidied up the format manager and removed the need for a separate format servlet

File size: 16.5 KB
RevLine 
[24139]1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:java="http://xml.apache.org/xslt/java"
4 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
5 xmlns:gslib="http://www.greenstone.org/skinning"
[24243]6 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
[24139]7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <xsl:include href="xml-to-gui.xsl"/>
11 <xsl:include href="xml-to-gui-templates.xsl"/>
12
13 <xsl:template name="formatmanagerpre">
14
15 <!-- <xsl:variable name="foo"> -->
16 <!-- <xsl:value-of select="/page/pageRequest/paramList[@name='formatedit']"/> -->
17
18 <!--<xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='1')]">-->
19
20 <!-- Sam2's div code -->
21
[24202]22 <script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>
23 <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/ui/jquery-ui.js"><xsl:text> </xsl:text></script>
24 <script type="text/javascript" src="interfaces/oran/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
[24139]25 <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
[24202]26 <script type="text/javascript" src="interfaces/oran/js/jquery.xml.js"><xsl:text> </xsl:text></script>
[24139]27 <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
28
29 <xsl:call-template name="xml-to-gui-templates">
30 <xsl:with-param name="node-set" select="test"/>
31 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
32 </xsl:call-template>
33
34 <xsl:variable name="fmt1">
35 <xsl:call-template name="xml-to-string">
36 <xsl:with-param name="node-set" select="//format[@type='browse']"/>
37 </xsl:call-template>
38 </xsl:variable>
39
40 <xsl:variable name="meta">
41 <xsl:call-template name="xml-to-string">
42 <xsl:with-param name="node-set" select="//metadataSetList"/>
43 </xsl:call-template>
44 </xsl:variable>
45
46 <style type="text/css">
[24417]47
[24139]48 .placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
49
50 .placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
51
52 .header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px;}
53
54 .resizable { width: 150px; height: 150px; padding: 0.5em; }
55
[24417]56 .indent { margin-left: 15px; }
[24139]57 .block { margin-left: 15px; border-left: dashed 1px black;}
58
59 .droppable { background-color: #99dd99;}
60 .droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
61
[24202]62 #XSLTcode {width: 99%; }
63
[24417]64 .elementToolBox {position: fixed; top: 25%; right: 0px; background: white; border: 2px solid; padding: 10px 10px 10px 0px;}
65
66 .elementToolBoxHeader { font-weight:bold; }
67
[24243]68 .visible {display: block;}
69 .hidden {display: none;}
[24139]70 <!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
71
72 <!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
73 </style>
74
75 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
76
[24202]77
78
[24139]79 <table width="100%" border="1">
80
[24202]81 <td width="100%">
82 <xsl:choose>
83 <xsl:when test="/page/pageRequest/@action = 'd'">
84 <!-- TOC on or off -->
85 <xsl:choose>
[24243]86 <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
[24202]87 <input type="checkbox" name="TOC" checked="checked" onclick="displayTOC(this)">Display Table of Contents (set to true)</input>
88 </xsl:when>
89 <xsl:otherwise>
90 <input type="checkbox" name="TOC" onclick="displayTOC(this)">Display Table of Contents (set to false)</input>
91 </xsl:otherwise>
92 </xsl:choose> <br/>
[24139]93
[24202]94 <!-- book cover image on or off -->
95 <xsl:choose>
[24243]96 <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">
[24202]97 <input type="checkbox" name="bookCover" checked="checked" onclick="displayBookCover(this)">Display Book Cover Image (set to true)</input>
98 </xsl:when>
99 <xsl:otherwise>
100 <input type="checkbox" name="bookCover" onclick="displayBookCover(this)">Display Book Cover Image (set to false)</input>
101 </xsl:otherwise>
102 </xsl:choose> <br/>
[24139]103
[24202]104 <textarea id="XSLTcode" rows="5">
105 The XSLT code for the relevant part of the page will be displayed here.
106 </textarea>
107 <!-- What are we doing? It might be possible to tweak saveFormatStatement() if we are only dealing with format stuff but are we? -->
108 <br/>
109 <table>
110 <td>
111 <button id="saveDocumentChanges" type="button" onclick="saveDocumentChanges()">Save Changes</button>
112 </td>
113 <td>
114 <form>
115 <input name="documentChanges" type="radio" id="applyToDocument" value="document" checked="true"/>Apply to this document only
116 <input name="documentChanges" type="radio" id="applyToCollection" value="collection" />Apply to collection
117 </form>
118 </td>
119 </table>
120 </xsl:when>
121 <xsl:otherwise>
122 <table>
123 <td>
124 <button id="updateFormatStatement" type="button" onclick="updateFormatStatement()">Update Format Statement</button>
125 </td>
126 <td>
127 <button id="saveFormatStatement" type="button" onclick="saveFormatStatement()">Save Format Statement</button>
128 </td>
129 <td>
130 <form>
131 <input name="classifiers" type="radio" id="applyToThis" value="this" checked="true"/>This Classifier
132 <input name="classifiers" type="radio" id="applyToAll" value="all" />All Classifiers
133 </form>
134 </td>
135 </table>
[24139]136
[24202]137 <div id="formatStatement">
138 <div id="formatRoot">
139 <xsl:call-template name="xml-to-gui">
140 <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/> -->
141 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
142 </xsl:call-template>
143 </div>
144 </div>
145 </xsl:otherwise>
146 </xsl:choose>
147 </td>
148 </table>
[24139]149
[24202]150 <div class="elementToolBox">
[24417]151 <p class="indent elementToolBoxHeader">Elements to add</p>
[24139]152 <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
153 <div class="draggable_gsf_template css_gsf_template block" title="gsf:template">
154 <table class="header">
155 <tbody>
156 <tr>
157 <td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td>
[24417]158 <!--<td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
159 <td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td>-->
[24139]160 </tr>
161 </tbody>
162 </table>
163 </div>
164
165 <div class="draggable_gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata">
166 <table class="header">
167 <tbody>
168 <tr>
169 <td class="header">CHOOSE</td>
[24417]170 <!--<td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td>
171 <td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td>-->
[24139]172 </tr>
173 </tbody>
174 </table>
175 </div>
176
177 <div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata">
178 <table class="header">
179 <tbody>
180 <tr>
[24417]181 <td class="header" id="metadataSelector">
182 <!--<xsl:call-template name="meta-to-combo">
[24139]183 <xsl:with-param name="metadataSets" select="//metadataSetList"/>
184 <xsl:with-param name="current" select="ex.Title"/>
[24417]185 </xsl:call-template>-->
[24139]186 </td>
[24417]187 <!--<td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td>-->
[24139]188 </tr>
189 </tbody>
190 </table>
191 </div>
192
193 <div class="draggable_gsf_link css_gsf_link block" title="gsf:link">
194 <table class="header">
195 <tbody>
196 <tr>
197 <td class="header">LINK<select>
198 <option value = "document" selected = "document">Document</option>
199 <option value = "classifier">Classifier</option>
200 <option value = "source">Source</option>
201 <option value = "horizontal">Horizontal</option>
202 </select></td>
[24417]203 <!--<td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
204 <td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td>-->
[24139]205 </tr>
206 </tbody>
207 </table>
208 </div>
209
210 <div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch">
211 <table class="header">
212 <tbody>
213 <tr>
214 <td class="header">SWITCH</td>
[24417]215 <!--<td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
216 <td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td>-->
[24139]217 </tr>
218 </tbody>
219 </table>
220 </div>
221
222 <div class="draggable_gsf_when css_gsf_when block" title="gsf:when">
223 <table class="header">
224 <tbody>
225 <tr>
226 <td class="header">WHEN<xsl:value-of select="@test"/></td>
[24417]227 <!--<td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
228 <td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td>-->
[24139]229 </tr>
230 </tbody>
231 </table>
232 </div>
233
234 <div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise">
235 <table class="header">
236 <tbody>
237 <tr>
238 <td class="header">OTHERWISE</td>
[24417]239 <!--<td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
240 <td><a href="#" class="ui-icon ui-icon-closethick"/></td>-->
[24139]241 </tr>
242 </tbody>
243 </table>
244 </div>
245
246 <div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon">
247 <table class="header">
248 <tbody>
249 <tr>
250 <td class="header">ICON<select>
[24417]251 <option value="document" selected="document">Document</option>
252 <option value="classifier">Classifier</option>
253 <option value="source">Source</option>
[24139]254 </select></td>
[24417]255 <!--<td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td>-->
[24139]256 </tr>
257 </tbody>
258 </table>
259 </div>
[24417]260 <div class="draggable_gsf_text css_text block" title="text">
[24139]261 <table class="header">
262 <tbody>
263 <tr>
264 <td class="header"><input type="text" name="rawtextinput" size="10" value=""/></td>
[24417]265 <!--<td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td>-->
[24139]266 </tr>
267 </tbody>
268 </table>
269 </div>
[24417]270 <div class="draggable_table css_table block" title="gsf:table">
271 <table class="header">
272 <tbody>
273 <tr>
274 <td class="header">NEW TABLE</td>
275 </tr>
276 </tbody>
277 </table>
278 </div>
279 <div class="draggable_tr css_tr block" title="gsf:table">
280 <table class="header">
281 <tbody>
282 <tr>
283 <td class="header">NEW TABLE ROW</td>
284 </tr>
285 </tbody>
286 </table>
287 </div>
288 <div class="draggable_td css_td block" title="gsf:table">
289 <table class="header">
290 <tbody>
291 <tr>
292 <td class="header">NEW TABLE COLUMN</td>
293 </tr>
294 </tbody>
295 </table>
296 </div>
[24202]297 </div>
[24139]298
299 <!--
300 <div id="format">
301 <p>
302 <b>Format string here</b>
303 <i>
304 <xsl:value-of select="$fmt1"/>
305 </i>
306 </p>
307 </div> -->
308 <!-- <p>
309 <i>
310 <xsl:value-of select="$meta"/>
311 </i>
312 </p>
313 </div> -->
314 <!--</xsl:if>-->
315
316 <!--<H2>Preview</H2>
317
318 <div id="my_categories"><xsl:text> </xsl:text></div>
319
320 <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe>
321
322 <xsl:variable name="preview"> -->
323 <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
324 </xsl:template>
325
326 <xsl:template name="formatmanagerpost">
327 <!-- </xsl:variable>
328
329 <script type="text/javascript">
330 preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
331 </script>
332
333 <div id="result">
334 Here
335 </div>-->
336 </xsl:template>
337</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.