aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/cal-client')
-rw-r--r--calendar/cal-client/cal-client.c114
-rw-r--r--calendar/cal-client/cal-client.h5
-rw-r--r--calendar/cal-client/cal-listener.c1
-rw-r--r--calendar/cal-client/client-test.c118
-rw-r--r--calendar/cal-client/test.ics318
5 files changed, 441 insertions, 115 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 5704769f7c..88685dd1aa 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -32,9 +32,6 @@
#include "cal-client.h"
#include "cal-listener.h"
-#include "cal-util/icalendar-save.h"
-#include "cal-util/icalendar.h"
-
/* Loading state for the calendar client */
@@ -272,6 +269,7 @@ cal_client_destroy (GtkObject *object)
priv->load_state = LOAD_STATE_NOT_LOADED;
g_free (priv);
+ client->priv = NULL;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -598,21 +596,22 @@ cal_client_get_n_objects (CalClient *client, CalObjType type)
/**
* cal_client_get_object:
* @client: A calendar client.
- * @uid: Unique identifier for a calendar object.
- * @ico: Return value for the calendar object.
+ * @uid: Unique identifier for a calendar component.
+ * @comp: Return value for the calendar component object.
*
- * Queries a calendar for a calendar object based on its unique identifier.
+ * Queries a calendar for a calendar component object based on its unique
+ * identifier.
*
* Return value: Result code based on the status of the operation.
**/
CalClientGetStatus
-cal_client_get_object (CalClient *client, const char *uid, iCalObject **ico)
+cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
{
CalClientPrivate *priv;
CORBA_Environment ev;
Evolution_Calendar_CalObj calobj_str;
CalClientGetStatus retval;
- CalObjFindStatus status;
+ icalcomponent *icalcomp;
g_return_val_if_fail (client != NULL, CAL_CLIENT_GET_NOT_FOUND);
g_return_val_if_fail (IS_CAL_CLIENT (client), CAL_CLIENT_GET_NOT_FOUND);
@@ -621,10 +620,10 @@ cal_client_get_object (CalClient *client, const char *uid, iCalObject **ico)
g_return_val_if_fail (priv->load_state == LOAD_STATE_LOADED, CAL_CLIENT_GET_NOT_FOUND);
g_return_val_if_fail (uid != NULL, CAL_CLIENT_GET_NOT_FOUND);
- g_return_val_if_fail (ico != NULL, CAL_CLIENT_GET_NOT_FOUND);
+ g_return_val_if_fail (comp != NULL, CAL_CLIENT_GET_NOT_FOUND);
retval = CAL_CLIENT_GET_NOT_FOUND;
- *ico = NULL;
+ *comp = NULL;
CORBA_exception_init (&ev);
calobj_str = Evolution_Calendar_Cal_get_object (priv->cal, uid, &ev);
@@ -637,68 +636,36 @@ cal_client_get_object (CalClient *client, const char *uid, iCalObject **ico)
goto out;
}
- status = ical_object_find_in_string (uid, calobj_str, ico);
+ icalcomp = icalparser_parse_string (calobj_str);
CORBA_free (calobj_str);
- switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
- retval = CAL_CLIENT_GET_SUCCESS;
- break;
-
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ if (!icalcomp) {
retval = CAL_CLIENT_GET_SYNTAX_ERROR;
- break;
+ goto out;
+ }
- case CAL_OBJ_FIND_NOT_FOUND:
- retval = CAL_CLIENT_GET_NOT_FOUND;
- break;
+ *comp = cal_component_new ();
+ if (!cal_component_set_icalcomponent (*comp, icalcomp)) {
+ icalcomponent_free (icalcomp);
+ gtk_object_unref (GTK_OBJECT (*comp));
+ *comp = NULL;
- default:
- g_assert_not_reached ();
+ retval = CAL_CLIENT_GET_SYNTAX_ERROR;
+ goto out;
}
+ retval = CAL_CLIENT_GET_SUCCESS;
+
out:
CORBA_exception_free (&ev);
return retval;
-#if 0
- icalcomponent* comp = NULL;
- icalcomponent *subcomp;
- iCalObject *ical;
-
- /* convert the string into an iCalObject */
- (*ico) = NULL;
- if (obj_str == NULL) return CAL_CLIENT_GET_SYNTAX_ERROR;
- comp = icalparser_parse_string (obj_str);
- free (obj_str);
- if (!comp) return CAL_CLIENT_GET_SYNTAX_ERROR;
- subcomp = icalcomponent_get_first_component (comp, ICAL_ANY_COMPONENT);
- if (!subcomp) return CAL_CLIENT_GET_SYNTAX_ERROR;
-
- while (subcomp) {
- ical = ical_object_create_from_icalcomponent (subcomp);
- if (ical->type != ICAL_EVENT &&
- ical->type != ICAL_TODO &&
- ical->type != ICAL_JOURNAL) {
- g_warning ("Skipping unsupported iCalendar component");
- } else {
- if (strcasecmp (ical->uid, uid) == 0) {
- (*ico) = ical;
- (*ico)->ref_count = 1;
- return CAL_CLIENT_GET_SUCCESS;
- }
- }
- subcomp = icalcomponent_get_next_component (comp,
- ICAL_ANY_COMPONENT);
- }
-#endif
}
-
-
-CalClientGetStatus cal_client_get_uid_by_pilot_id (CalClient *client,
- unsigned long pilot_id,
- char **uid)
+CalClientGetStatus
+cal_client_get_uid_by_pilot_id (CalClient *client,
+ unsigned long pilot_id,
+ char **uid)
{
CalClientPrivate *priv;
CORBA_Environment ev;
@@ -897,6 +864,7 @@ cal_client_get_events_in_range (CalClient *client, time_t start, time_t end)
return events;
}
+#if 0
/* Translates the CORBA representation of an AlarmType */
static enum AlarmType
uncorba_alarm_type (Evolution_Calendar_AlarmType corba_type)
@@ -919,6 +887,7 @@ uncorba_alarm_type (Evolution_Calendar_AlarmType corba_type)
return ALARM_DISPLAY;
}
}
+#endif
/* Builds a GList of CalAlarmInstance structures from the CORBA sequence */
static GList *
@@ -938,7 +907,9 @@ build_alarm_instance_list (Evolution_Calendar_CalAlarmInstanceSeq *seq)
ai = g_new (CalAlarmInstance, 1);
ai->uid = g_strdup (corba_ai->uid);
+#if 0
ai->type = uncorba_alarm_type (corba_ai->type);
+#endif
ai->trigger = corba_ai->trigger;
ai->occur = corba_ai->occur;
@@ -1056,22 +1027,23 @@ cal_client_get_alarms_for_object (CalClient *client, const char *uid,
/**
* cal_client_update_object:
* @client: A calendar client.
- * @ico: A calendar object.
+ * @comp: A calendar component object.
*
- * Asks a calendar to update an object. Any existing object with the specified
- * UID will be replaced. The client program should not assume that the object
- * is actually in the server's storage until it has received the "obj_updated"
- * notification signal.
+ * Asks a calendar to update a component. Any existing component with the
+ * specified component's UID will be replaced. The client program should not
+ * assume that the object is actually in the server's storage until it has
+ * received the "obj_updated" notification signal.
*
- * Return value: TRUE on success, FALSE on specifying an invalid object.
+ * Return value: TRUE on success, FALSE on specifying an invalid component.
**/
gboolean
-cal_client_update_object (CalClient *client, iCalObject *ico)
+cal_client_update_object (CalClient *client, CalComponent *comp)
{
CalClientPrivate *priv;
CORBA_Environment ev;
gboolean retval;
char *obj_string;
+ const char *uid;
g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
@@ -1079,15 +1051,17 @@ cal_client_update_object (CalClient *client, iCalObject *ico)
priv = client->priv;
g_return_val_if_fail (priv->load_state == LOAD_STATE_LOADED, FALSE);
- g_return_val_if_fail (ico != NULL, FALSE);
- g_return_val_if_fail (ico->uid != NULL, FALSE);
+ g_return_val_if_fail (comp != NULL, FALSE);
retval = FALSE;
- obj_string = ical_object_to_string (ico);
+ cal_component_commit_sequence (comp);
+ obj_string = cal_component_get_as_string (comp);
+
+ cal_component_get_uid (comp, &uid);
CORBA_exception_init (&ev);
- Evolution_Calendar_Cal_update_object (priv->cal, ico->uid, obj_string, &ev);
+ Evolution_Calendar_Cal_update_object (priv->cal, uid, obj_string, &ev);
g_free (obj_string);
if (ev._major == CORBA_USER_EXCEPTION &&
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index 5dc30ddec2..e395fa2e46 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -24,6 +24,7 @@
#include <libgnome/gnome-defs.h>
#include <gtk/gtkobject.h>
+#include <cal-util/cal-component.h>
#include <cal-util/cal-util.h>
BEGIN_GNOME_DECLS
@@ -85,7 +86,7 @@ int cal_client_get_n_objects (CalClient *client, CalObjType type);
CalClientGetStatus cal_client_get_object (CalClient *client,
const char *uid,
- iCalObject **ico);
+ CalComponent **comp);
CalClientGetStatus cal_client_get_uid_by_pilot_id (CalClient *client,
unsigned long pilot_id,
@@ -105,7 +106,7 @@ gboolean cal_client_get_alarms_for_object (CalClient *client, const char *uid,
time_t start, time_t end,
GList **alarms);
-gboolean cal_client_update_object (CalClient *client, iCalObject *ico);
+gboolean cal_client_update_object (CalClient *client, CalComponent *comp);
gboolean cal_client_remove_object (CalClient *client, const char *uid);
diff --git a/calendar/cal-client/cal-listener.c b/calendar/cal-client/cal-listener.c
index 884d64e8f9..d9a028b20d 100644
--- a/calendar/cal-client/cal-listener.c
+++ b/calendar/cal-client/cal-listener.c
@@ -184,6 +184,7 @@ cal_listener_destroy (GtkObject *object)
CORBA_exception_free (&ev);
g_free (priv);
+ listener->priv = NULL;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
diff --git a/calendar/cal-client/client-test.c b/calendar/cal-client/client-test.c
index f8741f4539..7f79b58266 100644
--- a/calendar/cal-client/client-test.c
+++ b/calendar/cal-client/client-test.c
@@ -1,8 +1,29 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Evolution calendar client - test program
+ *
+ * Copyright (C) 2000 Helix Code, Inc.
+ *
+ * Author: Federico Mena-Quintero <federico@helixcode.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include <config.h>
#include <bonobo.h>
#include <gnome.h>
#include <cal-client/cal-client.h>
+
static CalClient *client1;
static CalClient *client2;
@@ -21,6 +42,26 @@ cl_printf (CalClient *client, const char *format, ...)
va_end (args);
}
+/* Dumps some interesting data from a component */
+static void
+dump_component (CalComponent *comp)
+{
+ const char *uid;
+ CalComponentText summary;
+
+ cal_component_get_uid (comp, &uid);
+
+ printf ("UID %s\n", uid);
+
+ cal_component_get_summary (comp, &summary);
+ if (summary.value)
+ printf ("\tSummary: `%s', altrep `%s'\n",
+ summary.value,
+ summary.altrep ? summary.altrep : "NONE");
+ else
+ printf ("\tNo summary\n");
+}
+
/* Lists the UIDs of objects in a calendar, called as an idle handler */
static gboolean
list_uids (gpointer data)
@@ -49,22 +90,20 @@ list_uids (gpointer data)
for (l = uids; l; l = l->next) {
char *uid;
- iCalObject *ico;
+ CalComponent *comp;
CalClientGetStatus status;
uid = l->data;
- status = cal_client_get_object (client, uid, &ico);
+ status = cal_client_get_object (client, uid, &comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
printf ("------------------------------\n");
- dump_icalobject (ico);
+ dump_component (comp);
printf ("------------------------------\n");
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
printf ("FAILED: %d\n", status);
}
-
- // cal_client_update_object (client, uid, calobj);
- // g_free (calobj);
}
}
@@ -98,32 +137,50 @@ obj_updated (CalClient *client, const char *uid, gpointer data)
cl_printf (client, "Object updated: %s\n", uid);
}
+/* Callback used when a client is destroyed */
+static void
+client_destroy_cb (GtkObject *object, gpointer data)
+{
+ if (CAL_CLIENT (object) == client1)
+ client1 = NULL;
+ else if (CAL_CLIENT (object) == client2)
+ client2 = NULL;
+ else
+ g_assert_not_reached ();
+
+ if (!client1 && !client2)
+ gtk_main_quit ();
+}
+
/* Creates a calendar client and tries to load the specified URI into it */
-static CalClient *
-create_client (const char *uri, gboolean load)
+static void
+create_client (CalClient **client, const char *uri, gboolean load)
{
- CalClient *client;
gboolean result;
- client = cal_client_new ();
- if (!client) {
+ *client = cal_client_new ();
+ if (!*client) {
g_message ("create_client(): could not create the client");
exit (1);
}
- gtk_signal_connect (GTK_OBJECT (client), "cal_loaded",
+ gtk_signal_connect (GTK_OBJECT (*client), "destroy",
+ client_destroy_cb,
+ NULL);
+
+ gtk_signal_connect (GTK_OBJECT (*client), "cal_loaded",
GTK_SIGNAL_FUNC (cal_loaded),
NULL);
- gtk_signal_connect (GTK_OBJECT (client), "obj_updated",
+ gtk_signal_connect (GTK_OBJECT (*client), "obj_updated",
GTK_SIGNAL_FUNC (obj_updated),
NULL);
printf ("Calendar loading `%s'...\n", uri);
if (load)
- result = cal_client_load_calendar (client, uri);
+ result = cal_client_load_calendar (*client, uri);
else
- result = cal_client_create_calendar (client, uri);
+ result = cal_client_create_calendar (*client, uri);
if (!result) {
g_message ("create_client(): failure when issuing calendar %s request `%s'",
@@ -131,23 +188,6 @@ create_client (const char *uri, gboolean load)
uri);
exit (1);
}
-
- return client;
-}
-
-/* Callback used when a client is destroyed */
-static void
-client_destroy_cb (GtkObject *object, gpointer data)
-{
- if (CAL_CLIENT (object) == client1)
- client1 = NULL;
- else if (CAL_CLIENT (object) == client2)
- client2 = NULL;
- else
- g_assert_not_reached ();
-
- if (!client1 && !client2)
- gtk_main_quit ();
}
#ifdef USING_OAF
@@ -195,17 +235,9 @@ main (int argc, char **argv)
exit (1);
}
- client1 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", TRUE);
- gtk_signal_connect (GTK_OBJECT (client1), "destroy",
- client_destroy_cb,
- NULL);
-
- client2 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", FALSE);
- gtk_signal_connect (GTK_OBJECT (client2), "destroy",
- client_destroy_cb,
- NULL);
+ create_client (&client1, "/cvs/evolution/calendar/cal-client/test.ics", TRUE);
+ create_client (&client2, "/cvs/evolution/calendar/cal-client/test.ics", FALSE);
bonobo_main ();
-
return 0;
}
diff --git a/calendar/cal-client/test.ics b/calendar/cal-client/test.ics
new file mode 100644
index 0000000000..128251ee11
--- /dev/null
+++ b/calendar/cal-client/test.ics
@@ -0,0 +1,318 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//hacksw/handcal//NONSGML v1.0//EN
+
+BEGIN:VEVENT
+DTSTART:19970714T170000Z
+DTEND:19970715T035959Z
+SUMMARY:Bastille Day Party
+END:VEVENT
+
+BEGIN:VEVENT
+UID:19970901T130000Z-123401@host.com
+DTSTAMP:19970901T1300Z
+DTSTART:19970903T163000Z
+DTEND:19970903T190000Z
+SUMMARY:Annual Employee Review
+CLASS:PRIVATE
+CATEGORIES:BUSINESS,HUMAN RESOURCES
+END:VEVENT
+
+BEGIN:VEVENT
+UID:19970901T130000Z-123402@host.com
+DTSTAMP:19970901T1300Z
+DTSTART:19970401T163000Z
+DTEND:19970402T010000Z
+SUMMARY:Laurel is in sensitivity awareness class.
+CLASS:PUBLIC
+CATEGORIES:BUSINESS,HUMAN RESOURCES
+TRANSP:TRANSPARENT
+END:VEVENT
+
+BEGIN:VEVENT
+UID:19970901T130000Z-123403@host.com
+DTSTAMP:19970901T1300Z
+DTSTART:19971102
+SUMMARY:Our Blissful Anniversary
+CLASS:CONFIDENTIAL
+CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION
+RRULE:FREQ=YEARLY
+END:VEVENT
+
+BEGIN:VTODO
+UID:19970901T130000Z-123404@host.com
+DTSTAMP:19970901T1300Z
+DTSTART:19970415T133000Z
+DUE:19970416T045959Z
+SUMMARY:1996 Income Tax Preparation
+CLASS:CONFIDENTIAL
+CATEGORIES:FAMILY,FINANCE
+PRIORITY:1
+STATUS:NEEDS-ACTION
+END:VTODO
+
+BEGIN:VJOURNAL
+UID:19970901T130000Z-123405@host.com
+DTSTAMP:19970901T1300Z
+DTSTART;VALUE=DATE:19970317
+SUMMARY:Staff meeting minutes
+DESCRIPTION:1. Staff meeting: Participants include Joe\, Lisa
+ and Bob. Aurora project plans were reviewed. There is currently
+ no budget reserves for this project. Lisa will escalate to
+ management. Next meeting on Tuesday.\n
+ 2. Telephone Conference: ABC Corp. sales representative called
+ to discuss new printer. Promised to get us a demo by Friday.\n
+ 3. Henry Miller (Handsoff Insurance): Car was totaled by tree.
+ Is looking into a loaner car. 654-2323 (tel).
+END:VJOURNAL
+
+BEGIN:VFREEBUSY
+ORGANIZER:MAILTO:jane_doe@host1.com
+ATTENDEE:MAILTO:john_public@host2.com
+DTSTART:19971015T050000Z
+DTEND:19971016T050000Z
+DTSTAMP:19970901T083000Z
+END:VFREEBUSY
+
+BEGIN:VFREEBUSY
+ORGANIZER:MAILTO:jane_doe@host1.com
+ATTENDEE:MAILTO:john_public@host2.com
+DTSTAMP:19970901T100000Z
+FREEBUSY;VALUE=PERIOD:19971015T050000Z/PT8H30M,
+ 19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M
+URL:http://host2.com/pub/busy/jpublic-01.ifb
+COMMENT:This iCalendar file contains busy time information for
+ the next three months.
+END:VFREEBUSY
+
+BEGIN:VFREEBUSY
+ORGANIZER:jsmith@host.com
+DTSTART:19980313T141711Z
+DTEND:19980410T141711Z
+FREEBUSY:19980314T233000Z/19980315T003000Z
+FREEBUSY:19980316T153000Z/19980316T163000Z
+FREEBUSY:19980318T030000Z/19980318T040000Z
+URL:http://www.host.com/calendar/busytime/jsmith.ifb
+END:VFREEBUSY
+
+BEGIN:VTIMEZONE
+TZID:US-Eastern
+LAST-MODIFIED:19870101T000000Z
+BEGIN:STANDARD
+DTSTART:19971026T020000
+RDATE:19971026T020000
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+TZNAME:EST
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19971026T020000
+RDATE:19970406T020000
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+END:VTIMEZONE
+
+BEGIN:VTIMEZONE
+TZID:US-Eastern
+LAST-MODIFIED:19870101T000000Z
+TZURL:http://zones.stds_r_us.net/tz/US-Eastern
+BEGIN:STANDARD
+DTSTART:19671029T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+TZNAME:EST
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19870405T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+END:VTIMEZONE
+
+BEGIN:VTIMEZONE
+TZID:US--Fictitious-Eastern
+LAST-MODIFIED:19870101T000000Z
+BEGIN:STANDARD
+DTSTART:19671029T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+TZNAME:EST
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19870405T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4;UNTIL=19980404T070000Z
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+END:VTIMEZONE
+
+BEGIN:VTIMEZONE
+TZID:US--Fictitious-Eastern
+LAST-MODIFIED:19870101T000000Z
+BEGIN:STANDARD
+DTSTART:19671029T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+TZNAME:EST
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19870405T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4;UNTIL=19980404T070000Z
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+BEGIN:DAYLIGHT
+DTSTART:19990424T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=4
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+END:VTIMEZONE
+
+BEGIN:VALARM
+TRIGGER;VALUE=DATE-TIME:19970317T133000Z
+REPEAT:4
+DURATION:PT15M
+ACTION:AUDIO
+ATTACH;FMTTYPE=audio/basic:ftp://host.com/pub/sounds/bell-01.aud
+END:VALARM
+BEGIN:VALARM
+TRIGGER:-PT30M
+REPEAT:2
+DURATION:PT15M
+ACTION:DISPLAY
+DESCRIPTION:Breakfast meeting with executive\n
+ team at 8:30 AM EST.
+END:VALARM
+
+BEGIN:VALARM
+TRIGGER:-P2D
+ACTION:EMAIL
+ATTENDEE:MAILTO:john_doe@host.com
+SUMMARY:*** REMINDER: SEND AGENDA FOR WEEKLY STAFF MEETING ***
+DESCRIPTION:A draft agenda needs to be sent out to the attendees
+ to the weekly managers meeting (MGR-LIST). Attached is a
+ pointer the document template for the agenda file.
+ATTACH;FMTTYPE=application/binary:http://host.com/templates/agen
+ da.doc
+END:VALARM
+
+BEGIN:VALARM
+TRIGGER;VALUE=DATE-TIME:19980101T050000Z
+REPEAT:23
+DURATION:PT1H
+ACTION:PROCEDURE
+ATTACH;FMTTYPE=application/binary:ftp://host.com/novo-
+ procs/felizano.exe
+END:VALARM
+
+BEGIN:VTIMEZONE
+TZID:US-Eastern
+BEGIN:STANDARD
+DTSTART:19981025T020000
+RDATE:19981025T020000
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+TZNAME:EST
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19990404T020000
+RDATE:19990404T020000
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+TZNAME:EDT
+END:DAYLIGHT
+END:VTIMEZONE
+
+BEGIN:VEVENT
+DTSTAMP:19980309T231000Z
+UID:guid-1.host1.com
+ORGANIZER;ROLE=CHAIR:MAILTO:mrbig@host.com
+ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:
+ MAILTO:employee-A@host.com
+DESCRIPTION:Project XYZ Review Meeting
+CATEGORIES:MEETING
+CLASS:PUBLIC
+CREATED:19980309T130000Z
+SUMMARY:XYZ Project Review
+DTSTART;TZID=US-Eastern:19980312T083000
+DTEND;TZID=US-Eastern:19980312T093000
+LOCATION:1CP Conference Room 4350
+END:VEVENT
+
+BEGIN:VEVENT
+DTSTAMP:19970324T1200Z
+SEQUENCE:0
+UID:uid3@host1.com
+ORGANIZER:MAILTO:jdoe@host1.com
+DTSTART:19970324T123000Z
+DTEND:19970324T210000Z
+CATEGORIES:MEETING,PROJECT
+CLASS:PUBLIC
+SUMMARY:Calendaring Interoperability Planning Meeting
+DESCRIPTION:Discuss how we can test c&s interoperability\n
+ using iCalendar and other IETF standards.
+LOCATION:LDB Lobby
+ATTACH;FMTTYPE=application/postscript:ftp://xyzCorp.com/pub/
+ conf/bkgrnd.ps
+END:VEVENT
+
+BEGIN:VTODO
+DTSTAMP:19980130T134500Z
+SEQUENCE:2
+UID:uid4@host1.com
+ORGANIZER:MAILTO:unclesam@us.gov
+ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:jqpublic@host.com
+DUE:19980415T235959
+STATUS:NEEDS-ACTION
+SUMMARY:Submit Income Taxes
+BEGIN:VALARM
+ACTION:AUDIO
+TRIGGER:19980403T120000
+ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-
+ files/ssbanner.aud
+REPEAT:4
+DURATION:PT1H
+END:VALARM
+END:VTODO
+
+BEGIN:VJOURNAL
+DTSTAMP:19970324T120000Z
+UID:uid5@host1.com
+ORGANIZER:MAILTO:jsmith@host.com
+STATUS:DRAFT
+CLASS:PUBLIC
+CATEGORIES:Project Report, XYZ, Weekly Meeting
+DESCRIPTION:Project xyz Review Meeting Minutes\n
+ Agenda\n1. Review of project version 1.0 requirements.\n2.
+ Definition
+ of project processes.\n3. Review of project schedule.\n
+ Participants: John Smith\, Jane Doe\, Jim Dandy\n-It was
+ decided that the requirements need to be signed off by
+ product marketing.\n-Project processes were accepted.\n
+ -Project schedule needs to account for scheduled holidays
+ and employee vacation time. Check with HR for specific
+ dates.\n-New schedule will be distributed by Friday.\n-
+ Next weeks meeting is cancelled. No meeting until 3/23.
+END:VJOURNAL
+
+BEGIN:VFREEBUSY
+ORGANIZER:MAILTO:jsmith@host.com
+DTSTART:19980313T141711Z
+DTEND:19980410T141711Z
+FREEBUSY:19980314T233000Z/19980315T003000Z
+FREEBUSY:19980316T153000Z/19980316T163000Z
+FREEBUSY:19980318T030000Z/19980318T040000Z
+URL:http://www.host.com/calendar/busytime/jsmith.ifb
+END:VFREEBUSY
+END:VCALENDAR