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

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

moved "views" xml output into the header for the web clients (will need it in all pages for menuing); added view icon.

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     <fetchPublicCalendars><genurl:rewrite action="fetchPublicCalendars"/></fetchPublicCalendars>
126     <fetchCalendars><genurl:rewrite action="fetchCalendars"/></fetchCalendars>
127     <addEvent><genurl:rewrite action="addEvent.do"/></addEvent>
128     <addEventUsingPage><genurl:rewrite action="addEventUsingPage.do"/></addEventUsingPage>
129     <editEvent><genurl:rewrite action="editEvent.do"/></editEvent>
130     <delEvent><genurl:rewrite action="delEvent.do"/></delEvent>
131     <mailEvent><genurl:rewrite action="mailEvent.do"/></mailEvent>
132     <showPage><genurl:rewrite action="showPage.do"/></showPage>
133     <manageLocations><genurl:rewrite action="manageLocations.do"/></manageLocations>
134     <addLocation><genurl:rewrite action="addLocation.do"/></addLocation>
135     <editLocation><genurl:rewrite action="editLoc.do"/></editLocation>
136     <delLocation><genurl:rewrite action="delLocation.do"/></delLocation>
137     <subscriptions> <!-- only those listed are used here (no need to clean up) -->
138       <fetch><genurl:link page="/subs/fetch.do?b=de"/></fetch>
139       <fetchForUpdate><genurl:link page="/subs/fetchForUpdate.do?b=de"/></fetchForUpdate>
140       <initAdd><genurl:link page="/subs/initAdd.do?b=de"/></initAdd>
141       <subscribe><genurl:link page="/subs/subscribe.do?b=de"/></subscribe>
142     </subscriptions>
143     <export><genurl:rewrite action="export.do"/></export>
144
145     <initEventAlarm><genurl:rewrite action="initEventAlarm.do"/></initEventAlarm>
146     <setAlarm><genurl:rewrite action="setAlarm.do"/></setAlarm>
147     <addEventRef><genurl:rewrite action="addEventRef.do"/></addEventRef>
148     <upload><genurl:rewrite action="upload.do"/></upload>
149     <stats><genurl:rewrite action="stats.do?be=d"/></stats>
150   </urlPrefixes><%--
151         actionUrlPrefixes are used to generate appropriately encoded urls for
152         calls into the application; these are required for use within portals --%>
153   <confirmationid><bean:write name="calForm" property="confirmationId"/></confirmationid><%--
154         Value: String - a 16 character random string used to allow users to confirm
155         additions to thier private calendar --%>
156   <logic:iterate id="appvar" name="calForm" property="appVars">
157     <appvar><%--
158         Application variables can be set arbitrarily by the stylesheet designer.
159         Use an "appvar" by adding setappvar=key(value) to the query string of
160         a URL.  This feature is useful for setting up state during a user's session.
161         e.g. <a href="{$urlPrefix}/eventView.do?eventId=8&setappvar=currentTab(event)">View Event</a>
162         To change the value of an appvar, call the same key with a different value.
163         e.g. <a href="{$urlPrefix}/setup.do?setappvar=currentTab(home)">Return Home</a>
164         If appvars exist, they will be output in the following form:  --%>
165       <key><bean:write name="appvar" property="key" /></key>
166       <value><bean:write name="appvar" property="value" /></value>
167
168       <logic:equal name="appvar" property="key" value="summaryMode"><%--
169         This is a special use of the appvar feature.  Normally, we don't return
170         all details about events except when we display a single event (to keep the
171         XML lighter).  To return all event details in an events listing, append a
172         query string with setappvar=summaryMode(details).  Turn the detailed view
173         off with setappvar=summaryMode(summary).--%>
174         <logic:equal name="appvar" property="value" value="details">
175           <bean:define id="detailView" value="true" toScope="request"/><%--
176             Send this bean to the request scope so we can test for it on the page
177             that builds the calendar tree (main.jsp) --%>
178         </logic:equal>
179       </logic:equal>
180     </appvar>
181   </logic:iterate>
182
183   <selectionState><%--
184     What type of information have we selected to display?  Used to
185     branch between different templates in the xsl based on user selections. --%>
186     <selectionType><bean:write name="calForm" property="selectionType"/></selectionType><%--
187         Value: view,search,calendar,subscription,filter
188         Used to branch into different presentation depending on the type of
189         output we expect --%>
190     <view>
191       <logic:present name="calForm" property="currentView" >
192         <name><bean:write name="calForm" property="currentView.name"/></name><%--
193           Value: string - Name of selected view for display --%>
194         <id><bean:write name="calForm" property="currentView.id"/></id><%--
195           Value: string - String ID of selected view for display --%>
196       </logic:present>
197       <logic:notPresent name="calForm" property="currentView" >
198         <name>All</name><%-- change: this should be the default not "All" --%>
199         <id>-1</id>
200       </logic:notPresent>
201     </view>
202     <search><bean:write name="calForm" property="search"/></search><%--
203       Value: string - Current search string for display
204       Note: this will change when proper searching is implemented --%>
205     <subscriptions>
206       <logic:iterate id="sub" name="calForm" property="currentSubscriptions">
207         <subscription>
208           <name><bean:write name="sub" property="name" /></name>
209           <logic:present name="sub" property="calendar" >
210             <calendar>
211               <name><bean:write name="sub" property="calendar.name" /></name>
212             </calendar>
213           </logic:present>
214           <logic:notPresent name="sub" property="calendar" >
215             <calendar><name></name></calendar>
216           </logic:notPresent>
217         </subscription>
218       </logic:iterate>
219     </subscriptions><%--
220       Value: string - currently selected subscription ("calendar" too) --%>
221     <filter></filter> <%-- unimplemented --%>
222   </selectionState>
223  
224   <%-- List of views for menuing --%>
225   <views>
226     <logic:present name="calForm" property="views">
227       <logic:iterate id="view" name="calForm" property="views" >
228         <view>
229           <name><bean:write name="view" property="name"/></name>
230           <id><bean:write name="view" property="id"/></id>
231         </view>
232       </logic:iterate>
233     </logic:present>
234   </views>
235
236 <%-- ****************************************************************
237       the following code should not be produced in the public client
238      **************************************************************** --%>
239   <logic:equal name="calForm" property="publicView" value="false">
240     <myCalendars>
241       <jsp:include page="/docs/calendar/emitCalendars.jsp"/>
242     </myCalendars>
243
244     <mySubscriptions>
245       <jsp:include page="/docs/subs/emitSubscriptions.jsp"/>
246     </mySubscriptions>
247
248     <myPreferences>
249     </myPreferences>
250   </logic:equal>
251
252 <%
253 } catch (Throwable t) {
254   t.printStackTrace();
255 }
256 %>
257
Note: See TracBrowser for help on using the browser.