Net-ICal

 view release on metacpan or  search on metacpan

BUGS  view on Meta::CPAN


RFC2445 allows user-defined properties: for example: BEGIN:VALARM 
X-FOOBAR;some string the module user wants to toss in 
... 
END:VALARM We need a way to solve this problem. It looks 
non-trivial, but at least one person has asked about it 
on reefknot-users. 

bug id: 411208
~~~~~~~~~~~~~~
Summary: Allow multiple Periods in a FreebusyItem
Submitted by: Shane Landrum (srl)                       Date: 2001-03-25 12:49
Category: Net-ICal
Assigned to: Nobody/Anonymous (nobody)                             Priority: 6

RFC2445 specifies that FREEBUSY items can have multiple 
periods attached to them; right now, we can't do that. 
We should be able to. Someone who knows more than me 
about C::MM should look at this. 

bug id: 404132

BUGS  view on Meta::CPAN

Assigned to: Martijn van Beers (lotr)                              Priority: 5

We need to work on the cross-library testing tools for 
Net::ICal that we talked about. This will be a set of 
iCal files which exercises every feature of the RFC and 
makes sure a library is consistent with the RFC. See 
the mailing list archives for more detail. 

bug id: 408531
~~~~~~~~~~~~~~
Summary: implement Freebusy
Submitted by: Shane Landrum (srl)                       Date: 2001-03-14 08:33
Category: Net-ICal
Assigned to: Shane Landrum (srl)                                   Priority: 5

We need to implement Freebusy---- checking to see when 
a given calendar has time free, for purposes of meeting 
scheduling. 

bug id: 408536
~~~~~~~~~~~~~~
Summary: Make sure that timezones work
Submitted by: Shane Landrum (srl)                       Date: 2001-03-14 08:44
Category: Net-ICal
Assigned to: Martijn van Beers (lotr)                              Priority: 5

ChangeLog.detailed  view on Meta::CPAN


2001-08-04 01:07  srl

	* Makefile.PL: Oops, Test::More has been rolled into Test::Simple
	now. Minor fix to Makefile.PL.

2001-08-04 00:59  srl

	* Makefile.PL, lib/Net/ICal/Attendee.pm, lib/Net/ICal/Component.pm,
	lib/Net/ICal/Daylight.pm, lib/Net/ICal/ETJ.pm,
	lib/Net/ICal/Event.pm, lib/Net/ICal/Freebusy.pm,
	lib/Net/ICal/FreebusyItem.pm, lib/Net/ICal/Period.pm,
	lib/Net/ICal/Property.pm, lib/Net/ICal/Recurrence.pm,
	lib/Net/ICal/Standard.pm, lib/Net/ICal/Time.pm,
	lib/Net/ICal/Timezone.pm, lib/Net/ICal/Util.pm: Now that TODO tests
	work in Test::More 0.10, I upgraded N::I's dependency on it and
	converted a lot of the failing "write this test" tests to TODO
	tests, which don't formally fail. I also did some bugfixes as I
	went along to make failing tests work.

2001-08-03 00:47  srl

ChangeLog.detailed  view on Meta::CPAN

2001-07-23 13:36  lotr

	* Makefile.PL: add some prerequisites

2001-07-23 11:10  lotr

	* examples/README: oops, forgot lunchtime.pl

2001-07-23 11:09  lotr

	* examples/: cal2fb.pl, freebusy_demo.pl, gtk_todo.pl,
	html_calendar.pl, lunchtime.pl, recurrence_test.pl, test_alarm.pl,
	test_todo.pl, testcal.pl: clean up use statements

2001-07-23 11:06  lotr

	* examples/README: put something semi-useful in README.

2001-07-23 10:49  lotr

	* t/rfc2445.t: fix up the test-filename info extracting RE

ChangeLog.detailed  view on Meta::CPAN

	tests to Property and Recurrence--- mostly stubs to flag places
	that need better tests written.
	
	Reorganized Recurrence.pm to flow more logically, sort of.  Someone
	with time on their hands should refactor it.
	
	updated the TODO.

2001-07-19 00:50  srl

	* lib/Net/: ICal.pm, ICal/Freebusy.pm, ICal/FreebusyItem.pm,
	ICal/Period.pm: Added a bunch of tests, including failing tests to
	mark where tests aren't written yet. Corrected some of Period.pm to
	bring it up to date with the newer Time.pm and Duration.pm APIs.
	
	Freebusy.pm's tests are still failing to load for reasons I don't
	understand, but FreebusyItem has some tests now.

2001-07-18 23:54  srl

	* lib/Net/ICal/Freebusy.pm: Added beginnings of tests to Freebusy.
	However, its call to N::I::Util->create_uuid is failing because of
	create_uuid's assumptions about how it gets called. The error I'm
	getting is:
	
	Can't use string ("Net::ICal::Util") as a HASH ref while "strict
	refs" in use at lib/Net/ICal/Util.pm line 67.
	
	Writing further tests for Freebusy would be great, but there's not
	much to test until someone adds more validation routines.

2001-07-18 23:32  srl

	* lib/Net/ICal/: Alarm.pm, Calendar.pm, Event.pm: Added some basic
	tests for Alarm, Calendar, and Event. Look particularly at the
	Event module's last test for a way to test ical output.  Thanks to
	Michael Schwern for suggesting that approach.

2001-07-18 23:31  srl

