Accessing Calendar Tool Data
Applies to: SharePoint Workspace 2010 | Visual Studio 2008
The GrooveCalendar service provides information about the events in a Calendar tool and enables the SOAP client to create new events and delete or modify existing events.
Reading Calendar Entries
The GrooveCalendar Read operation provides information about all calendar events in the tool. For each event, the Read operation provides:
Description.
Event details and category.
Starting and ending date and time of the event.
Whether the event is an all-day event.
Calendar event ID.
URI for the calendar event.
The identity of the user who created the event and the date and time that the event was created.
The identity of the user who last modified the event and the date and time that the event was modified.
Unread state of event.
The application can use the URI for the calendar event to construct an HTTP Post URL for deleting or updating a calendar event. You can also use this HTTP Post URL to read the calendar event, but the ReadEntry operation provides the same information as the Read operation.
The following example show you how to read calendar entries and access information about them:
// Create new service and header
GrooveCalendar.GrooveCalendar calendarSvc = new GrooveCalendar.GrooveCalendar();
calendarSvc.GrooveRequestHeaderValue = new GrooveCalendar.GrooveRequestHeader();
// Get the Identity2 from GrooveAccounts.Read2
GrooveAccounts.Identity2 ident = ... ;
// Get the IdentityURL from Identity2
calendarSvc.GrooveRequestHeaderValue.GrooveIdentityURL = ident.URI;
// Get the request key, HTTP address, and port number.
// See examples in Reading Groove Registry Keys
string requestKey = ... ;
string HTTPAddressAndPort = ... ;
calendarSvc.GrooveRequestHeaderValue.GrooveRequestKey = requestKey;
// Get tool from GrooveTools.Read
GrooveTools.Tool tool = ... ;
// Make sure tool.Type has urn for a Calendar tool
if (tool.Type == "urn:groove.net:platform.tools.Calendar")
{
// Get the PostURL from tool.Data
calendarSvc.Url = HTTPAddressAndPort + tool.Data;
// Read all entries
GrooveCalendar.CalendarEntry[] calendarEntries = calendarSvc.Read();
for (int i = 0; i < calendarEntries.Length; i++)
{
GrooveCalendar.CalendarEntry entry = calendarEntries[i];
// Convert from UTC to local time
DateTime start = entry.Start.ToLocalTime();
DateTime end = entry.End.ToLocalTime();
bool allDay = entry.AllDay;
string description = entry.Description;
string details = entry.Details;
string entryPostURL = entry.URI;
bool unread = entry.Unread;
}
}
Creating Calendar Entries
The GrooveCalendar Create operation creates a new Calendar event. To create a new event, the application specifies:
Description.
Event details and category.
Starting and ending date and time of the event.
Whether the event is an all-day event.
The GrooveCalendar DeleteEntry operation deletes the targeted event. The HTTP Post URL of a DeleteEntry operation must be a service for a calendar event returned by the Read or ReadEntry operation.
The GrooveCalendar UpdateEntry operation updates the targeted event. The HTTP Post URL of a UpdateEntry operation must be a service for a calendar event returned by the Read or ReadEntry operation. To update an event, the application specifies:
Description.
Event details and category.
Starting and ending date and time of the event.
Whether the event is an all-day event.
The GrooveCalendar ReadEntry operation reads the specified calendar event. This operation provides the same information as the Read operation.