root/trunk/deployment/webconfig/webapp/resources/default/default/default.xsl

Revision 2747 (checked in by johnsa, 3 years ago)

Update all XSLT
523: Add browser.resources.root option
http://www.bedework.org/trac/bedework/ticket/523

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3   version="1.0"
4   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5   xmlns="http://www.w3.org/1999/xhtml">
6   <!-- ==================================================================== -->
7   <!-- ==================================================================== -->
8   <!--                    BEDEWORK CONFIGURATION WEB APP                    -->
9   <!-- ==================================================================== -->
10   <!-- ==================================================================== -->
11   <xsl:output method="xml" indent="yes" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" standalone="yes" omit-xml-declaration="yes"/>
12   <xsl:variable name="resourcesRoot" select="/bedework/browserResourceRoot"/>
13   <xsl:variable name="urlPrefix" select="/bedework/urlPrefix"/>
14
15   <xsl:template match="/">
16     <html lang="en">
17       <head>
18         <title>Bedework Calendar Configuration Builder</title>
19         <link rel="stylesheet" type="text/css" media="screen,all" href="{$resourcesRoot}/default/default/bedeworkConfig.css"/>
20         <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
21         <script language="JavaScript" type="text/javascript">
22           <![CDATA[
23             function setPrevView() {
24               if (window.document.propsForm.setappvar.options.selectedIndex != 0) {
25                 window.document.propsForm.setappvar.options.selectedIndex -= 1;
26                 window.document.propsForm.submit();
27               }
28             }
29             function setNextView() {
30               if (window.document.propsForm.setappvar.options.selectedIndex != window.document.propsForm.setappvar.options.length-1) {
31                 window.document.propsForm.setappvar.options.selectedIndex += 1;
32                 window.document.propsForm.submit();
33               }
34             }
35             function showHelp(id) {
36               helpField = document.getElementById(id);
37               helpField.className="helpText";
38             }
39             function hideHelp(id) {
40               helpField = document.getElementById(id);
41               helpField.className="hidden";
42             }
43           ]]>
44         </script>
45       </head>
46       <body class="tundra">
47         <div id="bodyBlock">
48           <div id="header">
49             <h2 id="title">
50               <a href="/bedework"><img src="{$resourcesRoot}/images/bedework.gif" alt="Bedework Calendar" border="0"/></a>
51             </h2>
52             <div id="configLabel">
53               Bedework Calendar Configuration Builder
54             </div>
55           </div>
56           <xsl:if test="/bedework/message">
57             <div id="messages">
58               <xsl:apply-templates select="/bedework/message"/>
59             </div>
60           </xsl:if>
61           <xsl:if test="/bedework/error">
62             <div id="errors">
63               <xsl:apply-templates select="/bedework/error"/>
64             </div>
65           </xsl:if>
66           <div id="content">
67
68             <xsl:choose>
69               <xsl:when test="/bedework/page='main'">
70                 <xsl:call-template name="main"/>
71               </xsl:when>
72               <xsl:when test="/bedework/page='save'">
73                 <xsl:call-template name='save'/>
74               </xsl:when>
75               <xsl:otherwise>
76                 <xsl:apply-templates select="/bedework/propertyGroups/form/propertyGroup"/>
77               </xsl:otherwise>
78             </xsl:choose>
79
80           </div>
81           <div id="footer">
82             <p>
83               some footer text
84             </p>
85             <ul class="menu" id="footMenu">
86               <li class="first"><a href="/bedework">Bedework Quickstart Jump Page</a></li>
87               <li><a href="?noxslt=yes">Show XML</a></li>
88               <li><a href="?refreshXslt=yes">Refresh XSLT</a></li>
89             </ul>
90           </div>
91           <div id="subFoot">&#160;</div>
92         </div>
93       </body>
94     </html>
95   </xsl:template>
96
97   <xsl:template name="main">
98     <h1>BedeFig: Configure Bedework Properties</h1>
99     <p>
100       Welcome to the Bedework property configuration tool.  This
101       application allows you to review, modify, validate, and
102       save the properties used for building a Bedework
103       Calendar production-ready application.
104     </p>
105     <p>
106       Options are grouped into pages.  You can select any section
107       at any time by using the pull-down menu above, or you may
108       move from page to page by clicking the "next" button to the upper right.
109     </p>
110     <p>
111       When you have finished reviewing and modifying properties,
112       press "validate" to check your settings, and "save" to download
113       a properly-configured properties file which you can use to build
114       a production-ready version of the Bedework Calendar application.
115     </p>
116   </xsl:template>
117
118   <xsl:template name="save">
119     <form action="save.do" method="POST" enctype="multipart/form-data" name="downloadForm">
120       <input type="hidden" name="contentType" value="text/text"/>
121       <input type="hidden" name="contentName" value="myBedework.properties"/>
122       <input type="hidden" name="skinName" value="outputText"/>
123       <input type="hidden" name="refreshXslt" value="yes"/>
124       <ul id="buttonMenu">
125         <li><input type="submit" name="save" value="download file"/></li>
126         <li><a href="setup.do">return</a></li>
127       </ul>
128     </form>
129     <h1>Your Configured Properties File:</h1>
130     <div id="propFile">
131       <xsl:for-each select="/bedework/propertyGroups/propertyGroup">
132         #<br/>
133         # <xsl:value-of select="@name"/><br/>
134         #<br/>
135         <xsl:for-each select="property">
136           <xsl:value-of select="@name"/>=<xsl:value-of select="."/><br/>
137         </xsl:for-each>
138         <br/>
139       </xsl:for-each>
140     </div>
141   </xsl:template>
142
143   <xsl:template match="propertyGroup">
144     <xsl:variable name="groupName" select="@name"/>
145     <xsl:apply-templates select="@name" mode="groupHeading"/>
146     <table id="{$groupName}">
147       <xsl:apply-templates select="property[fieldName!='modules.advanced']"/>
148     </table>
149   </xsl:template>
150
151   <xsl:template match="property">
152     <xsl:variable name="propertyName" select="@name"/>
153     <xsl:variable name="fieldName" select="fieldName"/>
154     <xsl:variable name="fieldValue" select="fieldValue"/>
155     <tr id="{$propertyName}">
156       <td><xsl:apply-templates select="fieldName" mode="label"/></td>
157       <td>
158         <xsl:choose>
159           <xsl:when test="@type='0'"><!-- text input (string) -->
160             <input type="text" name="{$fieldName}" size="50" value="{$fieldValue}" class="string"/>
161           </xsl:when>
162           <xsl:when test="@type='1'"><!-- text input (int) -->
163             <input type="text" name="{$fieldName}" size="40" value="{$fieldValue}" class="int"/>
164           </xsl:when>
165           <xsl:when test="@type='2'"><!-- intended as checkbox (boolean)
166             but we're going to implement as radio buttons so we can always
167             send an explicit value -->
168             <xsl:choose>
169               <xsl:when test="fieldValue='true'">
170                 <xsl:choose>
171                   <xsl:when test="contains($fieldName,'modules.')">
172                     <input type="radio" name="{$fieldName}" value="true" checked="checked" onclick="submit()"/> yes
173                     <input type="radio" name="{$fieldName}" value="false" onclick="submit()"/> no
174                   </xsl:when>
175                   <xsl:otherwise>
176                     <input type="radio" name="{$fieldName}" value="true" checked="checked"/> yes
177                     <input type="radio" name="{$fieldName}" value="false"/> no
178                   </xsl:otherwise>
179                 </xsl:choose>
180               </xsl:when>
181               <xsl:otherwise>
182                 <xsl:choose>
183                   <xsl:when test="contains($fieldName,'modules.')">
184                     <input type="radio" name="{$fieldName}" value="true" onclick="submit()"/> yes
185                     <input type="radio" name="{$fieldName}" value="false" checked="checked" onclick="submit()"/> no
186                   </xsl:when>
187                   <xsl:otherwise>
188                     <input type="radio" name="{$fieldName}" value="true"/> yes
189                     <input type="radio" name="{$fieldName}" value="false" checked="checked"/> no
190                   </xsl:otherwise>
191                 </xsl:choose>
192               </xsl:otherwise>
193             </xsl:choose>
194           </xsl:when>
195           <xsl:when test="@type='3'"><!-- radio input (choice) -->
196             not supported yet (in the xsl)
197           </xsl:when>
198           <xsl:when test="@type='4'"><!-- multi input (checkbox of same name or multi-select box) -->
199             not supported yet (in the xsl)
200           </xsl:when>
201         </xsl:choose>
202         <xsl:apply-templates select="fieldName" mode="help"/>
203       </td>
204     </tr>
205   </xsl:template>
206
207   <xsl:template match="@name" mode="groupHeading">
208     <xsl:choose>
209       <xsl:when test=".='modules'">
210         <h1>Select Modules</h1>
211         <p>Select the Bedework modules you wish to build:</p>
212       </xsl:when>
213       <xsl:when test=".='globals'">
214         <h1>Global Settings</h1>
215       </xsl:when>
216       <xsl:when test=".='Webadmin'">
217         <h1>Administration Web Client Settings</h1>
218       </xsl:when>
219       <xsl:when test=".='webpublic'">
220         <h1>Public Web Client Settings</h1>
221       </xsl:when>
222       <xsl:when test=".='webpersonal'">
223         <h1>Personal Web Client Settings</h1>
224       </xsl:when>
225       <xsl:when test=".='calDAV-public'">
226         <h1>Public CalDAV Server Settings</h1>
227       </xsl:when>
228       <xsl:when test=".='calDAV-personal'">
229         <h1>Personal CalDAV Server Settings</h1>
230       </xsl:when>
231     </xsl:choose>
232   </xsl:template>
233
234   <xsl:template match="fieldName" mode="label">
235     <xsl:choose>
236       <xsl:when test=".='modules.adminwebclient'">
237         Public events administration web client
238       </xsl:when>
239       <xsl:when test=".='modules.publicwebclient'">
240         Public events web client
241       </xsl:when>
242       <xsl:when test=".='modules.personalwebclient'">
243         Personal events web client
244       </xsl:when>
245       <xsl:when test=".='modules.publiccaldav'">
246         Public events CalDAV server
247       </xsl:when>
248       <xsl:when test=".='modules.personalcaldav'">
249         Personal events CalDAV server
250       </xsl:when>
251       <xsl:when test=".='modules.advanced'">
252         Use advanced interface
253       </xsl:when>
254       <xsl:otherwise>
255         <xsl:value-of select="."/>
256       </xsl:otherwise>
257     </xsl:choose>
258   </xsl:template>
259
260   <xsl:template match="fieldName" mode="help">
261     <xsl:variable name="fieldId">help<xsl:value-of select="translate(.,'.','')"/></xsl:variable>
262     <span class="help">
263     <xsl:choose>
264       <xsl:when test=".='modules.adminwebclient'">
265         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
266         <div id="{$fieldId}" class="hidden">
267           help for Public events administration web client
268         </div>
269       </xsl:when>
270       <xsl:when test=".='modules.publicwebclient'">
271         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
272         <div id="{$fieldId}" class="hidden">
273           help for Public events web client
274         </div>
275       </xsl:when>
276       <xsl:when test=".='modules.personalwebclient'">
277         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
278         <div id="{$fieldId}" class="hidden">
279           help for Personal events web client
280         </div>
281       </xsl:when>
282       <xsl:when test=".='modules.publiccaldav'">
283         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
284         <div id="{$fieldId}" class="hidden">
285           help for Public events CalDAV server
286         </div>
287       </xsl:when>
288       <xsl:when test=".='modules.personalcaldav'">
289         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
290         <div id="{$fieldId}" class="hidden">
291           help for Personal events CalDAV server
292         </div>
293       </xsl:when>
294       <xsl:when test=".='modules.advanced'">
295         <a href="" onmouseover="showHelp('{$fieldId}')" onmouseout="hideHelp('{$fieldId}')">?</a>
296         <div id="{$fieldId}" class="hidden">
297           help for Use advanced interface
298         </div>
299       </xsl:when>
300     </xsl:choose>
301     </span>
302   </xsl:template>
303
304   <xsl:template match="message">
305     <xsl:choose>
306       <xsl:when test="id = 'org.bedework.config.error.missingvalue'">
307         <p>placeholder.</p>
308       </xsl:when>
309       <xsl:otherwise>
310         <xsl:value-of select="id"/>
311         <xsl:if test="param"> =
312           <xsl:for-each select="param">
313             <xsl:value-of select="."/>
314           </xsl:for-each>
315         </xsl:if>
316       </xsl:otherwise>
317     </xsl:choose>
318   </xsl:template>
319
320   <xsl:template match="error">
321     <xsl:choose>
322       <xsl:when test="id = 'org.bedework.config.error.missingvalue'">
323         <p>Property<xsl:text> </xsl:text>
324         (<xsl:for-each select="param">
325             <xsl:value-of select="."/><xsl:text> </xsl:text>
326           </xsl:for-each>)
327         is missing.</p>
328       </xsl:when>
329       <xsl:otherwise>
330         <p><xsl:value-of select="id"/>
331         <xsl:if test="param"><xsl:text>: </xsl:text>
332           <xsl:for-each select="param">
333             <xsl:value-of select="."/><xsl:text> </xsl:text>
334           </xsl:for-each>
335         </xsl:if></p>
336       </xsl:otherwise>
337     </xsl:choose>
338   </xsl:template>
339 </xsl:stylesheet>
340
341
342
343
Note: See TracBrowser for help on using the browser.