ChangeLog.detailed  view on Meta::CPAN


	* test-data/rfc2445/4/8/2/: 1/1-pass-correct.ics, 1/2-fail-utc.ics,
	3/1-pass-due-datetime.ics, 3/2-pass-due-date.ics,
	3/3-fail-due-date.ics, 3/4-fail-invalid-due-time.ics: Add a few
	more tests to the parsing test suite. Some are supposed to fail
	since they uncover bugs :)

2001-07-09 10:35  lotr

	* lib/Net/ICal/: Attendee.pm, Component.pm, ETJ.pm, Event.pm,
	Freebusy.pm, Journal.pm, Todo.pm: Big validation commit featuring:
	* move of errlog list to Component * some validation code in the
	_parse_lines callback * validate at the end of _parse_lines, and
	move the list of parse	 errors to a listref in $@ if the
	validation failed * use of Net::ICal::Util create_uuid for
	generating the uid in ETJ and	Freebusy * an _init in ETJ to call
	from new to do automatic setting of properties	 like uid and
	dtstamp. This can't go in _create, since that gets called   from
	new_from_ical too * cleanup of map definitions so the differences
	between Event, Todo and   Journal are taken care of better *
	validate running after _create, and working on the object instead
	of   the args hash, so it can be called from new_from_ical too *
	some vi modelines and a bit of indenting cleanup *
	removed/commented out/modified some tests

2001-07-09 08:37  lotr

ChangeLog.detailed  view on Meta::CPAN

	changes.  I'm expecting some breakage but I thought it was better
	to commit them than not.

2001-07-02 16:43  lotr

	* t/time.t: fix for new Time.pm

2001-06-30 16:44  lotr

	* lib/Net/ICal/: Alarm.pm, Calendar.pm, Component.pm, Duration.pm,
	Event.pm, Freebusy.pm, FreebusyItem.pm, Journal.pm, Period.pm,
	Property.pm, Recurrence.pm, Time.pm, Todo.pm: - remove 'use
	UNIVERSAL' where not used - remove the qw(isa) bit, and use
	UNIVERSAL::isa ($foo, $class); instead

2001-06-30 16:42  lotr

	* lib/Net/ICal/: Attendee.pm, ETJ.pm, Trigger.pm: clean up existing
	tests a bit and add first rudimentary tests for Trigger

2001-06-30 15:14  lotr

ChangeLog.detailed  view on Meta::CPAN

	* lib/Net/ICal/Time.pm: Reverting to 1.6 version but retaining
	history.

2001-05-22 02:54  coral

	* lib/Net/ICal/Todo.pm: a Todo requires an organizer. Check added
	to validate routine.

2001-05-22 02:43  coral

	* lib/Net/ICal/Freebusy.pm: When the GUID code was pasted from
	ETJ.pm someone forgot a couple things ($count, $date). It's fixed.

2001-05-22 02:29  coral

	* lib/Net/ICal/Duration.pm: BUG #426149 Should be
	$self->method($args), not $args->method($args). Oops. Thanks,
	anonymous.

2001-05-14 23:18  srl

	* lib/Net/ICal/: Event.pm, Freebusy.pm: Added some more pointers to
	sourceforge bugs.
	
	Added a UID generation routine to Freebusy.pm. There's a similar
	one in ETJ.pm; they should probably both be pulled out to a utility
	module somewhere.

2001-05-14 22:51  srl

	* lib/Net/ICal/: Attendee.pm, Calendar.pm, Component.pm,
	Duration.pm, ETJ.pm: Added a bunch of references to Sourceforge bug
	tracking numbers for TODO/FIXME items that I originated.

2001-05-12 16:09  coral

	* lib/Net/: ICal.pm, ICal/Alarm.pm, ICal/Calendar.pm,
	ICal/Duration.pm, ICal/Freebusy.pm, ICal/FreebusyItem.pm,
	ICal/Journal.pm, ICal/Period.pm, ICal/Recurrence.pm, ICal/Time.pm,
	ICal/Trigger.pm: Ran podchecker on all files; all errors fixed, two
	or three warnings of no concern to us remain (duplicate =items).

2001-05-12 12:57  coral

	* lib/Net/ICal/: Alarm.pm, Attendee.pm, Calendar.pm, Component.pm,
	Duration.pm, ETJ.pm, Event.pm, Freebusy.pm, FreebusyItem.pm,
	Journal.pm, Period.pm, Property.pm, Recurrence.pm, Time.pm,
	Todo.pm, Trigger.pm: Switched over to 'use base' instead of
	modifying @ISA; this also corrects bugs in two modules where they
	changed @ISA but forgot to use the module that had just been put
	into @ISA.

2001-05-12 12:06  coral

	* MANIFEST: Added 4.3 tests in test-data.

ChangeLog.detailed  view on Meta::CPAN

	tests would fail again, but it seemed easier to fix the bug.

2001-05-10 01:46  coral

	* lib/Net/ICal/: ETJ.pm, Recurrence.pm: Extra # nitpick, added a
	FIXME to a large comment of that topic.

2001-05-09 09:09  coral

	* lib/Net/ICal/: Alarm.pm, Attendee.pm, Calendar.pm, Component.pm,
	Duration.pm, ETJ.pm, Event.pm, Freebusy.pm, FreebusyItem.pm,
	Journal.pm, Period.pm, Property.pm, Recurrence.pm, Time.pm,
	Todo.pm, Trigger.pm: Added L<Net::ICal> to the SEE ALSO sections; a
	bit of removal of section 3 notation from L<Net::ICal(3)> links as
	well.

