Mailing List Archive

Easy way to start over with a calendar?
Hello,

I am still building up my tool chest to deal with calenders (under the
hood of a web application). One thing I wanted to do is to start over
with a calendar. I could delete the calendar by sending a DELETE to the
calendar url (.../username/home) but then I couldn't recreate an empty
calendar. I tried to PUT the ICS data of another empty calendar to the
url I deleted befor but it didn't work, I had to recreate the calendar
with the admin interface.

First I would like to know if it is possible to delete and recreate a
calendar with a (Cal-)DAV command or do I have to delete every single
entry to get a fresh and empty calendar?

Second, I was surprised that I could delete the calendar at all because
at that time I did not have a
$c->readonly_webdav_collections = false;
setting in my config file, so I would expect it to be readonly and _not_
deletable. But even after I added this setting I was still not able to
recreate the calendar.

-Michael
Easy way to start over with a calendar? [ In reply to ]
On Mon, 2010-08-30 at 16:32 +0200, Michael Lackhoff wrote:
> Hello,
>
> I am still building up my tool chest to deal with calenders (under the
> hood of a web application). One thing I wanted to do is to start over
> with a calendar. I could delete the calendar by sending a DELETE to the
> calendar url (.../username/home) but then I couldn't recreate an empty
> calendar. I tried to PUT the ICS data of another empty calendar to the
> url I deleted befor but it didn't work, I had to recreate the calendar
> with the admin interface.
>
> First I would like to know if it is possible to delete and recreate a
> calendar with a (Cal-)DAV command or do I have to delete every single
> entry to get a fresh and empty calendar?
>
> Second, I was surprised that I could delete the calendar at all because
> at that time I did not have a
> $c->readonly_webdav_collections = false;
> setting in my config file, so I would expect it to be readonly and _not_
> deletable. But even after I added this setting I was still not able to
> recreate the calendar.

Hi Michael,

The DELETE method on the collection is defined by CalDAV to do what you
would expect, and what happened.

With the magic setting above you should also be able to PUT an empty
iCalendar to the collection URL and the result *should* be an empty
calendar.

The other possibility is to do the DELETE, as you did, and then follow
it with a MKCALENDAR to the same URL, which should simply create it
again. That would be the basic CalDAV solution.

The best solution would be to do an MKCOL request with an appropriate
XML document in the body. This can create the calendar and set values
such as the displayname for it, as defined in rfc5689, which DAViCal
does support.

The XML payload in the MKCOL request would look something like:

<?xml version="1.0" encoding="UTF-8" ?>
<mkcol xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<set>
<prop>
<resourcetype>
<collection/>
<C:calendar/>
</resourcetype>
<displayname>Extended MKCOL Calendar</displayname>
</prop>
</set>
</mkcol>



Cheers,
Andrew.

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You are dishonest, but never to the point of hurting a friend.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100831/b306e963/attachment.pgp>
-------------- next part --------------

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
-------------- next part --------------
_______________________________________________
rscds-general mailing list
rscds-general at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rscds-general