#
# PUT an iCal style event into the database
#
TYPE=PUT
URL=http://mycaldav/caldav.php/user1/home/AAA9318E-37D9-4319-8626-95ECD3D3B243.ics
HEADER=Content-Type: text/calendar
HEADER=User-Agent: DAVKit/2.0 (10.5.1; wrbt) iCal 3.0.1
HEAD


BEGINDATA
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//iCal 3.0//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:19900318T030000
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
TZNAME:NZST
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
TZOFFSETTO:+1300
DTSTART:20070930T020000
RRULE:FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU
TZNAME:NZDT
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:20080406T030000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU
TZNAME:NZST
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
SEQUENCE:1
TRANSP:OPAQUE
UID:AAA9318E-37D9-4319-8626-95ECD3D3B243
DTSTART;TZID=Pacific/Auckland:20071125T230000
DTSTAMP:20071123T093048Z
SUMMARY:New Event
CREATED:20071123T093048Z
DTEND;TZID=Pacific/Auckland:20071126T000000
BEGIN:VALARM
X-WR-ALARMUID:2927836F-DF85-4688-901A-9ABE442BFB62
ACTION:AUDIO
TRIGGER:-PT15M
ATTACH;VALUE=URI:Basso
END:VALARM
END:VEVENT
END:VCALENDAR
ENDDATA


QUERY
SELECT caldav_data.user_no, caldav_type, logged_user, 
       uid, dtstamp, dtstart at time zone olson_name as dtstart, dtend at time zone olson_name as dtend, due, summary, location,
       description, priority, class, transp, rrule, url,
       percent_complete, tz_id, status,
       caldav_data AS " CalDAV Data",
       calendar_item.last_modified
FROM caldav_data JOIN calendar_item USING(dav_name) JOIN timezones ON (tz_id=tzid)
WHERE caldav_data.dav_etag =
'b3e66a461ef178bd4791b2b6509bbb9d';
ENDQUERY

