root/main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui-templates.xsl @ 24907

Revision 24907, 9.5 KB (checked in by sjb48, 8 years ago)

Tidied up format functionality.

Line 
1<!--
2Copyright (c) 2001-2009, Evan Lenz
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
7    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9    * Neither the name of Lenz Consulting Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
11        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
13Recent changes:
14
152010-06-10: Added the $force-exclude-all-namespaces parameter
162009-10-19: Added the $exclude-these-namespaces parameter
172009-10-08: Added $att-value parameter and template name to template rule for attributes.
18
19-->
20<xsl:stylesheet version="1.0"
21    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
23    xmlns:exsl="http://exslt.org/common"
24    extension-element-prefixes="exsl" >
25
26    <xsl:output omit-xml-declaration="yes"/>
27
28    <xsl:template name="xml-to-gui-templates">
29        <xsl:param name="node-set" select="."/>
30        <xsl:param name="metadataSets" select="."/>
31    <!-- **************************************************************************** -->
32    <!-- GSF STATEMENTS                                                               -->
33    <!-- **************************************************************************** -->
34
35   
36    <!-- ********** GSF:CHOOSE-METADATA ********** -->
37        <xsl:variable name="choose_metadata">
38            <div class="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>
39        </xsl:variable>
40
41        <script type="text/javascript">
42            gsf_choose_metadata_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$choose_metadata"/><xsl:text disable-output-escaping="yes">';</xsl:text>   
43        </script>   
44
45
46    <!-- ********** GSF:METADATA ********** -->
47    <!-- This element is now created on-the-fly in javascript -->
48    <!--   
49        <xsl:variable name="metadata">
50        <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata">
51            <xsl:variable name="combo">
52                <xsl:call-template name="meta-to-combo">
53                        <xsl:with-param name="metadataSets" select="$metadataSets"/>
54                        <xsl:with-param name="current"/>
55                     </xsl:call-template>
56            </xsl:variable>
57        <table class="header"><tbody><tr><td class="header"><xsl:copy-of select="$combo"/></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
58        </div>
59       
60        </xsl:variable>
61
62        <script type="text/javascript">
63            gsf_metadata_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$metadata"/><xsl:text disable-output-escaping="yes">';</xsl:text>
64        </script>
65   -->
66
67    <!-- ********** GSF:LINK ********** -->
68        <xsl:variable name="link">
69        <div class="gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
70                            <option value = "document" selected = "document">Document</option>
71                            <option value = "classifier">Classifier</option>
72                            <option value = "source">Source</option>
73                            <option value = "horizontal">Horizontal</option>
74                </select></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
75        </xsl:variable>
76
77        <script type="text/javascript">
78            gsf_link_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$link"/><xsl:text disable-output-escaping="yes">';</xsl:text>   
79        </script>
80
81
82    <!-- ********** GSF:TEMPLATE ********** -->
83
84        <xsl:variable name="template">
85        <div class="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 class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><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/>
86        </xsl:variable>
87
88        <script type="text/javascript">
89            gsf_template_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$template"/><xsl:text disable-output-escaping="yes">';</xsl:text>     
90        </script>
91
92
93    <!-- ********** GSF:SWITCH ********** -->
94
95        <xsl:variable name="switch">
96        <div class="gsf_switch css_gsf_switch block" title="gsf:switch"><table class="header"><tbody><tr><td class="header">SWITCH</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
97        </xsl:variable>
98
99        <script type="text/javascript">
100            gsf_switch_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$switch"/><xsl:text disable-output-escaping="yes">';</xsl:text>
101        </script>
102
103
104    <!-- ********** GSF:WHEN ********** -->
105
106        <xsl:variable name="when">
107        <div class="gsf_when css_gsf_when block" title="gsf:when"><table class="header"><tbody><tr><td class="header">WHEN<input type="text" name="rawtextinput" size="10"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
108        </xsl:variable>
109
110        <script type="text/javascript">
111            gsf_when_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$when"/><xsl:text disable-output-escaping="yes">';</xsl:text>
112        </script>
113
114    <!-- ********** GSF:OTHERWISE ********** -->
115
116        <xsl:variable name="otherwise">
117        <div class="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 class="header"><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
118        </xsl:variable>
119
120        <script type="text/javascript">
121            gsf_otherwise_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$otherwise"/><xsl:text disable-output-escaping="yes">';</xsl:text>
122        </script>
123
124    <!-- ********** GSF:ICON ********** -->
125   
126        <xsl:variable name="icon">
127        <div class="gsf_icon css_gsf_icon block leaf" 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 class="header"><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
128        </xsl:variable>
129
130        <script type="text/javascript">
131            gsf_icon_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$icon"/><xsl:text disable-output-escaping="yes">';</xsl:text>
132        </script>
133
134    <!-- ******** TEXT ************ -->
135
136        <xsl:variable name="text">
137        <div class="block leaf gsf_text" title="gsf:text">
138                <xsl:variable name="rawtext"><xsl:value-of select="."/></xsl:variable>
139                <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>
140        </div>
141        </xsl:variable>
142
143        <script type="text/javascript">
144            gsf_text_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$text"/><xsl:text disable-output-escaping="yes">';</xsl:text>
145        </script>
146
147    </xsl:template>
148
149</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.