root/trunk/calendar3/deployment/freebusyAggregator/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 695 (checked in by johnsa, 7 years ago)

added some front page information to freebusy aggregator

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output
4   method="html"
5   indent="yes"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/html4/loose.dtd"
9   standalone="yes"
10 />
11   <!-- ========================================= -->
12   <!--       BEDEWORK FREEBUSY AGGREGATOR        -->
13   <!-- ========================================= -->
14
15   <!-- **********************************************************************
16     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
17
18     Redistribution and use of this distribution in source and binary forms,
19     with or without modification, are permitted provided that:
20        The above copyright notice and this permission notice appear in all
21         copies and supporting documentation;
22
23         The name, identifiers, and trademarks of Rensselaer Polytechnic
24         Institute are not used in advertising or publicity without the
25         express prior written permission of Rensselaer Polytechnic Institute;
26
27     DISCLAIMER: The software is distributed" AS IS" without any express or
28     implied warranty, including but not limited to, any implied warranties
29     of merchantability or fitness for a particular purpose or any warrant)'
30     of non-infringement of any current or pending patent rights. The authors
31     of the software make no representations about the suitability of this
32     software for any particular purpose. The entire risk as to the quality
33     and performance of the software is with the user. Should the software
34     prove defective, the user assumes the cost of all necessary servicing,
35     repair or correction. In particular, neither Rensselaer Polytechnic
36     Institute, nor the authors of the software are liable for any indirect,
37     special, consequential, or incidental damages related to the software,
38     to the maximum extent the law permits. -->
39
40   <!-- DEFINE INCLUDES -->
41   <xsl:include href="errors.xsl"/>
42   <xsl:include href="messages.xsl"/>
43
44   <!-- DEFINE GLOBAL CONSTANTS -->
45   <!-- URL of html resources (images, css, other html); by default this is
46        set to the application root, but for the personal calendar
47        this should be changed to point to a
48        web server over https to avoid mixed content errors, e.g.,
49   <xsl:variable name="resourcesRoot">https://mywebserver.edu/myresourcesdir</xsl:variable>
50     -->
51   <xsl:variable name="resourcesRoot" select="/bedework-fbaggregator/approot"/>
52
53   <!-- URL of the XSL template directory -->
54   <!-- The approot is an appropriate place to put
55        included stylesheets and xml fragments. These are generally
56        referenced relatively (like errors.xsl and messages.xsl above);
57        this variable is here for your convenience if you choose to
58        reference it explicitly.  It is not used in this stylesheet, however,
59        and can be safely removed if you so choose. -->
60   <xsl:variable name="appRoot" select="/bedework-fbaggregator/approot"/>
61
62   <!-- Properly encoded prefixes to the application actions; use these to build
63        urls; allows the application to be used without cookies or within a portal.
64        These urls are rewritten in header.jsp and simply passed through for use
65        here. Every url includes a query string (either ?b=de or a real query
66        string) so that all links constructed in this stylesheet may begin the
67        query string with an ampersand. -->
68   <xsl:variable name="setup" select="/bedework-fbaggregator/urlPrefixes/setup"/>
69   <xsl:variable name="initialise" select="/bedework-fbaggregator/urlPrefixes/initialise"/>
70   <xsl:variable name="fetchFreeBusy" select="/bedework-fbaggregator/urlPrefixes/fetchFreeBusy"/>
71   <xsl:variable name="addUser" select="/bedework-fbaggregator/urlPrefixes/addUser"/>
72   <xsl:variable name="getTimeZones" select="/bedework-fbaggregator/urlPrefixes/getTimeZones"/>
73
74
75   <!-- URL of the web application - includes web context
76   <xsl:variable name="urlPrefix" select="/bedework-fbaggregator/urlprefix"/> -->
77
78   <!-- Other generally useful global variables
79   <xsl:variable name="prevdate" select="/bedework-fbaggregator/previousdate"/>
80   <xsl:variable name="nextdate" select="/bedework-fbaggregator/nextdate"/>
81   <xsl:variable name="curdate" select="/bedework-fbaggregator/currentdate/date"/>
82   <xsl:variable name="skin">default</xsl:variable>
83   <xsl:variable name="publicCal">/cal</xsl:variable>-->
84
85
86  <!-- BEGIN MAIN TEMPLATE -->
87   <xsl:template match="/">
88     <html lang="en">
89       <head>
90         <title>CalConnect Boeing CalDav Freebusy Aggregator</title>
91         <meta name="robots" content="noindex,nofollow"/>
92         <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css" media="screen,all"/>
93         <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
94         <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
95         <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
96         <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
97       </head>
98       <body>
99         <xsl:call-template name="headBar"/>
100         <xsl:if test="/bedework-fbaggregator/message">
101           <div id="messages">
102             <xsl:apply-templates select="/bedework-fbaggregator/message"/>
103           </div>
104         </xsl:if>
105         <xsl:if test="/bedework-fbaggregator/error">
106           <div id="errors">
107             <xsl:apply-templates select="/bedework-fbaggregator/error"/>
108           </div>
109         </xsl:if>
110         <table id="bodyBlock" cellspacing="0">
111           <tr>
112             <td id="fbForm">
113               <xsl:call-template name="fbForm"/>
114             </td>
115             <td id="bodyContent">
116               <xsl:choose>
117                 <xsl:when test="/bedework-fbaggregator/page='freeBusy'">
118                   <xsl:apply-templates select="/bedework-fbaggregator/freebusy"/>
119                 </xsl:when>
120                 <xsl:when test="/bedework-fbaggregator/page='timeZones'">
121                   <xsl:apply-templates select="/bedework-fbaggregator/timezones"/>
122                 </xsl:when>
123                 <xsl:otherwise>
124                   <!-- otherwise, show main -->
125                   <div id="frontPage">
126                     <p>
127                       <a href="http://www.calconnect.org">
128                         <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/calconnect.gif" width="175" height="67" alt="calconnect" border="0"/>
129                       </a>
130                       <a href="http://www.boeing.com">
131                         <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/boeing.gif" width="100" height="67" alt="calconnect" border="0"/>
132                       </a>
133                     </p>
134                     <h2>CalDAV Freebusy Aggregator</h2>
135                     <p>To begin, enter a date range on the left and click "aggregate".</p>
136                   </div>
137                 </xsl:otherwise>
138               </xsl:choose>
139             </td>
140             <td id="logos">
141               <h4>participants</h4>
142               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/fbagg-logos.gif" width="100" height="403" alt="participant logos" usemap="#logoMap" border="0"/>
143               <map name="logoMap">
144                 <area shape="rect" alt="Timebridge" coords="0,340,100,380" href="http://www.timebridge.com/"/>
145                 <area shape="rect" alt="OSAF" coords="0,260,100,302" href="http://www.osafoundation.org/"/>
146                 <area shape="rect" alt="Oracle" coords="0,187,100,225" href="http://www.oracle.com"/>
147                 <area shape="rect" alt="Boeing" coords="0,101,100,153" href="http://www.boeing.com/"/>
148                 <area shape="rect" alt="Bedework" coords="0,13,100,77" href="http://www.bedework.org/bedework/"/>
149               </map>
150             </td>
151           </tr>
152         </table>
153         <!-- footer -->
154         <div id="footer">
155           <a href="/fbagg/getFreeBusy.do?all=true&amp;startdt=20060703&amp;enddt=20060710&amp;refreshXslt=yes">Refresh Freebusy Aggregator</a>
156         </div>
157       </body>
158     </html>
159   </xsl:template>
160
161   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
162
163   <xsl:template name="headBar">
164     <div id="headBar">
165       <h1>CALCONNECT BOEING CALDAV FREEBUSY AGGREGATOR</h1>
166       <!--<h1>Calconnect Boeing CalDav Freebusy Aggregator</h1>-->
167     </div>
168     <div id="menuBar">
169       <a href="{$setup}">Display Freebusy</a> |
170       <a href="">User Management</a>
171     </div>
172   </xsl:template>
173
174   <xsl:template name="fbForm">
175     <xsl:variable name="startdt" select="substring(/bedework-fbaggregator/freebusy/start,1,8)"/>
176     <xsl:variable name="enddt" select="substring(/bedework-fbaggregator/freebusy/end,1,8)"/>
177     <h4>aggregation</h4>
178     <form
179        name="freebusyForm"
180        method="post"
181        action="{$fetchFreeBusy}"
182        enctype="multipart/form-data"
183        id="freebusyForm">
184       <input type="hidden" name="all" value="true"/>
185       <p>
186         Start date:<br/>
187         <input
188          type="text"
189          name="startdt"
190          size="8"
191          value="" />
192         <span class="calWidget">
193           <script language="JavaScript" type="text/javascript">
194             startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');
195           </script>
196         </span>
197       </p>
198       <p>
199         End date:<br/>
200         <input
201          type="text"
202          name="enddt"
203          size="8"
204          value="" />
205         <span class="calWidget">
206           <script language="JavaScript" type="text/javascript">
207             endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');
208           </script>
209         </span><!--<br />
210         <em>yyyymmdd</em>-->
211       </p>
212        <p class="padTop center">
213          <input type="submit" value="aggregate"/>
214        </p>
215        <!--<input type="reset" value="reset"/>-->
216      </form>
217
218      <h4>users</h4>
219      <p class="center">
220       Add user/group:<br/>
221       <input
222        type="text"
223        name="user"
224        size="12"
225        value="" /><br/>
226        <input type="radio" value="user" name="kind" checked="checked"/>user
227       <input type="radio" value="group" name="kind"/>group
228      </p>
229      <table id="users">
230        <tr>
231           <td>
232             <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
233           </td>
234           <td>
235             <a href="{$fetchFreeBusy}&amp;account=douglm&amp;startdt={$startdt}&amp;enddt={$enddt}" title="fetch douglm's freebusy">douglm</a>
236           </td>
237           <td>
238             <xsl:variable name="acct" select="account"/>
239               <!--<a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=user" title="remove">-->
240                 <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
241               <!--</a>-->
242           </td>
243         </tr>
244         <tr>
245           <td>
246             <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
247           </td>
248           <td>
249             <a href="{$fetchFreeBusy}&amp;account=johnsa&amp;startdt={$startdt}&amp;enddt={$enddt}" title="fetch johnsa's freebusy">johnsa</a>
250           </td>
251           <td>
252             <xsl:variable name="acct" select="account"/>
253               <!--<a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=user" title="remove">-->
254                 <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
255               <!--</a>-->
256           </td>
257         </tr>
258       <!--<xsl:for-each select="/bedeworkadmin/adminGroup/members/member">
259         <xsl:choose>
260           <xsl:when test="kind='0'">--><!-- kind = user -->
261             <!--<tr>
262               <td>
263                 <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
264               </td>
265               <td>
266                 <xsl:value-of select="account"/>
267               </td>
268               <td>
269                 <xsl:variable name="acct" select="account"/>
270                   <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=user" title="remove">
271                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
272                   </a>
273               </td>
274             </tr>
275           </xsl:when>
276           <xsl:otherwise>--><!-- kind = group -->
277             <!--<tr>
278               <td>
279                 <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
280               </td>
281               <td>
282                 <strong><xsl:value-of select="account"/></strong>
283               </td>
284               <td>
285                 <xsl:variable name="acct" select="account"/>
286                 <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=group" title="remove">
287                   <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
288                 </a>
289               </td>
290             </tr>
291           </xsl:otherwise>
292         </xsl:choose>
293       </xsl:for-each> -->
294     </table>
295   </xsl:template>
296
297   <xsl:template name="utilBar">
298     <!-- refresh button -->
299     <a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
300   </xsl:template>
301
302   <!--+++++++++++++++ Free / Busy ++++++++++++++++++++-->
303   <xsl:template match="freebusy">
304     <xsl:variable name="startDate">
305       <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="substring(start,5,2)"/>-<xsl:value-of select="substring(start,7,2)"/>
306     </xsl:variable>
307     <xsl:variable name="endDate">
308       <xsl:value-of select="substring(end,1,4)"/>-<xsl:value-of select="substring(end,5,2)"/>-<xsl:value-of select="substring(end,7,2)"/>
309     </xsl:variable>
310     <h2>Freebusy Aggregator</h2>
311     <table id="freeBusy">
312       <tr>
313         <th colspan="16" class="">
314           All aggregated
315         </th>
316         <th colspan="16">
317           <xsl:value-of select="$startDate"/> to <xsl:value-of select="$endDate"/>
318         </th>
319         <th colspan="16">
320           America/New_York [<a href="{$getTimeZones}">change</a>]
321         </th>
322       </tr>
323       <tr>
324         <td>&#160;</td>
325         <td colspan="24" class="morning">AM</td>
326         <td colspan="24" class="evening">PM</td>
327       </tr>
328       <tr>
329         <td>&#160;</td>
330         <xsl:for-each select="day[position()=1]/period">
331           <td class="timeLabels">
332             <xsl:choose>
333               <xsl:when test="number(start) mod 200 = 0">
334                 <xsl:apply-templates select="start" mode="timeDisplay"/>
335               </xsl:when>
336               <xsl:otherwise>
337                 &#160;
338               </xsl:otherwise>
339             </xsl:choose>
340           </td>
341         </xsl:for-each>
342       </tr>
343       <xsl:for-each select="day">
344         <tr>
345           <xsl:choose>
346             <xsl:when test="position()=1">
347               <td class="dayDate"><xsl:value-of select="substring-after($startDate,'-')"/></td>
348             </xsl:when>
349             <xsl:when test="position()=last()">
350               <td class="dayDate"><xsl:value-of select="substring-after($endDate,'-')"/></td>
351             </xsl:when>
352             <xsl:otherwise>
353               <td></td>
354             </xsl:otherwise>
355           </xsl:choose>
356           <xsl:for-each select="period">
357             <xsl:variable name="startTime" select="start"/>
358             <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)-->
359             <xsl:variable name="startDate"><xsl:value-of select="substring(../start,1,8)"/>T<xsl:value-of select="start"/>00</xsl:variable>
360             <xsl:variable name="minutes" select="length"/>
361             <xsl:variable name="fbClass">
362               <xsl:choose>
363                 <xsl:when test="fbtype = '0'">busy</xsl:when>
364                 <xsl:when test="fbtype = '3'">tentative</xsl:when>
365                 <xsl:otherwise>free</xsl:otherwise>
366               </xsl:choose>
367             </xsl:variable>
368             <td class="{$fbClass}">
369               <a href="/ucal/initEvent.do?startdate={$startDate}&amp;minutes={$minutes}" title="{$startTime}">*</a>
370             </td>
371           </xsl:for-each>
372         </tr>
373       </xsl:for-each>
374     </table>
375
376     <table id="freeBusyKey">
377       <tr>
378         <td class="free">*</td>
379         <td>free</td>
380         <td>&#160;</td>
381         <td class="busy">*</td>
382         <td>busy</td>
383         <td>&#160;</td>
384         <td class="tentative">*</td>
385         <td>tentative</td>
386       </tr>
387     </table>
388   </xsl:template>
389
390   <xsl:template match="start" mode="timeDisplay">
391     <xsl:choose>
392       <xsl:when test="node()=0000">12</xsl:when>
393       <xsl:when test="node()=0100">1</xsl:when>
394       <xsl:when test="node()=0200">2</xsl:when>
395       <xsl:when test="node()=0300">3</xsl:when>
396       <xsl:when test="node()=0400">4</xsl:when>
397       <xsl:when test="node()=0500">5</xsl:when>
398       <xsl:when test="node()=0600">6</xsl:when>
399       <xsl:when test="node()=0700">7</xsl:when>
400       <xsl:when test="node()=0800">8</xsl:when>
401       <xsl:when test="node()=0900">9</xsl:when>
402       <xsl:when test="node()=1000">10</xsl:when>
403       <xsl:when test="node()=1100">11</xsl:when>
404       <xsl:when test="node()=1200">12</xsl:when>
405       <xsl:when test="node()=1300">1</xsl:when>
406       <xsl:when test="node()=1400">2</xsl:when>
407       <xsl:when test="node()=1500">3</xsl:when>
408       <xsl:when test="node()=1600">4</xsl:when>
409       <xsl:when test="node()=1700">5</xsl:when>
410       <xsl:when test="node()=1800">6</xsl:when>
411       <xsl:when test="node()=1900">7</xsl:when>
412       <xsl:when test="node()=2000">8</xsl:when>
413       <xsl:when test="node()=2100">9</xsl:when>
414       <xsl:when test="node()=2200">10</xsl:when>
415       <xsl:when test="node()=2300">11</xsl:when>
416       <xsl:when test="node()=2400">12</xsl:when>
417       <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
418     </xsl:choose>
419   </xsl:template>
420
421   <!--==== UTILITY TEMPLATES ====-->
422
423   <!-- search and replace template taken from
424        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
425   <xsl:template name="replace">
426     <xsl:param name="string" select="''"/>
427     <xsl:param name="pattern" select="''"/>
428     <xsl:param name="replacement" select="''"/>
429     <xsl:choose>
430       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
431         <xsl:value-of select="substring-before($string, $pattern)"/>
432         <xsl:copy-of select="$replacement"/>
433         <xsl:call-template name="replace">
434           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
435           <xsl:with-param name="pattern" select="$pattern"/>
436           <xsl:with-param name="replacement" select="$replacement"/>
437         </xsl:call-template>
438       </xsl:when>
439       <xsl:otherwise>
440         <xsl:value-of select="$string"/>
441       </xsl:otherwise>
442     </xsl:choose>
443   </xsl:template>
444 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.