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

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