Skip Menu |

This queue is for tickets about the Net-Google-Calendar CPAN distribution.

Report information
The Basics
Id: 26737
Status: resolved
Priority: 0/
Queue: Net-Google-Calendar

People
Owner: simonw [...] cpan.org
Requestors: GIFF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Patch to allow attendees, fix recurring events
Hello, I'm using Net::Google::Calendar for a project of mine, and it's very handy. Thanks! I had a bit of trouble getting it to work with recurring events, and also needed access to information about the attendees of a meeting. This patch fixes the problems I had with recurring events, and adds a "who" method to get the attendees of a meeting. Thanks!
Subject: Net-Google-Calendar-0.8-sg.patch
Only in Net-Google-Calendar-0.8-sg/: blib diff -ur Net-Google-Calendar-0.8/lib/Net/Google/Calendar/Entry.pm Net-Google-Calendar-0.8-sg/lib/Net/Google/Calendar/Entry.pm --- Net-Google-Calendar-0.8/lib/Net/Google/Calendar/Entry.pm 2007-04-16 03:20:11.000000000 -0400 +++ Net-Google-Calendar-0.8-sg/lib/Net/Google/Calendar/Entry.pm 2007-04-26 23:35:49.000000000 -0400 @@ -5,7 +5,7 @@ use DateTime; use XML::Atom; use XML::Atom::Entry; -use XML::Atom::Util qw( set_ns first nodelist iso2dt); +use XML::Atom::Util qw( set_ns first nodelist childlist iso2dt); use base qw(XML::Atom::Entry); @@ -180,7 +180,7 @@ my $obj = shift; my($ns, $name) = @_; my $ns_uri = ref($ns) eq 'XML::Atom::Namespace' ? $ns->{uri} : $ns; - my @node = nodelist($obj->elem, $ns_uri, $name); + my @node = childlist($obj->elem, $ns_uri, $name); return @node; } @@ -242,6 +242,33 @@ } + +=head2 who + +Get the list of event invitees. + +***NOTE: Setting functionality is not yet implemented. + +Returns a list containing zero or more XML::Atom::Person objects. + + +=cut + +sub who { + my $self = shift; + + if (@_) { + die "Setting of who not yet implemented\n"; + } + my @who = map { + my $person = XML::Atom::Person->new(); + $person->email($_->getAttribute("email")); + $person->name($_->getAttribute("valueString")); + $person; + } $self->_my_getlist($self->{_gd_ns},'who'); +} + + =head2 edit_url Return the edit url of this event. @@ -325,6 +352,8 @@ eval { require Data::ICal; Data::ICal->import; + require Data::ICal::Entry::Event; + Data::ICal::Entry::Event->import; }; if ($@) { $@ = "Couldn't load Data::ICal"; @@ -347,10 +376,9 @@ return undef unless defined $string; $string =~ s!\n+$!!g; $string = "BEGIN:VEVENT\n${string}\nEND:VEVENT"; - my $vfile = Text::vFile::asData->parse_lines( split(/\n/, $string) ); + my $vfile = Text::vFile::asData->new->parse_lines( split(/\n/, $string) ); my $event = Data::ICal::Entry::Event->new(); - $event->parse_object($vfile->{objects}->[0]); return $event->{entries}->[0]; Only in Net-Google-Calendar-0.8-sg/lib/Net/Google/Calendar: Entry.pm.orig diff -ur Net-Google-Calendar-0.8/lib/Net/Google/Calendar.pm Net-Google-Calendar-0.8-sg/lib/Net/Google/Calendar.pm --- Net-Google-Calendar-0.8/lib/Net/Google/Calendar.pm 2007-04-16 03:20:11.000000000 -0400 +++ Net-Google-Calendar-0.8-sg/lib/Net/Google/Calendar.pm 2007-04-26 23:35:49.000000000 -0400 @@ -460,7 +460,7 @@ $url->path("$path"); } - $url->query_form(\%opts); + $url->query_form(%opts); my %params = $self->_auth_params; my $r = $self->{_ua}->get("$url", %params); Only in Net-Google-Calendar-0.8-sg/lib/Net/Google: Calendar.pm.orig Only in Net-Google-Calendar-0.8-sg/: Makefile Only in Net-Google-Calendar-0.8-sg/: pm_to_blib
Subject: Re: [rt.cpan.org #26737] Patch to allow attendees, fix recurring events
Date: Fri, 27 Apr 2007 11:55:23 +0100
To: via RT <bug-Net-Google-Calendar [...] rt.cpan.org>
From: Simon Wistow <simon [...] thegestalt.org>
On Thu, Apr 26, 2007 at 11:42:27PM -0400, via RT said: Show quoted text
> I had a bit of trouble getting it to work with recurring events, and > also needed access to information about the attendees of a meeting. > This patch fixes the problems I had with recurring events, and adds a > "who" method to get the attendees of a meeting.
Thanks! I've applied the recurring event patch and added an who() method although slightly modified. I want to work a little more on that before releasing it such as making sure that setting works. I also can't release this *right* now since I'm waiting on a fix in XML::Atom before rolling a new versio n. I've been told it's coming soon. Thanks again, Simon
From: GIFF [...] cpan.org
Thanks! Please update this bug or drop an email when you're ready for a new release, and I'll test it with my code to make sure everything still works.
I've just released 0.9 which contains a modifed version of your patch (it allows setting of attendees as well) as well as a bunch of other improvements. Please let me know if it doesn't work for you. Sorry about the long wait.