This chapter describes the Tab Library Calendar attributes:
The Calendar Tag Library consists of the following tags:
The calid tag makes the specified event bean properties available.
JSP
Only one of the id, name, or index attributes should be used at a time. If no attributes are specified then the current event in the parent collection is used. The event properties are only valid from the start tag to the end tag.
The tag has the following attributes for which the Required value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
Specifies the index into the current calid list of the calid bean to find.
The tag provides the following bean properties for which the Type value is “String” and the Access value is “Get”:
The calendar ID referenced by the bean.
n/a
The calids tag enumerates through the current calid collection in the calendar context.
JSP
n/a
The tag has the following attributes for which the Required value is “No”:
Name of the calid collection to create.
Name of the calid collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
The tag provides the following bean properties for which the Type value is “Integer” or “Boolean” and Access value is “Get/Set”:
Index of the current bean in the collection. Integer.
The number of iterations the collection should perform. Integer.
The zero based index from which to begin iteration. Integer.
The zero based index that denotes the item upon which iteration will terminate. Integer.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged. Integer.
Whether or not there are more items in the collection, beyond the current iterations. Boolean
Whether there are items in the collection preceding the current iterations. Boolean
<%-- enumerate through the event collection --%> <cal:calids> <cal:calid> ... </cal:calid> </cal:calids>
Ensures that a calendar context is present within the current pageContext. This tag must appear, at least once, before all other tags within the Calendar taglib. If config is not specified, then a search for a useable configuration name is performed in the following fashion: Attempt to retrieve the current calendar configuration name from the page context. If that succeeds, use it. If the retrieval fails... Attempt to retrieve the current calendar configuration name from the session. If that succeeds, store it on the page context and use it. If the retrieval fails... From the list of all SSOAdapter configuration names, try to find the first useable calendar configuration name. If that succeeds, store it in the session and page context and use it. If it is not possible to find a useable calendar configuration name, the context tag will fail. Once a configuration name has been determined, an attempt is made to acquire an appropriate calendar context object. This is done in the following fashion: Attempt to retrieve a calendar context from the page context, and verify it matches the configuration (using the previously acquired configuration name). If that succeeds, use it. If that fails... Attempt to retrieve a calendar context from the user's cache of mail contexts. If that succeeds, store it on the page context and use it. If the retrieval fails.. Create an SSOAdapter object using the previously acquired configuration name. Create a calendar context, and bind it with the SSOAdapter object. Store the calendar context in the context cache as well as the page context. In this way, if a calendar context has been previously referenced on a page, or within the session, then the config attribute may be omitted,and the most recently referenced context will be retrieved.
JSP or Empty.
Since the calendar context is saved across requests the properties are also available for use across requests.
This tag has the following attributes for which the Required value is “No”:
Specifies the "configuration" for which a calendar context should be retrieved.
Permits testing of service availability. Operates according to the following table:
This tag provides access to the following properties for which the Type values are “String”, “Integer”, and “Boolean” and the Access value is “Get”:
Returns errors status of failed command tags.
CAL_001: Invalid date format.
The size of the current event list.
Same as eventCount.
The size of the current task list.
The current calendar ID.
Indicates status of the events list.
Indicates status of the tasks list.
Indicates whether the user is the owner of the current calendar.
<%-- calendar context --%> <Cal:context/>
The dateformat tag either formats a datetime for output or parses one from an input. The format attribute specifies the format to use either to format for output or to parse from input. If the parse attribute is specified then that value is used as the parse string to set the specified datetime. If the parse attribute is not specified then the datetime is formatted to the page output.
JSP
The datetime to operate on is located as follows. If the name attribute is specified then that datetime bean is used. Otherwise the parent datetime tag is used.
The tag has the following attributes for which the Required values are “Yes” and “No”:
Specifies the name of the datetime bean to use. If not specified then the parent datetime tag is used.
The java.text.SimpleDateFormat format string to use to format or parse the datetime with.
The string to parse into a datetime using format.
n/a
<%-- create now datetime and output hours/minutes --%> <cal:datetime id="now"/> <cal:dateformat name="now" format="hh:mm"/> <%-- set datetime from hours/minutes parse string --%> <cal:datetime> <cal:dateformat format="hh:mm" parse="10:30"/> </cal:datetime>
The dateroll tag rolls the specified datetime bean. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.
JSP
None.
The tag has the following attributes for which the Required value is “No”:
Specifies the datetime bean to operate on. If not specified then search for a datetime parent tag.
Specifies the java.util.Calendar field of the roll; defaults to DATE.
Specifies the amount of the roll; an integer value, defaults to "1". Positive values roll forward; negative values roll backward.
None.
<%-- roll forward one day from today --%> <cal:datetime id="now"/> <cal:dateroll name="now"/> <%-- roll forward 2 weeks --%> <cal:datetime id="now"/> <cal:dateroll name="now" amount="2" field="WEEK_OF_YEAR"/> <%-- roll back 5 hours --%> <cal:datetime id="now"/> <cal:dateroll name="now" amount="-5" field="HOUR"/>
The datetime tag makes the specified date/time bean properties available.
JSP
Only one of the id or name attributes should be used at a time. The datetime properties are only valid from the start tag to the end tag.
The tag has the following attributes for which the Required value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
The tag provides the following bean properties for which the Type value is “Integer” and Access value is “Get/Set”:
Hours of the time; in a 24 hour clock
Minutes of the time.
Seconds of the time.
Day of the date.
Month of the date.
Year of the date; a 4 digit year.
<%-- create a 'now' datetime at the current time --%> <cal:datetime id="now"/> <%-- create a 'start' datetime with today at 10:30 --%> <cal:datetime id="start"> <cal:set property="hours" value="10"/> <cal:set property="minutes" value="30"/> </cal:datetime> <%-- use a previously created datetime --%> <cal:datetime name="now"> Day = <cal:get property="day"/> Month = <cal:get property="month"/> Year = <cal:get property="year"/> </cal:datetime>
This tag deletes the specified event from the current calendar set. If an error occurs during processing, the tag body will be evaluated.
JSP
If the name attribute is not specified then a parent event tag is used to find the event to operate on.
The tag has the following attributes for which the Required value is “No”:
None
<%-- delete an event by name --%> <cal:event id="event1"> <cal:delete name="event1"> ...delete failed... </cal:delete> <%-- delete an event and all future occurences --%> <cal:event> <cal:delete modifier="THIS_INSTANCE"> ...delete failed... </cal:delete> </cal:event>
This tag deletes the specified task from the current calendar set. If an error occurs during processing, the tag body will be evaluated.
JSP
If the name attribute is not specified then a parent task tag is used to find the event to operate on.
The tag has the following attribute for which the Required value is “No”:
Name of the event bean to delete.
None
<%-- delete a task by name --%> <cal:task id="task1"/> <cal:deleteTask name="task1"> ...delete failed... </cal:deleteTask>
This tag makes the specified event bean properties available.
JSP
Only one of the id, name, or index attributes should be used at a time. If no attributes are specified then the current event in the parent collection is used. The event properties are only valid from the start tag to the end tag.
The tag has the following attributes for which the Required value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
Specifies the index into the current event list of the event bean to find.
The tag provides the following bean properties for which the Access value is “Get/Set”:
Start time of the event; datetime.
End time of the event; datetime.
Long description of the event.
Short summary of the event.
Location of the event.
Whether the event lasts all day or not; boolean.
Whether the event is part of a recurring series of events; boolean.
RecurrencePattern of this event.
RecurrencePattern.THIS_INSTANCE and RecurrencePattern.THIS_AND_FUTURE
Same as recurrenceModifier for backward compatible.
String used to store the date for temparory purpose.
Get and set the rsvp status of this user as an attendee in this event.Only Sun-One supported valid values.
The user invites others to this event.
Remove any existing invitees to this event.
Boolean: Indicates whether user is the organizer of this event.
ReminderBean for this event.
<%-- create a 'new' event --%> <cal:event id="new"/> <%-- create a 'new' event with a summary --%> <cal:event id="new"> <cal:set property="summary" value="Event Summary"/> </cal:event> <%-- use a previously created event --%> <cal:event name="now"> Start = <cal:get property="startTime"/> End = <cal:get property="endTime"/> Summary = <cal:get property="summary"/> </cal:event> <%-- retrieve an event by id --%> <cal:event id="event" eventid="$(eid)"> <cal:set property="summary" value="new summary"/> </cal:event> <%-- current event in the event collection --%> <cal:events iterate="true"> <cal:event> ... </cal:event> </cal:events>
This tag enumerates through the current event collection in the calendar context.
JSP
n/a
This tag has the following attributes for which the Required value is “No”:
Name of the event collection to create.
Name of the event collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
This tag provides the following bean properties for which the Type values are “Integer” and “Boolean” and the Access value is “Get/Set”:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero-based index from which to begin iteration.
The zero based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%-- enumerate through the event collection --%> <cal:events> <cal:event> ... </cal:event> </cal:events>
This tag retrieves the specified range of events and tasks into the calendar context. The range is specified using datetime tags with the id attribute; see the datetime tag for details. If an error occurs during processing, the tag body is evaluated and the remainder of the page will be skipped.
JSP
Use either day or both start and end attributes to specify the range of events. If no attributes specified all events for the current day are retrieved.
This tag has the following attributes for which the Required value is “No”:
Specifies an entire day to retrieve.
Specifies the start time of the range to retrieve.
Specifies the end time of the range to retrieve.
None.
<%-- fetch todays events --%> <cal:fetch> ... fetch failed ... </cal:fetch> <%-- fetch events for a day --%> <cal:datetime id="start"/> ... set start time ... <cal:fetch day="start"> ... fetch failed ... </cal:fetch> <%-- fetch events for a range --%> <cal:datetime id="start"/> <cal:datetime id="end"/> ... set start & end times ... <cal:fetch start="start" end="end"> ... fetch failed ... </cal:fetch>
The fetchcalid tag retrieves something TBD. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.
JSP
The tag has the following attributes for which the Required value is “No”:
TBD
None.
n/a
This tag retrieves the specified property or field.
Empty
If the name attribute is not specified then uses a parent bean tag to locate the bean on which to operate. Either property or field attributes should be used to specify what to retrieve. The id attribute specifies the name to save the retrieved property as; useful for non-string properties.
The tag has the following attributes for which the Required value is “No”:
Name of the datetime bean to use.
Name of the property to retrieve. If not specified then the bean itself is retrieve as a string.
Name of the java.util.Calendar field to retrieve.
Name to save the retrieved result as.
Specifies the edit bean that will be applied to the returned value.
None.
<%-- get the eventsummary property --%> <cal:event> summary=<cal:get property="summary"/> </cal:event> <%-- get the datetime HOURS field --%> <cal:datetime> hours=<cal:get field="HOURS"/> </cal:datetime>
The login tag creates a calender server session using the specified host and port with the specified user and password authentication.
JSP
The authenticated calendar session is stored as calendarSession into the session context.
The tag has the following attributes for which the Required values are “Yes” and “No”:
Specifies the calendar server host.
Specifies the calendar server port.
Specifies the calendar user id.
Specifies the calender user password.
None.
<%-- login to a calendar server with authentication --%> <cal:login host="ical" user="user-id" pword="password"/>
The opencal tag verifies the user can open a calendar.
JSP
The tag has the following attributes for which the Required value is “Yes”:
ID of the calendar to open.
None.
n/a
This tag makes the specified recurrence bean properties available.
JSP
Only one of the id, name, or index attributes should be used at a time. If no attributes are specified then the current event in the parent collection is used.
The tag has the following attributes
The tag provides the following bean properties. The id and name attributes have the Type value, “String” and Access value, “No”. The frequency attribute has Type values such as RecurrencePattern.DAILY, RecurrencePattern.WEEKLY, RecurrencePattern.MONTHLY, and RecurrencePattern.YEARLY and the Required value, Yes. The Type values for repeatOn, repeatUntil, and interval attributes are String, Number or DateTime, and int respectively and the Access value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
n/a
n/a
n/a
n/a
The tag provides the following bean properties:
Based on JCAPI "RecurrencePattern"
<%@ page import="com.sun.comclient.calendar.RecurrencePattern" %> <cal:event id="new"> <cal:recurrence id="rec" frequency="RecurrencePattern.WEEKLY" interval="1" repeatOn="SA,SU" repeatUntil="5" /> <cal:set id="rec" property="recurrencePattern" /> </cal:event>
The reminder tag makes the specified reminder bean properties available.
JSP
n/a
The tag has the following attributes for which the Type value is “String” and the Access value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
The tag provides the following bean properties for which the Type value is “Integer”, “DateTime”, and “String” and the Access value is “Get/Set”:
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
The set tag updates the specified property or field.
JSP
If the name attribute is not specified then uses a parent bean tag to locate the bean on which to operate. One of property or field attributes must be used to specify what to update. Either the value or id attributes is used to specify the value of the property to update.
The tag has the following attributes for which the Required value is “No”:
Name of the datetime bean to use.
Name of the property to update.
Name of the java.util.Calendar field to update.
String value of the property to update.
Bean object value of the property to update.
Specifies the edit bean that will be applied to value prior to storage.
None.
<%-- set the event summary property --%> <cal:event> <cal:set property="summary" value="new summary"/> </cal:event> <%-- set the datetime HOURS field --%> <cal:datetime> <cal:set field="HOURS" value="10"/> </cal:datetime> <%-- set the event start time to a datetime bean --%> <cal:datetime id="now"/> <cal:event> <cal:set property="startTime" id="now"/> </cal:event>
This tag stores the specified event into the current calendar set. It can either store a new event or update an existing event. If an error occurs during processing, the tag body will be evaluated.
JSP
If the name attribute is not specified then a parent event tag is used to find the event to operate on. The modifier attribute should only be used to update an existing event.
This tag has the following attributes for which the Required value is “No”:
Name of the event bean to store.
Specifies how to update an existing event. Can accept a string.
This event instance only.
This and all future occurrences.
This and previous occurrences.
This and all occurrences.
None
<%-- store an event by name --%> <cal:event id="event1"> <cal:store name="event1"> ...store failed... </cal:store> <%-- store an event and all future occurrences --%> <cal:event> <cal:store modifier="<%= RecurrencePatten.THIS_INSTANCE %>" > ...store failed... </cal:store> </cal:event>
The storeTask tag stores the specified task into the current calendar set. It can either store a new task or update an existing event. If an error occurs during processing, the tag body will be evaluated.
JSP
If the name attribute is not specified then a parent task tag is used to find the event to operate on. The modifier attribute should only be used to update an existing task
The tag has the following attributes for which the Required value is “No”:
Name of the event bean to store.
None
<%-- store an task by name --%> <cal:task id="task1"> <cal:storeTask name="task1"> ...store failed... </cal:storeTask>
This tag makes the specified task bean properties available.
JSP
Only one of the id, name, or index attributes should be used at a time. If no attributes are specified then the current task in the parent collection is used.
The tag has the following attributes for which the Required value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
Specifies the index into the current event list of the event bean to find.
The tag provides the following bean properties for which the Type values are “DateTime”, “Boolean”, “String”, and “ReminderBean” and the Access value is “Get/Set”:
The time at which the task is due.
If the DueDate is valid.
If the task is due or not.
If the dueTime is valid.
n/a
n/a
Long description of the event.
Short summary of the event.
Location of the event.
n/a
Whether the event lasts all day or not; boolean.
String to store the date for temparory purpose.
The recurrence pattern for the Task.
The reminder for the task.
The instances of task needs to be modified. RecurrencePattern.THIS_INSTANCE and RecurrencePattern.THIS_AND_FUTURE.
Same as recurrenceModifier.
<%-- create a 'new' task --%> <cal:task id="new"/> <%-- create a 'new' task with a summary --%> <cal:task id="new"> <cal:set property="summary" value="Task Summary"/> </cal:task> <%-- use a previously created task --%> <cal:task name="now"> Due Date = <cal:get property="dueDate"/> Summary = <cal:get property="summary"/> </cal:task> <%-- current task in the task collection --%> <cal:tasks iterate="true"> <cal:task> ... </cal:task> </cal:events>
This tag enumerates through the current task collection in the calendar context.
JSP
n/a
The tag has the following attributes for which the Required value is “No”:
Name of the task collection to create.
Name of the task collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
The tag provides the following bean properties for which the Type value is “Integer” and “Boolean” and Access value is “Get/Set”:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero based index from which to begin iteration.
The zero based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%-- enumerate through the task collection --%> <cal:tasks> <cal:task> ... </cal:tasks> </cal:tasks>