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

Revision 23255, 8.5 KB (checked in by sjb48, 9 years ago)
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        <xsl:variable name="metadata">
48        <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata">
49            <xsl:variable name="combo">
50                <xsl:call-template name="meta-to-combo">
51                        <xsl:with-param name="metadataSets" select="$metadataSets"/>
52                        <xsl:with-param name="current"/>
53                     </xsl:call-template>
54            </xsl:variable>
55        <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>
56        </div>
57       
58        </xsl:variable>
59
60        <script type="text/javascript">
61            gsf_metadata_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$metadata"/><xsl:text disable-output-escaping="yes">';</xsl:text>
62        </script>
63
64
65    <!-- ********** GSF:LINK ********** -->
66        <xsl:variable name="link">
67        <div class="gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
68                            <option value = "document" selected = "document">Document</option>
69                            <option value = "classifier">Classifier</option>
70                            <option value = "source">Source</option>
71                            <option value = "horizontal">Horizontal</option>
72                </select></td><td><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>
73        </xsl:variable>
74
75        <script type="text/javascript">
76            gsf_link_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$link"/><xsl:text disable-output-escaping="yes">';</xsl:text>   
77        </script>
78
79
80    <!-- ********** GSF:TEMPLATE ********** -->
81
82        <xsl:variable name="template">
83        <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><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/>
84        </xsl:variable>
85
86        <script type="text/javascript">
87            gsf_template_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$template"/><xsl:text disable-output-escaping="yes">';</xsl:text>     
88        </script>
89
90
91    <!-- ********** GSF:SWITCH ********** -->
92
93        <xsl:variable name="switch">
94        <div class="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>
95        </xsl:variable>
96
97        <script type="text/javascript">
98            gsf_switch_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$switch"/><xsl:text disable-output-escaping="yes">';</xsl:text>
99        </script>
100
101
102    <!-- ********** GSF:WHEN ********** -->
103
104        <xsl:variable name="when">
105        <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><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>
106        </xsl:variable>
107
108        <script type="text/javascript">
109            gsf_when_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$when"/><xsl:text disable-output-escaping="yes">';</xsl:text>
110        </script>
111
112    <!-- ********** GSF:OTHERWISE ********** -->
113
114        <xsl:variable name="otherwise">
115        <div class="gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise"><table class="header"><tbody><tr><td class="header">OTHERWISE</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>
116        </xsl:variable>
117
118        <script type="text/javascript">
119            gsf_otherwise_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$otherwise"/><xsl:text disable-output-escaping="yes">';</xsl:text>
120        </script>
121
122    <!-- ********** GSF:ICON ********** -->
123   
124        <xsl:variable name="icon">
125        <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><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
126        </xsl:variable>
127
128        <script type="text/javascript">
129            gsf_icon_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$icon"/><xsl:text disable-output-escaping="yes">';</xsl:text>
130        </script>
131    </xsl:template>
132
133</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.