Mailing List Archive

Import ICS files
Hey there,

is there a nice and clean way to import an ICS file through CalDAV/Davical? I found the import_collection() function which doesn't seem to be a CalDAV standard one. This wouldn't be a problem for me, but it's somehow only invoked by the web interface. In addition it's using $_GET["appending"] for control which is quite bad.

... or is it just me reading a given file and sending all through a PUT request? This feels like a bad solution for performance. :(

Cheers
Matthias

PS: Happy New Year! :D


_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev
Re: Import ICS files [ In reply to ]
On Tue, 2012-01-03 at 12:35 +0100, Matthias Althaus wrote:
> Hey there,
>
> is there a nice and clean way to import an ICS file through
> CalDAV/Davical? I found the import_collection() function which doesn't
> seem to be a CalDAV standard one. This wouldn't be a problem for me,
> but it's somehow only invoked by the web interface. In addition it's
> using $_GET["appending"] for control which is quite bad.
>
> ... or is it just me reading a given file and sending all through a
> PUT request? This feels like a bad solution for performance. :(

Happy New Year Matthias,

Yep, it's a bad solution for performance. But it's *import* right, so
you only do it once? :-)

I'm pretty sure that the import collection via PUT and the import
collection via the web UI both end up running the same piece of code in
caldav-PUT-functions.php to do the actual work though.

And of course the import via PUT is only available if you set the
deliberately obscurely named "readonly_webdav_collection" setting to
false.

Cheers,
Andrew.

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You can get there from here, but why on earth would you want to?
------------------------------------------------------------------------
Re: Import ICS files [ In reply to ]
Hey,

> I'm pretty sure that the import collection via PUT and the import
> collection via the web UI both end up running the same piece of code in
> caldav-PUT-functions.php to do the actual work though.
They *do* run the same code, but caldav-PUT-vcalendar.php is checking $_GET['mode'] wether to append the data or replace the existing one. The web UI is just calling the function directly. Can I add a simple GET var to my Caldav PUT request? People wouldn't like getting their calendars wiped on import I guess...

> And of course the import via PUT is only available if you set the
> deliberately obscurely named "readonly_webdav_collection" setting to
> false.
Yeah... stumbled upon that somewhere checking the import code. *g*

Cheers
Matthias

_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev
Re: Import ICS files [ In reply to ]
Hey again,

> > is there a nice and clean way to import an ICS file through
> > CalDAV/Davical? I found the import_collection() function which doesn't
> > seem to be a CalDAV standard one. This wouldn't be a problem for me,
> > but it's somehow only invoked by the web interface. In addition it's
> > using $_GET["appending"] for control which is quite bad.

Is there any reason why I shouldn't just copy the code from the web UI into mine? It wouldn't be that "clean", because we couldn't replace Davical with another Caldav server, but... yeah... this prolly won't happen at all. ;)

Pro would be that we only need to upload the file once and don't pipe x KB through a PUT request again afterwards.

Cheers
Matthias
_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev
Re: Import ICS files [ In reply to ]
On Wed, 2012-01-04 at 10:49 +0100, Matthias Althaus wrote:
> Hey,
>
> > I'm pretty sure that the import collection via PUT and the import
> > collection via the web UI both end up running the same piece of code in
> > caldav-PUT-functions.php to do the actual work though.
> They *do* run the same code, but caldav-PUT-vcalendar.php is checking
> $_GET['mode'] whether to append the data or replace the existing one.
> The web UI is just calling the function directly. Can I add a simple
> GET var to my Caldav PUT request? People wouldn't like getting their
> calendars wiped on import I guess...

The ?mode=append trick is supposed to work with PUT.

Not sure I agree with the "people wouldn't like getting their calendars
wiped on import" - that seems pretty natural to me. If you're adding a
single event it's obviously wrong, but if you're importing a whole
calendar you probably do want it wiped.


> > And of course the import via PUT is only available if you set the
> > deliberately obscurely named "readonly_webdav_collection" setting to
> > false.
> Yeah... stumbled upon that somewhere checking the import code. *g*

:-)

Cheers,
Andrew.

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
What happened last night can happen again.
------------------------------------------------------------------------