Calendar

The calendar is used by any UIM page which displays a field from a server access bean containing a CALENDAR_XML_STRING domain. This view allows for scheduling of events from different time-frames; monthly, weekly and daily. The following image shows a section of the calendar week view as it would be displayed in a web page.

Figure 1. Calendar Week ViewCalendar Week View.

Programmatically, the calendar expects to be populated with information about events in an XML format.

The following is an example of what the XML received from the server might look like:

Figure 2. Calendar XML Stream
<CURAM_CALENDAR_DATA TYPE="UserCalendar">
  <EVENT>
    <ID>1</ID>
    <DATE>2002-10-10</DATE>
    <STARTTIME>10:10:10</STARTTIME>
    <ENDTIME>10:10:10</ENDTIME>
    <DURATION>0</DURATION>
    <DESCRIPTION>Hello World!</DESCRIPTION>
    <STATUS>ATS1</STATUS>
    <PRIORITY>AP1</PRIORITY>
    <LEVEL>AL1</LEVEL>
    <RECURRING>false</RECURRING>
    <READ_ONLY>false</READ_ONLY>
    <ALL_DAY>false</ALL_DAY>
    <ATTENDEE>true</ATTENDEE>
    <ACCEPTANCE>true</ACCEPTANCE>
  </EVENT>
  <SINGLE_DAY_EVENT>
    <ID>2</ID>
    <DATE>2003-04-01</DATE>
    <TYPE>ET1</TYPE>
    <DESCRIPTION>April Fool's Day</DESCRIPTION>
  </SINGLE_DAY_EVENT>
</CURAM_CALENDAR_DATA>

Notice that there can be two kinds of event elements contained within the CURAM_CALENDAR_DATA XML data: EVENT and SINGLE_DAY_EVENT. In the schema of the XML data expected the root element, CURAM_CALENDAR_DATA, can hold any number (zero to many) of EVENT and SINGLE_DAY_EVENT elements; CURAM_CALENDAR_DATA can optionally have a TYPE attribute which associates this sequence of events with a particular calendar configuration (see example below).

The following tables describe the schema definitions for each of the attributes allowed on the EVENT and the SINGLE_DAY_EVENT elements respectively.

Table 1. EVENT attributes in schema

Attribute Name

Description

Required

ID

A string to uniquely identify this event.

 

DATE

The date of the event in xs:date format: (CCYY-MM-DD) I.e. 21- Aug-2002 is represented as 2002-08-21.

No

STARTTIME

The start time in xs:time format: (hh:mm:ss). I.E. 1:34 pm and 56 seconds is represented as 13:34:56.

 

ENDTIME

The start time in xs:time format: (hh:mm:ss).

No

DURATION

The duration of the event in minutes. This should be an integer.

No

DESCRIPTION

A Description of the event.

No

STATUS

The status of the event. This node is limited to values stored in the ActivityTimeStatus code table in the reference application.

No

PRIORITY

The priority of the event. This node is limited to values stored in the ActivityPriority code table in the reference application.

No

LEVEL

Code that shows the level of the activity. This node is limited to the values stored in the ActivityLevel code table in the reference application.

No

RECURRING

Recurring indicator: true if this event is a recurring event. Otherwise false.

No

READ_ONLY

Read-only indicator: true if this event is a read-only event. Otherwise false.

No

ALL_DAY

All-day indicator: True if this is an all-day event. Otherwise false.

No

ATTENDEE

Attendee indicator: true if the user is attending a meeting. Otherwise false.

No

ACCEPTANCE

Acceptance indicator: True if the user has accepted an invitation to a meeting. Otherwise false.

 

POSITION

For a spanning event, indicates first or last component of the event.

No

Table 2. SINGLE_DAY_EVENT attributes in schema

Attribute Name

Description

Required

ID

A string to uniquely identify this event.

No

DATE

The date of the event in xs:date format.

No

TYPE

The type of a single day event.

No

DESCRIPTION

A Description of the event.

No

Once a field based on the CALENDAR_XML_STRING domain returns XML information formatted according to the aforementioned schema, it will be displayed in the appropriate time position by the calendar. Any web page containing a calendar can be set to open on different dates and views by specifying the startDate and calendarViewType parameters in the page's URL. The startDate parameter should be formatted according to the date format expected by the application and the calendarViewType parameter should be one of the following codes.

Table 3. Calendar View Type Values

Code

Value

CVT1

Day view

CVT2

Week view

CVT3

Month view

You can configure the display of calendar information using the CalendarConfig.xml file. There should be at least one copy of this in the components folder. This file should contain configuration information for each type of calendar, the TYPE attribute of the CURAM_CALENDAR_DATA element mentioned above associates a calendar data stream with a particular type. The following is an example of the structure of the CalendarConfig.xml

Figure 3. CalendarConfig.xml Example
<CONFIGURATION MONTH_CELL_HEIGHT="4"
               SHOW_REPEAT_EVENT_TEXT="true">
  <CALENDAR TYPE="UserCalendar">
    <DESCRIPTION_LOCATION>DetailsPage.do</DESCRIPTION_LOCATION>
    <DAY_VIEW_TIME_FORMAT>24</DAY_VIEW_TIME_FORMAT>
  </CALENDAR>
  <EVENT_TYPES>
    <TYPE NAME="ET1" ICON="Images/mandatory.gif"/>
    <TYPE NAME="ET2" ICON="Images/case.gif"/>
    <TYPE NAME="ET3" ICON="Images/concern.gif"/>
  </EVENT_TYPES>
</CONFIGURATION>

The overall schema for this configuration file specifies the CONFIGURATION element as the root element. The CONFIGURATION has an optional MONTH_CELL_HEIGHT attribute which sets the maximum number of rows to display in a single cell in the month view. The default value is three. The SHOW_REPEAT_EVENT_TEXT optional attribute, if set to true, will display the event description in each month cell if an event spans multiple days. This attribute is false by default.

The CONFIGURATION root element can hold any number of CALENDAR elements and a single EVENT_TYPES element. The TYPE attribute of CALENDAR associates this configuration information with an XML stream returned from the server. The DESCRIPTION_LOCATION element of CALENDAR is for constructing a link to a page containing more information on any event in the calendar. The following table lists the parameters passed with this hyperlink.

Table 4. Parameters Passed to Event Description Pages

Parameter Name

Description

ID

the event ID

RE

Recurrence indicator

AT

Attendee indicator

RO

Read-only indicator

LV_

Activity level

AC

Acceptance indicator

The CALENDAR element should also contain an element called DAY_VIEW_TIME_FORMAT. The valid values for this element are 12 and 24. They specify whether the time in the day view is displayed using a 12 or 24 hour format.

The EVENT_TYPES element is used for mapping images to display as icons next to single day events. The NAME attribute of the TYPE element must match a TYPE element on a SINGLE_DAY_EVENT supplied by the server for the image specified by the ICON attribute to be displayed.

The schema for the calendar configuration file (CalendarConfiguration.xsd) and the schema for the CALENDAR_XML_STRING domain (CuramCalendar.xsd) are located in your project's WebContent/WEB-INF/CDEJ/schema folder.