2001-05-09 08:36  coral

	* lib/Net/ICal/: Alarm.pm, Attendee.pm, Calendar.pm: All the
	examples use "email@address"; this isn't valid perl5 code.  Fixed.

ChangeLog.detailed  view on Meta::CPAN


	* examples/html_calendar.pl: Added copyright, whitespace,
	formatting nits.

2001-05-09 08:05  coral

	* examples/gtk_todo.pl: Updated copyright, whitespace nitpicks.

2001-05-09 08:04  coral

	* examples/freebusy_demo.pl: Added copyright notice, added # TODO:
	[DOC] entry.

2001-05-09 08:03  coral

	* examples/cal2fb.pl: Added copyright notice, a bit of
	clarification of code (commented "P60D").

2001-05-09 08:02  coral

	* t/rfc2445.t: Clarified comments, updated copyright, re-enabled

ChangeLog.detailed  view on Meta::CPAN

	- code changes
	
	rearrange the code for consistency
	
	- pod changes
	
	rearranged the pod for consistency

2001-05-05 21:34  srl

	* lib/Net/ICal/FreebusyItem.pm: Patches from coral to FreebusyItem:
	updated the licensing agreement
	
	- code changes
	
	added use UNIVERSAL qw(isa)
	
	- pod changes
	
	changed the NAME slightly

ChangeLog.detailed  view on Meta::CPAN

	
	moved a line of code below the pod where it seems to belong
	
	- pod changes
	
	moved things around to be consistent small example change - now
	it's actually perl code

2001-05-05 21:31  srl

	* lib/Net/ICal/Freebusy.pm: patches from coral to Freebusy:
	
	updated the licensing agreement
	
	- code changes
	
	rearrange the code for consistency
	
	- pod changes
	
	rearranged the pod for consistency

ChangeLog.detailed  view on Meta::CPAN

	still love to see some regression tests, but those should really go
	in t/.

2001-04-20 22:14  srl

	* lib/Net/ICal/Recurrence.pm: Fixed an occurrence of "our" which
	was causing breakage under Perl 5.005.

2001-04-20 13:35  shutton

	* examples/cal2fb.pl: Simple calender->freebusy generator.

2001-04-20 13:25  shutton

	* examples/showical.perl: * Use ::Time's format() method to display
	event times, rather than   deprecated as_localtime method.

2001-04-20 13:22  shutton

	* examples/recurrence_test.pl: Pruned this down a bit. 
	Demonstrates occurrence() method.

ChangeLog.detailed  view on Meta::CPAN


2001-04-01 01:55  srl

	* examples/: recurrence_test.pl, reply.perl, showical.perl: Cleaned
	up some of the examples so that they: - have comments explaining
	what they do - work properly out of the box.

2001-04-01 00:44  srl

	* BUGS, MANIFEST, lib/Net/ICal/Component.pm, lib/Net/ICal/ETJ.pm,
	lib/Net/ICal/Freebusy.pm, lib/Net/ICal/Period.pm,
	lib/Net/ICal/Property.pm, lib/Net/ICal/Recurrence.pm, t/rfc2445.t:
	Made a bunch of changes to make Net::ICal's make/make test process
	play nicely with Perl 5.00503. Notably:
	
	File::Find, which t/rfc2445.t was using, seems to behave
	differently between 5.00503 and 5.6.0, so I changed the test to not
	use it at all.
	
	Recurrence.pm as it was used "use warnings" and "method", which
	seem to be 5.6isms. I removed them. Let's stick to 5.005

ChangeLog.detailed  view on Meta::CPAN


	* MANIFEST: Minor changes to MANIFEST

2001-03-28 22:05  srl

	* BUGS, FAQ, MANIFEST, README, TODO: Miscellaneous cleanups in
	preparation for 0.13 release.

2001-03-25 15:37  srl

	* examples/freebusy_demo.pl, lib/Net/ICal/Freebusy.pm,
	lib/Net/ICal/FreebusyItem.pm, lib/Net/ICal/Period.pm,
	lib/Net/ICal/Property.pm: Fixed the Freebusy class to implement
	FREEBUSY lines properly. There's a new module, FreebusyItem, which
	is a Property that outputs lines like
	FREEBUSY;FBTYPE=BUSY:19970101T120000/19970101T123000 . Freebusy.pm
	handles VFREEBUSY objects. This is kind of a confusing naming
	scheme, but all the other ways I could think of were equally bad.
	
	Modified some of the as_ical adhackery in Period so that Periods
	will display properly on FREEBUSY (FreebusyItem) lines.
	
	TODO: The RFC specifies that FREEBUSY lines can contain multiple
	periods separated by commas, like this:
	FREEBUSY;FBTYPE=BUSY:19970101T120000/19970101T123000, 
	19970101T190000/19970101T210000 I haven't yet understood how C::MM
	works well enough to make this happen.

2001-03-25 13:54  srl

	* README, examples/README, lib/Net/ICal.pm,

ChangeLog.detailed  view on Meta::CPAN

	
	Documented N::I::Journal and added a test for basic Journal
	read/write in test/test_journal.pl. Journal seems to work at a
	basic level now; someone wanna write a more elaborate example?
	
	Discovered a bug in Component that was causing it to break lines in
	the middle of words; fixed the bug.

2001-03-25 03:57  srl

	* examples/freebusy_demo.pl, lib/Net/ICal/Freebusy.pm: Added POD to
	Freebusy and changed the call syntax for new() to take a hash of
	parameters.
	
	There are still some fairly significant bugs in Freebusy; it
	doesn't handle multiple FREEBUSY lines within a VFREEBUSY, and it
	doesn't handle the properties on the FREEBUSY lines properly.  I
	suspect we need a FreebusyItem class or similar. The basic code is
	there, as is the POD, so that's half the battle.

