#
# PUT a calendar collection to user3 so we have some starting events
#
# There is no CalDAV defined behaviour for this.
#
TYPE=PUT
URL=http://mycaldav/caldav.php/User%20Six/home/
HEADER=User-Agent: RSCDS Testing/0.9.x
HEADER=Content-Type: text/calendar; charset=utf-8
AUTH=User Six:user6

HEAD

BEGINDATA
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//iCal 3.0//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Helsinki
BEGIN:DAYLIGHT
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
DTSTART:19810329T030000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:EEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
DTSTART:19961027T040000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
END:STANDARD
END:VTIMEZONE
BEGIN:VTIMEZONE
TZID:Bogus Nonstandard Time
BEGIN:DAYLIGHT
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
DTSTART:19810329T030000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:EEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
DTSTART:19961027T040000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:EET
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
SEQUENCE:3
TRANSP:OPAQUE
UID:55F6EC95-2D21-4FB9-9AE1-A6E020B44AEB
DTSTART;TZID=Europe/Helsinki:20081025T133000
DTSTAMP:20081024T200745Z
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1TU,2WE,3TH,4FR;BYMONTH=3,6,9,10,12
SUMMARY:Irregular meeting for User 3
CREATED:20081024T200734Z
DTEND;TZID=Europe/Helsinki:20081025T143000
END:VEVENT
BEGIN:VEVENT
SEQUENCE:2
TRANSP:OPAQUE
UID:174F9C2A-1223-40C4-9E06-6E91F2EA9491
DTSTART;TZID=Europe/Helsinki:20081024T084500
DTSTAMP:20081025T112653Z
SUMMARY:Dentist\'s Council meeting
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=TU,FR
CREATED:20081025T112648Z
DTEND;TZID=Europe/Helsinki:20081024T113000
END:VEVENT
BEGIN:VEVENT
SEQUENCE:1
TRANSP:OPAQUE
UID:174F9C2A-1223-40C4-9E06-6E91F2EA9491
DTSTART;TZID=Bogus Nonstandard Time:20091017T084500
DTSTAMP:20081025T112653Z
SUMMARY:Bogus Nonstandard Meeting
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=TU,FR
CREATED:20081025T112648Z
DTEND;TZID=Bogus Nonstandard Time:20091017T113000
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 "A1 CalDAV DATA"
FROM caldav_data JOIN calendar_item USING(dav_name) JOIN timezones ON (tz_id=tzid)
WHERE caldav_data.dav_name ~ '^/User Six/home/'
ENDQUERY

QUERY
SELECT count(*)
  FROM caldav_data JOIN calendar_item USING(dav_name)
  WHERE caldav_data.dav_name ~ '^/User Six/home/'
ENDQUERY

