Sun Java System Calendar Server 6 2005Q4 Developer's Guide

Chapter 5 Web Calendar Access Protocol Overview

This chapter describes the Web Calendar Access Protocol (WCAP), which is a high level command-based protocol used to communicate with the Calendar Server. This chapter has the following sections:

Introduction

Calendar data is stored in a proprietary format in the various calendar databases. You retrieve calendar data using WCAP commands with the fmt-out parameter set to either text/calendar or text/xml.

Calendar Server communicates with Communications Express using the text/xml format.

WCAP is a command based system consisting of client requests and server responses for transmitting calendaring data. WCAP returns calendaring data using the HTTP protocol. In most cases, Calendar Server receives data through URL-encoded arguments.

WCAP commands consist of four general categories of usage:

Command Overview

The following is a list of commands supported in WCAP. For a detailed description of each command, see Chapter 7, WCAP Command Reference

Table 5–1 WCAP Command Overview

WCAP Command  

Description  

Command: check_id

Administrator only: Check if user’s session ID is valid. 

Command: createcalendar

Create a new calendar. 

Command: deletecalendar

Delete an existing calendar. 

Command: deletecomponents_by_range

Delete both events and todos in a calendar(s) over a specific time period. 

Command: deleteevents_by_id

Delete events given a specific calid and uid or recurrence-ID pair.

Command: deleteevents_by_range

Delete events in a calendar(s) over a specific time period. 

Command: deletetodos_by_id

Delete todos given a specific calid and uid or recurrence-ID pair.

Command: deletetodos_by_range

Deletes todos in a calendar(s) over a specific time period. 

Command: export

Exports a calendar to a file. 

Command: fetchcomponents_by_alarmrange

Queries for components that have alarms to trigger over a specific time period. 

Command: fetchcomponents_by_attendee_error

Queries for components that had errors while sending group scheduling messages. 

Command: fetchcomponents_by_lastmod

Queries for components that have changed, during the specified time range. 

Command: fetch_deletedcomponents

Queries the deletelog database for deleted components.

Command: fetchcomponents_by_range

Queries for components over a specific time period, with filtering attributes. 

Command: fetchevents_by_id

Queries for one or more events by a unique identifier (UID, Recurrence ID, modifier). 

Command: fetchtodos_by_id

Queries for one or more todos by a unique identifier (UID, Recurrence ID, modifier). 

Command: get_all_timezones

Returns all the time zones the server supports. 

Command: get_calprops

Returns calendar properties. 

Command: get_freebusy

Returns calendar free-busy time. 

Command: get_guids

Returns a set of random UID's. 

Command: gettime

Returns the server times for the requested calids.

Command: get_userprefs

Returns user preferences and some server settings. 

Command: import

Imports a calendar from a file to a user’s calendar. 

Command: list

Lists all calendars owned by a user. 

Command: list_subscribed

Lists all calendars subscribed to by a user. 

Command: login

Authenticates a user and redirects to first HTML view. 

Command: logout

Terminates the current user’s session and return to login screen. 

Command: ping

Administrator only: Pings the calendar server. 

Command: search_calprops

Searches for a calendar with the specified parameter values. 

Command: set_calprops

Sets calendar properties. 

Command: set_userprefs

Sets user preferences. 

Command: storeevents

Stores events that are specified in application or URL encoded manner. For storing an even by passing properties in a URL. 

Command: storetodos

Stores todos that are specified in the application or URL encoded manner. 

Command: subscribe_calendars

Adds calendars to a users subscription list. 

Command: unsubscribe_calendars

Removes calendars from a user’s subscription list. 

Command: verifyevents_by_ids

Fetches events and returns the uid or rid of events not in the database.

Command: verifytodos_by_ids

Fetches todos and returns the uid or rid of todos not in the database.

Command: version

Returns the WCAP version that the server supports. 

Session Identifiers

For many WCAP commands, you must specify the session identifier (id) that is returned by the login command. The session identifier ensures that data is accessible only to authenticated users with the required level of privilege or ownership.

When logging into the system, a user provides authentication of identity. The default authentication mechanism uses plain-text passwords and user names. Calendar Server generates the session identifier only when authentication is successful. The identifier then serves as proof of authentication in subsequent calendaring operations.

You can customize the authentication mechanism to use a local or external authentication scheme, see API: csIAccessControl.

For more information about how to configure authentication, see chapter 10 in the Calendar Server Administration Guide: Sun Java System Calendar Server 6 2005Q4 Administration Guide.

Hosted (Virtual) Domain Mode

If you are using hosted (virtual) domains, all WCAP commands you issue must have fully qualified user ID's (uid) and calendar ID's (calid), for example jdoe@example.com.

In order to be in hosted domain mode, several parameters in the ics.conf file must be configured as specified in chapter 12 in the Calendar Server Administration Guide: Sun Java System Calendar Server 6 2005Q4 Administration Guide.

See your Calendar Server administrator if you do not know whether you are using hosted domains.

The following two example WCAP commands demonstrate the difference between calid values for non-hosted domain mode and hosted domain mode.

Non-hosted domain mode:


http://webcalendarserver/get_userprefs.wcap
                    ?id=b5q2o8ve2rk02nv9t6
                    &calid=jdoe
                    &fmt-out=text/calendar

In hosted domain mode:

http://webcalendarserver/get_userprefs.wcap
                    ?id=b5q2o8ve2rk02nv9t6
                    &calid=jdoe@example.com
                    &fmt-out=text/calendar

Command Formats

Plug-in architecture allows Calendar Server to support multiple command formats. Depending on your needs, you can use a variety of data formats for both clients and server.

WCAP uses HTTP, and follows the standards defined by the WC3 URL specifications.

WCAP in Calendar Server consists calendar data formatted as XML or iCalendar, communicated as HTML documents over HTTP on both the client and server side. Refer to the Calendar Server Release Notes for recommended browser versions for client interfaces.


Note –

The number of characters that can be passed in for each parameter is limited to 1024 characters.


Client Request Formats

Clients submit command requests to the Calendar Server in either Universal Resource Identifier (URI) data format, or with one of three HTML forms.

Command Format  

Description  

URI 

Requests from client submitted using standard URI syntax. 

HTML Form - urlencoded

Requests from client submitted as encoded URL's. 

HTML Form - text/xml

Requests from client submitted using objects formatted as XML. 

HTML Form - text/calendar

Requests from client submitted using objects formatted as iCalendar. 

URI Format

Use the following format to submit a URI request:

http://webcalendarserver/COMMAND?PARAM=VAL&PARAM=VAL...

Multiple items are delimited by semicolons. If a string contains a semicolon character, replace the semicolon with its quoted-printable equivalent, %3B. For example, to represent the string “gh;i” in a list of ID's, use the following:


http://webcalendarserver/fetchcomponents_by_range.wcap?
               uid=abc;def;gh%3bi;jkl

See also Chapter 6, WCAP Common Topics

HTML Form

Submit a form with method=[GET|POST] and action=command (where command is the command to execute). Parameters need to be formatted as specified in the encoding.


Note –

The maximum length for WCAP parameters is 1024 characters.


Client Side Event Notification

All client side JavaScript code in the parent frame of the response page is required to implement a method called CalcommandCallback(), where command is the name of the command requested. This callback is invoked when the HTML response has completed loading.

When used with HTTP GET, commands are for data retrieval.

When used with HTTP POST, commands are for data modifications, including creation or deletion.

Server Response Formats

Calendar Server responds to client requests by serving HTML containing either iCalendar or XML objects. You can configure a response format preference for a server, a user, or an individual request.