2001-03-25 01:33  srl

	* examples/freebusy_demo.pl, lib/Net/ICal/Duration.pm,
	lib/Net/ICal/ETJ.pm, lib/Net/ICal/Event.pm,
	lib/Net/ICal/Freebusy.pm, lib/Net/ICal/Period.pm,
	lib/Net/ICal/Property.pm, lib/Net/ICal/Time.pm: Miscellaneous
	cleanups preparing for the upcoming release; some docco fixes; some
	bugfixes. I'm still trying to standardize the headers.
	
	Why does Time->as_ical return strings with : at the beginning?
	That's not quite right. I tossed some ad-hackery in here in various
	places (particularly Duration and Period) that's pretty evil. It
	works, but it's ugly.
	
	While poking through docco, I ran into the Freebusy module, which
	was only vaguely sketched out in POD, but it was sketched out in a
	way that didn't make sense to me. So I implemented it. There's no
	POD yet, but I'll fix that soon.

2001-03-24 19:15  srl

	* lib/Net/ICal/Alarm.pm, lib/Net/ICal/Calendar.pm,
	lib/Net/ICal/Component.pm, lib/Net/ICal/Duration.pm, t/duration.t:
	Fixed a few bugs in Alarm.
	

ChangeLog.detailed  view on Meta::CPAN

	Started cleaning up the N::I documentation and standardizing the
	license/credits header. This is in preparation for the release of
	Net::ICal 0.13 sometime in the next few days.

2001-03-18 19:15  srl

	* FAQ, lib/Net/ICal/Component.pm, t/rfc2445.t: Made a few syntax
	cleanups so that the tests will run closer to correctly.  'make
	test' still isn't quite right though. It's still returning an error
	for me during the rfc2445.t test though: "Can't use string
	("freebusys") as a HASH ref while "strict refs" in use at
	/usr/local/lib/perl5/site_perl/5.6.0/Class/MethodMapper.pm line
	166, <CALFILE> chunk 1."
	
	Added a reference to the SF bug tracker and the BUGS file in the
	FAQ how-to-report-a-bug section.

2001-03-18 10:03  srl

	* Makefile.PL: Added a requirement for Class::MethodMapper 0.9 to
	Makefile.PL.

ChangeLog.detailed  view on Meta::CPAN

	* lib/Net/ICal/ETJ.pm: Fixed some syntax errors.

2001-02-06 13:44  lotr

	* TODO, test/testcal.pl: added some TODO items and cleaned up
	testcal.pl a bit

2001-02-06 12:36  srl

	* lib/Net/ICal/ETJ.pm, lib/Net/ICal/Event.pm,
	lib/Net/ICal/Freebusy.pm, lib/Net/ICal/Todo.pm, test/testcal.pl:
	Documented ETJ.pm more thoroughly with RFC sections and which
	properties are required in which types of object. Started templates
	for Event, Todo, and Freebusy, which are still very rough. 
	Modified output in testcal.pl so that it says that VCALENDAR input
	from ical is working now.

2001-02-06 12:06  lotr

	* lib/Net/ICal/: Alarm.pm, Component.pm, Duration.pm, Property.pm,
	Trigger.pm: - fix indenting - add a reclass domain so alarming.pl
	can work - added recursive component parsing - probably more, but I
	forget

MANIFEST  view on Meta::CPAN

ChangeLog
ChangeLog.detailed
FAQ
INSTALL
MANIFEST
Makefile.PL
README
TODO
examples/README
examples/cal2fb.pl
examples/freebusy_demo.pl
examples/gtk_todo.pl
examples/html_calendar.pl
examples/lunchtime.pl
examples/recurrence_test.pl
examples/reply.perl
examples/showical.perl
examples/test_alarm.pl
examples/test_duration.pl
examples/test_journal.pl
examples/test_todo.pl

MANIFEST  view on Meta::CPAN

examples/timezone_test.pl
lib/Net/ICal.pm
lib/Net/ICal/Alarm.pm
lib/Net/ICal/Attendee.pm
lib/Net/ICal/Calendar.pm
lib/Net/ICal/Component.pm
lib/Net/ICal/Daylight.pm
lib/Net/ICal/Duration.pm
lib/Net/ICal/ETJ.pm
lib/Net/ICal/Event.pm
lib/Net/ICal/Freebusy.pm
lib/Net/ICal/FreebusyItem.pm
lib/Net/ICal/Journal.pm
lib/Net/ICal/Period.pm
lib/Net/ICal/Property.pm
lib/Net/ICal/Recurrence.pm
lib/Net/ICal/Standard.pm
lib/Net/ICal/Time.pm
lib/Net/ICal/Timezone.pm
lib/Net/ICal/Todo.pm
lib/Net/ICal/Trigger.pm
lib/Net/ICal/Util.pm

TODO  view on Meta::CPAN

- grab any bug off the BUGS list for Date::ICal and fix it. Net::ICal
uses Date::ICal extensively.

Major components:

- VCALENDAR (half-done)
- VALARM - (done? part-done?); see Alarm.pm.
- VEVENT - in progress; see Event.pm. 
- VTODO - in progress; see Todo.pm.
- VJOURNAL - in progress; see Journal.pm.
- VFREEBUSY - in progress; see Freebusy.pm.
- VTIMEZONE - not yet functional; see Time.pm and Date::ICal.

