A caldav client
my $cal = Cal::DAV->new( user => $user, pass => $pass, url => $url); # the ics data will be fetched automatically if it's there # ... or you can parse some ics $cal->parse(filename => $data); # cal now has all the methods of Data::ICal # you can now monkey around with the object # saves the updated calendar $cal->save; # deletes the calendar $cal->delete; # lock the file on the server $cal->lock; # unlock the file on the server $cal->unlock # steal the lock $cal->steal_lock; # also $cal->forcefully_unlock_all # and $cal->lockdiscovery # resyncs it with the server $cal->get; # Get the underlying HTTP::DAV object my $dav = $cal->dav;
\*(C`Cal::DAV\*(C' is actually a very thin wrapper round \*(C`HTTP::DAV\*(C' and \*(C`Data::ICal\*(C' but it may gain more functionality later and, in the mean time, serves as something that
In order to test you need to define three environment variables: \*(C`CAL_DAV_USER\*(C', \*(C`CAL_DAV_PASS\*(C' and \*(C`CAL_DAV_URL_BASE\*(C' which points to a \s-1DAV\s0 collection that the user supplied has write permissions for.
It should be noted that, at the moment, I'm having problems finding a CalDAV server that allows me to create files and so I can't run all the tests.
Must have at least \*(C`user\*(C', \*(C`pass\*(C' and \*(C`url\*(C' args where \*(C`url\*(C' is the url of a remote, \s-1DAV\s0 accessible \*(C`.ics\*(C' file.
Can optionally take an \*(C`auto_commit\*(C' option. See \*(C`auto_commit()\*(C' method below.
Make a new calendar object using same arguments as \*(C`Data::ICal\*(C''s \*(C`new()\*(C' or \*(C`parse()\*(C' methods.
Does not auto save for you.
Returns 1 on success and 0 on failure.
Save the calendar back to the server (or optionally to another path).
Returns 1 on success and 0 on failure.
Delete the file on the server or optionally another url.
Returns 1 on success and 0 on failure.
Refetch the file from the sever to sync it -
Alternatively fetch an alternative url.
These will lose any local changes.
Same options as \*(C`HTTP::DAV\*(C''s \*(C`unlock\*(C'.
Same options as \*(C`HTTP::DAV\*(C''s \*(C`unlock\*(C'.
Same options as \*(C`HTTP::DAV\*(C''s \*(C`steal_lock\*(C'.
Same options as \*(C`HTTP::DAV::Response\*(C''s \*(C`lockdiscovery\*(C'.
Same options as \*(C`HTTP::DAV::Response\*(C''s \*(C`forcefully_unlock_all\*(C'.
Get the underlying \*(C`HTTP::DAV\*(C' object or, alterntively, replace it with a a new one.
Get the underlying cal object
Whether to auto save on desctruction or not.
Defaults to 0.
Same as \*(C`HTTP::DAV\*(C''s \*(C`message\*(C' function.
Same as \*(C`HTTP::DAV\*(C''s \*(C`errors\*(C' function.
Simon Wistow <[email protected]>
Copyright 2007, Simon Wistow
Released under the same terms as Perl itself.
\s-1HTTP::DAV\s0
Data::ICal
http://tools.ietf.org/html/rfc4791