in reply to Re^3: Using Perl to add entries in iCal Calendar (cpan secrets)
in thread Using Perl to add entries in iCal Calendar

Thanks for the replies and sorry for the late response, unfortunately vacation interrupted my work ;) I tried the code above but it gave errors: Couldn't autofetch calendar: get http://baikal.local/cal.php/principals/test/testshift failed: Not Implemented at /usr/local/share/perl/5.10.1/Cal/DAV.pm line 307. Lines around DAV.pm 307 reads :
Get the underlying cal object =cut sub cal { my $self = shift; if (!defined $self->{_cal}) { my $ret = $self->get || die "Couldn't autofetch calendar: ".$s +elf->dav->message; } return $self->{_cal}; }
Also with my script I dumped the complete stuff and found the following errors:
'_uri' => bless( do{\(my $o = 'http://baikal.local/cal.php/calendars/t +est/testshift')}, 'URI::http' ), + '_headers' => bless( { + 'user-agent' => 'DAV.pm/v0.47', + 'content-length' => 191, + 'host' => 'baikal.local:80' + }, 'HTTP::Headers' ), + '_method' => 'PUT', + '_uri_canonical' => $VAR1->{'_dav'}{'_comms'}{'_last_r +equest'}{'_uri'} + }, 'HTTP::Request' ), '_headers' => + bless( {}, 'HTTP::DAV::Headers' ), '_last_respon +se' => bless( { + '_content' => ' Sabre\\DAV\\Exception\\Conflict PUT is not allowed on non-files. 1.8.7 ', + '_protocol' => 'HTTP/1.1', + '_headers' => bless( { + 'connection' => 'close',
and
'_previous' => bless( { + '_protocol' => 'HTTP/1.1', + '_content' => ' Sabre\\DAV\\Exception\\NotAuthenticated No basic authentication headers were found 1.8.7 ', + '_rc' => '401', + '_headers' => bless( { + 'conne +ction' => 'close',
So there is any issue with not authenticating (properly) or proper handling as put does not seem to be allowed there. For whatever reason. I never dealt with caldav before, but i dont see any problems in the baikal setup itself. I connected my iPad to this and could update entries. Seems not to be an perl script issue, its more like the interaction between "cal" modules and the baikal server. The dave-Part was also not successfull:
# dave -tmpdir . -debug 3 -u test -p test "http://baikal +.local/cal.php/principals/test/" dave -- DAV Explorer (v2.00) Try "help", or "open http://host.com/dav_enabled_dir/" Setting auth details for baikal.local:80, default to 'test', 'test' new_resource: For http://baikal.local/cal.php/principals/test/, creati +ng new resource Resetting user and password for baikal.local:80, BaikalDAV Using user/pass combo: test test. For BaikalDAV, http://baikal.local/c +al.php/principals/test/ Resetting user and password for baikal.local:80, BaikalDAV Setting auth details for baikal.local:80, BaikalDAV to 'test', 'test' Resetting user and password for baikal.local:80, BaikalDAV ** Connected to http://baikal.local/cal.php/principals/test/ ** dave> get testshift Valid Command: "get" get: http://baikal.local/cal.php/principals/test/testshift -> /var/www +/nmc/shiftplan/testshift new_resource: For http://baikal.local/cal.php/principals/test/testshif +t, creating new resource Resetting user and password for baikal.local:80, BaikalDAV **Server response: Not Found dave> quit Valid Command: "quit" Bye
There are no *.ics files stored, its somehow virtual. As I am out of ideas I think i try another caldav server and see how this works out.