- handle METHOD, which is a property of a VCALENDAR that specifies
whether this calendar is a request for an event, a response to a request,
or what. See RFC 2446 (iTIP) and Calendar.pm's method property.
Net::ITIP is probably what you want to look at; it's in the Reefknot
CVS (see links from http://reefknot.sf.net).

Other pieces, smaller subtasks of the above, roughly in priority order:

examples/README  view on Meta::CPAN

README for Net::ICal examples

* cal2fb.pl
   Converts a calendar to a list of times you're free and busy.
   This is in flux, as Freebusy.pm is half-rewritten. 

* freebusy_demo.pl
   Also in flux.
   
* gtk_todo.pl
   You'll need Gnome.pm, Gtk.pm,  and Date::Parse for this

* html_calendar.pl
   You'll need CGI and HTML::CalendarMonthSimple for this

* lunchtime.pl
   Supposed to be a timezone demo; shows what your local lunchtime

examples/cal2fb.pl  view on Meta::CPAN

# modified under the same terms as perl itself. ( Either the Artistic
# License or the GPL. )
#
# $Id: cal2fb.pl,v 1.5 2001/07/24 11:43:48 lotr Exp $
#
# (C) COPYRIGHT 2000-2001, Reefknot developers.
#
# See the AUTHORS file included in the distribution for a full list.
#======================================================================

# Demo of how to use freebusys.

use strict;

use lib '../lib';
use IO::File;

use Net::ICal;

sub help {
    my $help = <<EOH;

examples/cal2fb.pl  view on Meta::CPAN


# open the iCalendar file
my $calfh = IO::File->new($calfile, 'r') || die "can't open $calfile: $!\n";
my $caldata;
$calfh->read($caldata, -s $calfile);
$calfh->close();

# read the calendar file in to make a Calendar object. 
my $cal = Net::ICal::Calendar->new_from_ical($caldata);

my @busyperiods;
my $now = Net::ICal::Time->new(epoch => time());
my $dur = Net::ICal::Duration->new($durstr);
my $rperiod = Net::ICal::Period->new($now, $now->add($dur));

if (my $ar_events = $cal->events) {
  foreach my $event (@$ar_events) {
    my $status = $event->status || 'BUSY';
    # Ignore cancelled events
    next if $status eq 'CANCELLED';
    my $fbtype = $status eq 'TENTATIVE' ? 'BUSY-TENTATIVE' : 'BUSY';
    foreach my $period (@{$event->occurrences($rperiod)}) {
      next unless ref($period) eq 'Net::ICal::Period';
      my $start = $period->start->timezone('UTC');
      my $end   = $period->end->timezone('UTC');
      # Make sure that we have a period with a fixed start/end
      # rather than one with a period
      $period = Net::ICal::Period->new($period->start, $period->end);
      $period->start->timezone('UTC');
      my $fbitem = Net::ICal::FreebusyItem->new($period);
      $fbitem->fbtype($fbtype);
      push(@busyperiods, $fbitem);
    }
  }
}

my $organizer = Net::ICal::Attendee->new($ENV{USER});
my $dtstamp   = Net::ICal::Time->new(epoch => time(), timezone => 'UTC');

my $fbs = Net::ICal::Freebusy->new(freebusy => \@busyperiods,
                                   organizer => $organizer,
				   dtstamp => $dtstamp,
				   dtstart => $rperiod->start,
				   dtend   => $rperiod->end);
my $fbcal = Net::ICal::Calendar->new(freebusys => [$fbs]);
print $fbcal->as_ical;

examples/freebusy_demo.pl  view on Meta::CPAN

#!/usr/bin/perl -w
# -*- Mode: perl -*-
#======================================================================
#
# This package is free software and is provided "as is" without
# express or implied warranty.  It may be used, redistributed and/or
# modified under the same terms as perl itself. ( Either the Artistic
# License or the GPL. )
#
# $Id: freebusy_demo.pl,v 1.5 2001/07/23 15:09:50 lotr Exp $
#
# (C) COPYRIGHT 2000-2001, Reefknot developers.
#
# See the AUTHORS file included in the distribution for a full list.
#======================================================================

# Demo of how to use freebusys.

use strict;

use lib '../lib';
use Net::ICal;

my $p1 = new Net::ICal::Period("19970101T120000","19970101T123000");
my $p2 = new Net::ICal::Period("19970101T133000","19970101T140000");

my $item1 = new Net::ICal::FreebusyItem($p1, (fbtype => 'BUSY'));
my $item2 = new Net::ICal::FreebusyItem($p2, (fbtype => 'BUSY'));

# TODO: we ought to be able to do things like:
my $item3 = new Net::ICal::FreebusyItem([$p1, $p2], (fbtype => 'BUSY'));
# so that both items show up on the same line. This will require C::MM voodoo;
# right now it just returns an error.

my $f = new Net::ICal::Freebusy(freebusy => [$item1, $item2], comment => 'foo');

# TODO: [DOC] why is this commented out?
#my $t = new Net::ICal::Trigger (new Net::ICal::Time ('20000101T073000'));

print $f->as_ical . "\n";

lib/Net/ICal.pm  view on Meta::CPAN

# See the AUTHORS file included in the distribution for a full list.
#======================================================================

use Net::ICal::Alarm;     
use Net::ICal::Attendee;
use Net::ICal::Calendar;
use Net::ICal::Component;
use Net::ICal::Duration;
use Net::ICal::ETJ;
use Net::ICal::Event;
use Net::ICal::Freebusy;
use Net::ICal::Journal;
use Net::ICal::Period;
use Net::ICal::Property;
use Net::ICal::Recurrence;
use Net::ICal::Time;     
use Net::ICal::Todo;
use Net::ICal::Trigger;
use Net::ICal::Util;

$VERSION = "0.15";

lib/Net/ICal.pm  view on Meta::CPAN

=item *

Net::ICal::ETJ

=item *

Net::ICal::Event

=item *

Net::ICal::Freebusy

=item *

Net::ICal::Journal

=item *

Net::ICal::Period

=item *

lib/Net/ICal/Calendar.pm  view on Meta::CPAN

#=======================================================================

sub new {
    my ($class, %args) = @_;


   # one of the following has to be defined. 
   return undef unless ( defined $args{'events'}    ||
			 defined $args{'journals'}  ||
   			 defined $args{'todos'}  ||
 		 	 defined $args{'freebusys'} ||
   			 defined $args{'timezones'} );		
    #use Data::Dumper;
    #print Dumper %args;			
    my $self = &_create ($class, %args);

    # set here instead of in the map so we can read in other stuff
    # in new_from_ical and still check for duplicates by testing
    # for undef
    $self->version ('2.0');
    # TODO: find out what we have to do to make sure this is unique.

lib/Net/ICal/Calendar.pm  view on Meta::CPAN

    },
    
    journals => {	# RFC 2445 4.6.3
	  type => 'parameter',
	  doc => 'my notes',
	  domain => 'ref',
	  options => 'ARRAY',
	  value => undef,
    },
    
    freebusys => {	# RFC2445 4.6.4
	  type => 'parameter',
	  doc => 'when am i free or busy?',
	  domain => 'ref',
	  options => 'ARRAY',
	  value => undef,
    },
    
    timezones => {	# RFC2445 4.6.5
	  type => 'parameter',
	  doc => 'when am i free or busy?',
	  domain => 'ref',
	  options => 'ARRAY',
	  value => undef,
    },
    
    alarms => {	# RFC2445 4.6.6
	  type => 'parameter',
	  doc => 'warn me when some things happen',
	  domain => 'ref',
	  options => 'ARRAY',

lib/Net/ICal/Freebusy.pm  view on Meta::CPAN

#!/usr/bin/perl -w
# vi:sts=4:shiftwidth=4
# -*- Mode: perl -*-
#======================================================================
#
# This package is free software and is provided "as is" without
# express or implied warranty.  It may be used, redistributed and/or
# modified under the same terms as perl itself. ( Either the Artistic
# License or the GPL. )
#
# $Id: Freebusy.pm,v 1.16 2001/08/04 04:59:36 srl Exp $
#
# (C) COPYRIGHT 2000-2001, Reefknot developers.
#
# See the AUTHORS file included in the distribution for a full list.
#======================================================================

=head1 NAME

Net::ICal::Freebusy -- Freebusy class

=cut

package Net::ICal::Freebusy;
use strict;

use base qw(Net::ICal::Component);

use Carp;
use Net::ICal::Period;
use Net::ICal::Property;
use Net::ICal::Util qw(:all);

# TODO, BUG 424142: this documentation needs expanding. 

=head1 DESCRIPTION

Net::ICal::Freebusy represents a list of time when someone's
free or busy. Freebusy elements can be used in three ways:

=over 4

=item * To request information about a user's open schedule slots 

=item * To reply to a request for free/busy information

=item * To publish a user's list of free/busy information. 

=back

=head1 SYNOPSIS

  use Net::ICal::Freebusy;

  my $p = new Net::ICal::Period("19970101T120000","19970101T123000");
  my $q = new Net::ICal::Period("19970101T124500","19970101T130000");

  # syntax which works now
  my $f = new Net::ICal::Freebusy(freebusy => [$p], 
                                  organizer => 'alice@wonderland.com');

  # FIXME, BUG 424144: 
  #  you should be able to say this, but it doesn't work now
  my $f = new Net::ICal::Freebusy(freebusy => [$p, $q], 
                                  organizer => 'alice@wonderland.com');


=head1 BASIC METHODS

=head2 new (options_hash)

Creates a new Freebusy element. Arguments should be specified 
as elements in a hash. 

When making a request for information about a user's free/busy time,
arguments can be any of the following:

=over 4

=item * contact - who to contact about this 

=item * dtstart - beginning of the window of time we want info about

=item * dtend - end of the window of time we want info about. 

=item * duration - how large a block of time we want to know about. 

=item * dtstamp - when this request was created

=item * organizer - user who wants information about free/busy times

=item * uid - a unique identifier for this request. 

=item * url - a URL with more information about this request

=item * attendee - which users' schedules we want info about; an array of Attendee objects

=item * comment - a comment about this request. 

=item * freebusy - allowed but meaningless. 

=item * request_status - allowed but not relevant.

=back

When responding to a request for free/busy information, the arguments mean 
different things:

=over 4

=item * contact - who to contact about this list

=item * dtstart - allowed but irrelevant

=item * dtend - allowed but irrelevant

lib/Net/ICal/Freebusy.pm  view on Meta::CPAN

=item * organizer - allowed but irrelevant

=item * uid - a unique identifier for this response. 

=item * url - a URL with more information about this response.

=item * attendee - the user responding to the request

=item * comment - a comment about this response.

=item * freebusy - an array of Durations that are free. Right now, only one Duration is allowed, This will be fixed.

=item * request_status - a number representing the success or failure of the request. See RFC2445 4.8.8.2.

=back

When publishing information about busy time to other users, the
parameters have the following meanings:

=over 4

=item * contact - who to contact about this list

=item * dtstart - Beginning date of this range of published free/busy time

=item * dtend - End date of this range of published free/busy time

=item * duration - allowed but irrelevant (?)

=item * dtstamp - when this information was published

=item * organizer - The calendar user associated with this free/busy info

=item * uid - a unique identifier for this publication of free/busy info. 

=item * url - a URL with more information about this published free/busy.

=item * attendee - allowed but irrelevant.

=item * comment - a comment about this publication.

=item * freebusy - an array of Durations that are free. Right now, only one Duration is allowed, This will be fixed.

=item * request_status - allowed but irrelevant.

=back

=begin testing

use Net::ICal::Attendee;
use Net::ICal::Freebusy;

my $f = Net::ICal::Freebusy->new();
ok(!defined($f), "new() with no arguments fails");

# TODO: add tests and make the first test pass.
#   That probably means adding in some real validation in the code.

my $p = new Net::ICal::Period("19970101T120000","19970101T123000");

# NOTE: this test should be compared to FreebusyItem to make sure it's sane.
#  I'm not at all sure it is. --srl

$f = Net::ICal::Freebusy->new(freebusy => [$p], 
                             organizer => Net::ICal::Attendee->new('mailto:alice@wonderland.com'));
ok(defined($f), "new() with 1 fbitem and an organizer succeeds");

my $f_ical = $f->as_ical;

my $f2 = Net::ICal::Freebusy->new_from_ical($f_ical);

ok($f2->as_ical eq $f->as_ical, 
    'reading in our output results in an identical object');

=end testing

=cut

#============================================================================
sub new {

lib/Net/ICal/Freebusy.pm  view on Meta::CPAN

	$self->uid (create_uuid);
    }
    return undef unless ($self->validate);

    return $self;
}

#=================================================================================
=head2 new_from_ical ($text)

Takes iCalendar text as a parameter; returns a Net::ICal::Freebusy object. 

=cut

# new_from_ical is inherited from Net::ICal::Component.
# TODO, BUG 424143: this needs a test case done to prove that it works. 


#==================================================================================
# make sure that this object has the bare minimum requirements specified by the RFC,
my $count = 0;

lib/Net/ICal/Freebusy.pm  view on Meta::CPAN

	  type => 'parameter',
	  doc => '',
	  domain => 'ref',
	  options => 'Net::ICal::Time',
	  value => undef,
	  # TODO, BUG 424118: 
      # This is the date/time this object was created; should we
	  # set it by default if the user doesn't set it?
	  # Does this have to be in UTC?
   	},
    freebusy => {
	  type => 'parameter',
	  doc => 'one or more Net::ICal::Periods',
	  domain => 'ref',
	  options => 'ARRAY',
      # TODO, BUG 424144: 
      # we need to support multiple FREEBUSY lines, as well as multiple
      # Periods inside each FREEBUSY line. This very well might be an array
      # of Net::ICal::FreebusyItem objects or something. Thoughts?
      # TODO, BUG 424145: we need to be able to output lines like:
      # FREEBUSY;VALUE=PERIOD:19971015T050000Z/PT8H30M,19971015T160000Z/PT5H30M
    },
   organizer => {	# RFC2445 4.8.4.3 - REQUIRED in VFREEBUSY
                    # XXX: 4.6.4's ABNF says this is OPTIONAL. hm?
	  type => 'parameter',
	  doc => '',
	  domain => 'ref',
	  options => 'Net::ICal::Attendee',
	  value => undef,

lib/Net/ICal/FreebusyItem.pm  view on Meta::CPAN

#!/usr/bin/perl -w
# -*- Mode: perl -*-
#======================================================================
#
# This package is free software and is provided "as is" without
# express or implied warranty.  It may be used, redistributed and/or
# modified under the same terms as perl itself. ( Either the Artistic
# License or the GPL. )
#
# $Id: FreebusyItem.pm,v 1.8 2001/08/04 04:59:36 srl Exp $
#
# (C) COPYRIGHT 2000-2001, Reefknot developers.
#
# See the AUTHORS file included in the distribution for a full list.
#======================================================================

=head1 NAME

Net::ICal::FreebusyItem -- represents the FREEBUSY property for
VFREEBUSY objects.

=cut

package Net::ICal::FreebusyItem;
use strict;

use base qw(Net::ICal::Property);

use Net::ICal::Duration;
use Net::ICal::Time;

=head1 SYNOPSIS

  use Net::ICal;

  my $p1 = Net::ICal::Period->new("19970101T120000","19970101T123000");
  my $p2 = Net::ICal::Period->new("19970101T133000","19970101T140000");

  my $item1 = Net::ICal::FreebusyItem->new($p1, (fbtype => 'BUSY'));
  my $item2 = Net::ICal::FreebusyItem->new($p2, (fbtype => 'BUSY'));

  # TODO: we ought to be able to do things like:
    my $item3 = Net::ICal::FreebusyItem->new([$p1, $p2], (fbtype => 'BUSY'));
  # so that both items show up on the same line. 

=head1 DESCRIPTION

FreebusyItems are used to mark sections of time that are free to
be scheduled or that are already busy.

=head1 CONSTRUCTORS

=head2 new ($period, %options)

$period is a Net::ICal::Period object. In the future, this
will change to be an array of Periods. Valid keys for the options
hash are:

=over 4

lib/Net/ICal/FreebusyItem.pm  view on Meta::CPAN

defaults to BUSY.
BUSY means there's already something scheduled in this time slot. FREE
means that this time slot is open. BUSY-UNAVAILABLE means that this 
time slot can't be scheduled. BUSY-TENTATIVE means that this time slot
has something tentatively scheduled for it. 

=back

=begin testing

use Net::ICal::FreebusyItem;
use Net::ICal::Period;

my $p1 = Net::ICal::Period->new("19970101T120000","19970101T123000");
my $p2 = Net::ICal::Period->new("19970101T133000","19970101T140000");

my $item1 = Net::ICal::FreebusyItem->new();   # should fail
ok(!defined($item1), 'new FreebusyItem without args should fail');

$item1 = Net::ICal::FreebusyItem->new($p1, (fbtype => 'BUSY'));
my $item2 = Net::ICal::FreebusyItem->new($p2, (fbtype => 'BUSY'));

ok(defined($item1), "creation of basic freebusyitem works");

my $item1_ical = $item1->as_ical;

ok(defined ($item1_ical), 'as_ical produces a defined result');

$item1a = Net::ICal::FreebusyItem->new_from_ical($item1_ical);

ok(defined($item1a), 
    "exporting ical and reading it back in creates a defined object");

ok($item1->as_ical eq $item1a->as_ical, 
    "exporting ical and reading it back in creates an identical object");
    
TODO: {
    # TODO: we ought to be able to do things like:
    my $item3 = Net::ICal::FreebusyItem->new([$p1, $p2], (fbtype => 'BUSY'));
    # so that both items show up on the same line. 
    
    local $TODO = 'allow freebusy items to be created with arrays of periods';
    ok(defined($item3), "freebusy items can be created with arrays of periods");

};

=end testing

=cut

sub new {
  my ($class, $content, %args) = @_;

lib/Net/ICal/FreebusyItem.pm  view on Meta::CPAN

sub _create {
  my ($class, %args) = @_;

  my $map = {
    fbtype => {     # RFC2445 4.2.9
      type => 'parameter',
      doc => '',
      domain => 'enum',
      options => [qw(FREE BUSY BUSY-UNAVAILABLE BUSY-TENTATIVE)],
      # "The value FREE indicates that the time interval is free for scheduling.
      # The value BUSY indicates that the time interval is busy because one
      # or more events have been scheduled for that interval. The value
      # BUSY-UNAVAILABLE indicates that the time interval is busy and that
      # the interval can not be scheduled. The value BUSY-TENTATIVE indicates
      # that the time interval is busy because one or more events have been
      # tentatively scheduled for that interval. If not specified on a
      # property that allows this parameter, the default is BUSY." -- RFC2445
    
      # FIXME this is actually a property that goes on the same line as a FREEBUSY. 
    },
    content => {
	  type => 'volatile',
	  doc => 'the value of the trigger',
	  domain => 'reclass',
	  options => {default => 'Net::ICal::Period'},

lib/Net/ICal/FreebusyItem.pm  view on Meta::CPAN


  my $self = $class->SUPER::new ('FREEBUSY', $map, %args);
  return $self;
}

1;
__END__

=head1 SEE ALSO

L<Net::ICal::Period>, L<Net::ICal::Freebusy>. There are a lot of
semantics to handling these for real usage; see RFC2445.

More documentation can also be found in L<Net::ICal>.

=cut

test-data/rfc2445.ics  view on Meta::CPAN

DTEND:19971016T050000Z
DTSTAMP:19970901T083000Z
END:VFREEBUSY

BEGIN:VFREEBUSY
ORGANIZER:MAILTO:jane_doe@host1.com
ATTENDEE:MAILTO:john_public@host2.com
DTSTAMP:19970901T100000Z
FREEBUSY;VALUE=PERIOD:19971015T050000Z/PT8H30M,
 19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M
URL:http://host2.com/pub/busy/jpublic-01.ifb
COMMENT:This iCalendar file contains busy time information for
  the next three months.
END:VFREEBUSY

BEGIN:VFREEBUSY
ORGANIZER:jsmith@host.com
DTSTART:19980313T141711Z
DTEND:19980410T141711Z
FREEBUSY:19980314T233000Z/19980315T003000Z
FREEBUSY:19980316T153000Z/19980316T163000Z
FREEBUSY:19980318T030000Z/19980318T040000Z
URL:http://www.host.com/calendar/busytime/jsmith.ifb
END:VFREEBUSY

BEGIN:VTIMEZONE
TZID:US-Eastern
LAST-MODIFIED:19870101T000000Z
BEGIN:STANDARD
DTSTART:19971026T020000
RDATE:19971026T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500

test-data/rfc2445.ics  view on Meta::CPAN

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//RDU Software//NONSGML HandCal//EN
BEGIN:VFREEBUSY
ORGANIZER:MAILTO:jsmith@host.com
DTSTART:19980313T141711Z
DTEND:19980410T141711Z
FREEBUSY:19980314T233000Z/19980315T003000Z
FREEBUSY:19980316T153000Z/19980316T163000Z
FREEBUSY:19980318T030000Z/19980318T040000Z
URL:http://www.host.com/calendar/busytime/jsmith.ifb
END:VFREEBUSY

END:VCALENDAR



( run in 0.323 second using v1.01-cache-2.11-cpan-5f2e87ce722 )