root/trunk/calendar3/webclient/war/docs/header.jsp

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

added calendar management code to personal client; clean-up to follow. It builds and displays.

Line 
1 <!DOCTYPE ucalendar
2 [
3   <!ENTITY nbsp "&#160;">
4 ]>
5 <%@ page contentType="text/xml;charset=UTF-8" language="java" %>
6 <%@ taglib uri='struts-bean' prefix='bean' %>
7 <%@ taglib uri='struts-logic' prefix='logic' %>
8 <%@ taglib uri='struts-genurl' prefix='genurl' %>
9 <%
10 try {
11 %>
12
13 <bedework>
14   <now><%-- The actual date right "now" - this may not be the same as currentdate --%>
15     <date><bean:write name="calForm" property="today.dateDigits"/></date><%--
16       Value: YYYYMMDD --%>
17     <longdate><bean:write name="calForm" property="today.longDateString"/></longdate><%--
18       Value (example): February 8, 2004 - long representation of the date --%>
19     <shortdate><bean:write name="calForm" property="today.dateString"/></shortdate><%--
20       Value (example): 2/8/04 - short representation of the date --%>
21     <time><bean:write name="calForm" property="today.timeString"/></time><%--
22       Value (example): 10:15 PM --%>
23   </now>
24   <bean:define id="ctView" name="calForm" property="curTimeView"/>
25   <currentdate><%-- The current user-selected date --%>
26     <date><bean:write name="ctView" property="curDay.dateDigits"/></date><%--
27       Value: yyyymmdd - date value --%>
28     <longdate><bean:write name="ctView"
29                           property="curDay.fullDateString"/></longdate><%--
30       Value (example): Wednesday, February 11, 2004 --%>
31     <shortdate><bean:write name="ctView" property="curDay.dateString"/></shortdate><%--
32       Value (example): 2/8/04 - short representation of the date --%>
33     <monthname><bean:write name="ctView" property="curDay.monthName"/></monthname><%--
34       Value (example): January - full month name --%>
35   </currentdate>
36   <firstday><%-- The first date appearing in the currently selected time period --%>
37     <date><bean:write name="ctView" property="firstDay.dateDigits"/></date><%--
38       Value: yyyymmdd - date value --%>
39     <longdate><bean:write name="ctView"
40                           property="firstDay.fullDateString"/></longdate><%--
41       Value (example): Wednesday, February 11, 2004 --%>
42     <shortdate><bean:write name="ctView" property="firstDay.dateString"/></shortdate><%--
43       Value (example): 2/8/04 - short representation of the date --%>
44     <monthname><bean:write name="ctView" property="firstDay.monthName"/></monthname><%--
45       Value (example): January - full month name --%>
46   </firstday>
47   <lastday><%-- The last date appearing in the currently selected time period --%>
48     <date><bean:write name="ctView" property="lastDay.dateDigits"/></date><%--
49       Value: yyyymmdd - date value --%>
50     <longdate><bean:write name="ctView"
51                           property="lastDay.fullDateString"/></longdate><%--
52       Value (example): Wednesday, February 11, 2004 --%>
53     <shortdate><bean:write name="ctView" property="lastDay.dateString"/></shortdate><%--
54       Value (example): 2/8/04 - short representation of the date --%>
55     <monthname><bean:write name="ctView" property="lastDay.monthName"/></monthname><%--
56       Value (example): January - full month name --%>
57   </lastday>
58   <previousdate><bean:write name="ctView" property="prevDate"/></previousdate><%--
59     Value: YYYYMMDD - The previous "firstdate" in the selected time period  --%>
60   <nextdate><bean:write name="ctView" property="nextDate"/></nextdate><%--
61     Value: YYYYMMDD - The next "firstdate" in the selected time period --%>
62   <periodname><bean:write name="ctView" property="periodName"/></periodname><%--
63     Values: Day, Week, Month, Year - The current time period name.   --%>
64   <multiday><bean:write name="ctView" property="multiDay"/></multiday><%--
65     Values: true, false - Flag if we are viewing multiple days --%>
66   <hour24><bean:write name="calForm" property="hour24" /></hour24><%--
67     Values: true, false - Flag if we are using 24 hour time --%>
68
69   <publicview><bean:write name="calForm" property="publicView" /></publicview><%--
70     Values: true, false - Flag if we are in the guest (public) view  --%>
71   <guest><bean:write name="calForm" property="guest" /></guest><%--
72     Value: true, false - Flag if we are a guest --%>
73   <logic:equal name="calForm" property="guest" value="false">
74     <userid><bean:write name="calForm" property="currentUser" /></userid><%--
75       Value: string - Userid of non-guest user --%>
76   </logic:equal>
77
78   <logic:iterate id="msg" name="calForm" property="msg.msgList">
79     <message>
80       <id><bean:write name="msg" property="msgId" /></id>
81       <logic:iterate id="param" name="msg" property="params" >
82         <param><bean:write name="param" /></param>
83       </logic:iterate>
84     </message>
85   </logic:iterate>
86
87   <logic:iterate id="errBean" name="calForm" property="err.msgList">
88     <error>
89       <id><bean:write name="errBean" property="msgId" /></id>
90       <logic:iterate id="param" name="errBean" property="params" >
91         <param><bean:write name="param" /></param>
92       </logic:iterate>
93     </error>
94   </logic:iterate>
95
96   <approot><bean:write name="calForm" property="presentationState.appRoot"/></approot><%--
97         Value: URI - the location of web resources used by the code to find the
98         XSLT files.  This element is defined prior to build in
99         ../../../../clones/democal.properties
100         as pubevents.app.root and personal.app.root. Note that references to
101         html web resources such as images are set in the xsl stylesheets. --%>
102   <urlprefix><bean:write name="calForm" property="urlPrefix"/></urlprefix><%--
103         Value: URI - this is prefix of the calendar application.
104         e.g. http://localhost:8080/cal
105         Use this value to prefix calls to the application actions in your XSLT.
106         e.g. <a href="{$urlPrefix}/eventView.do?eventId=8">View Event</a> --%>
107   <urlpattern><genurl:rewrite action="DUMMYACTION.DO" /></urlpattern>
108
109   <personaluri><bean:message key="org.bedework.personal.calendar.uri"/></personaluri>
110   <publicuri><bean:message key="org.bedework.public.calendar.uri"/></publicuri>
111   <adminuri><bean:message key="org.bedework.public.admin.uri"/></adminuri>
112   <bean:define id="personalUri"><bean:message key="org.bedework.personal.calendar.uri"/></bean:define>
113   <urlPrefixes>
114     <%-- render urls --%>
115     <initialise><genurl:rewrite forward="initialise"/></initialise>
116     <eventMore><genurl:rewrite forward="eventMore"/></eventMore>
117     <initUpload><genurl:rewrite forward="initUpload"/></initUpload>
118
119     <%-- action urls --%>
120     <setup><genurl:rewrite action="setup.do"/></setup>
121     <setSelection><genurl:rewrite action="setSelection.do"/></setSelection>
122     <setViewPeriod><genurl:rewrite action="setViewPeriod.do"/></setViewPeriod>
123     <eventView><genurl:rewrite action="eventView.do"/></eventView>
124     <initEvent><genurl:rewrite action="initEvent.do"/></initEvent>
125     <addEvent><genurl:rewrite action="addEvent.do"/></addEvent>
126     <addEventUsingPage><genurl:rewrite action="addEventUsingPage.do"/></addEventUsingPage>
127     <mailEvent><genurl:rewrite action="mailEvent.do"/></mailEvent>
128     <showPage><genurl:rewrite action="showPage.do"/></showPage>
129
130     <export><genurl:rewrite action="export.do"/></export>
131     <stats><genurl:rewrite action="stats.do?be=d"/></stats>
132
133     <fetchPublicCalendars><genurl:rewrite action="fetchPublicCalendars"/></fetchPublicCalendars>
134     <fetchCalendars><genurl:rewrite action="fetchCalendars"/></fetchCalendars>
135
136     <!-- The following URLs are used only in the personal client -->
137     <logic:equal name="calForm" property="guest" value="false">
138       <editEvent><genurl:rewrite action="editEvent.do"/></editEvent>
139       <delEvent><genurl:rewrite action="delEvent.do"/></delEvent>
140
141       <calendar>
142         <fetch><genurl:link page="/calendar/showUpdateList.rdo?b=de"/></fetch><!-- keep -->
143         <fetchDescriptions><genurl:link page="/calendar/showDescriptionList.rdo?b=de"/></fetchDescriptions><!-- keep -->
144         <initAdd><genurl:link page="/calendar/initAdd.do?b=de"/></initAdd><!-- keep -->
145         <delete><genurl:link page="/calendar/delete.do?b=de"/></delete>
146         <fetchForDisplay><genurl:link page="/calendar/fetchForDisplay.do?b=de"/></fetchForDisplay>
147         <fetchForUpdate><genurl:link page="/calendar/fetchForUpdate.do?b=de"/></fetchForUpdate><!-- keep -->
148         <update><genurl:link page="/calendar/update.do?b=de"/></update><!-- keep -->
149       </calendar>
150
151       <subscriptions> <!-- only those listed are used here (no need to clean up) -->
152         <fetch><genurl:link page="/subs/fetch.do?b=de"/></fetch>
153         <fetchForUpdate><genurl:link page="/subs/fetchForUpdate.do?b=de"/></fetchForUpdate>
154         <initAdd><genurl:link page="/subs/initAdd.do?b=de"/></initAdd>
155         <subscribe><genurl:link page="/subs/subscribe.do?b=de"/></subscribe>
156       </subscriptions>
157
158       <manageLocations><genurl:rewrite action="manageLocations.do"/></manageLocations>
159       <addLocation><genurl:rewrite action="addLocation.do"/></addLocation>
160       <editLocation><genurl:rewrite action="editLoc.do"/></editLocation>
161       <delLocation><genurl:rewrite action="delLocation.do"/></delLocation>
162
163       <initEventAlarm><genurl:rewrite action="initEventAlarm.do"/></initEventAlarm>
164       <setAlarm><genurl:rewrite action="setAlarm.do"/></setAlarm>
165       <addEventRef><genurl:rewrite action="addEventRef.do"/></addEventRef>
166       <upload><genurl:rewrite action="upload.do"/></upload>
167     </logic:equal>
168   </urlPrefixes><%--
169         actionUrlPrefixes are used to generate appropriately encoded urls for
170         calls into the application; these are required for use within portals --%>
171   <confirmationid><bean:write name="calForm" property="confirmationId"/></confirmationid><%--
172         Value: String - a 16 character random string used to allow users to confirm
173         additions to thier private calendar --%>
174   <logic:iterate id="appvar" name="calForm" property="appVars">
175     <appvar><%--
176         Application variables can be set arbitrarily by the stylesheet designer.
177         Use an "appvar" by adding setappvar=key(value) to the query string of
178         a URL.  This feature is useful for setting up state during a user's session.
179         e.g. <a href="{$urlPrefix}/eventView.do?eventId=8&setappvar=currentTab(event)">View Event</a>
180         To change the value of an appvar, call the same key with a different value.
181         e.g. <a href="{$urlPrefix}/setup.do?setappvar=currentTab(home)">Return Home</a>
182         If appvars exist, they will be output in the following form:  --%>
183       <key><bean:write name="appvar" property="key" /></key>
184       <value><bean:write name="appvar" property="value" /></value>
185
186       <logic:equal name="appvar" property="key" value="summaryMode"><%--
187         This is a special use of the appvar feature.  Normally, we don't return
188         all details about events except when we display a single event (to keep the
189         XML lighter).  To return all event details in an events listing, append a
190         query string with setappvar=summaryMode(details).  Turn the detailed view
191         off with setappvar=summaryMode(summary).--%>
192         <logic:equal name="appvar" property="value" value="details">
193           <bean:define id="detailView" value="true" toScope="request"/><%--
194             Send this bean to the request scope so we can test for it on the page
195             that builds the calendar tree (main.jsp) --%>
196         </logic:equal>
197       </logic:equal>
198     </appvar>
199   </logic:iterate>
200
201   <selectionState><%--
202     What type of information have we selected to display?  Used to
203     branch between different templates in the xsl based on user selections. --%>
204     <selectionType><bean:write name="calForm" property="selectionType"/></selectionType><%--
205         Value: view,search,calendar,subscription,filter
206         Used to branch into different presentation depending on the type of
207         output we expect --%>
208     <view>
209       <logic:present name="calForm" property="currentView" >
210         <name><bean:write name="calForm" property="currentView.name"/></name><%--
211           Value: string - Name of selected view for display --%>
212         <id><bean:write name="calForm" property="currentView.id"/></id><%--
213           Value: string - String ID of selected view for display --%>
214       </logic:present>
215       <logic:notPresent name="calForm" property="currentView" >
216         <name>All</name><%-- change: this should be the default not "All" --%>
217         <id>-1</id>
218       </logic:notPresent>
219     </view>
220     <search><bean:write name="calForm" property="search"/></search><%--
221       Value: string - Current search string for display
222       Note: this will change when proper searching is implemented --%>
223     <subscriptions>
224       <logic:iterate id="sub" name="calForm" property="currentSubscriptions">
225         <subscription>
226           <name><bean:write name="sub" property="name" /></name>
227           <logic:present name="sub" property="calendar" >
228             <calendar>
229               <name><bean:write name="sub" property="calendar.name" /></name>
230             </calendar>
231           </logic:present>
232           <logic:notPresent name="sub" property="calendar" >
233             <calendar><name></name></calendar>
234           </logic:notPresent>
235         </subscription>
236       </logic:iterate>
237     </subscriptions><%--
238       Value: string - currently selected subscription ("calendar" too) --%>
239     <filter></filter> <%-- unimplemented --%>
240   </selectionState>
241
242   <%-- List of views for menuing --%>
243   <views>
244     <logic:present name="calForm" property="views">
245       <logic:iterate id="view" name="calForm" property="views" >
246         <view>
247           <name><bean:write name="view" property="name"/></name>
248           <id><bean:write name="view" property="id"/></id>
249         </view>
250       </logic:iterate>
251     </logic:present>
252   </views>
253
254 <%-- ****************************************************************
255       the following code should not be produced in the public client
256      **************************************************************** --%>
257   <logic:equal name="calForm" property="guest" value="false">
258     <myCalendars>
259       <jsp:include page="/docs/calendar/emitCalendars.jsp"/>
260     </myCalendars>
261
262     <mySubscriptions>
263       <jsp:include page="/docs/subs/emitSubscriptions.jsp"/>
264     </mySubscriptions>
265
266     <myPreferences>
267     </myPreferences>
268   </logic:equal>
269
270 <%
271 } catch (Throwable t) {
272   t.printStackTrace();
273 }
274 %>
275
Note: See TracBrowser for help on using the browser.