Data::ICal - Generates iCalendar calendar files


NAME

Data::ICal - Generates iCalendar (RFC 2445) calendar files


SYNOPSIS

    use Data::ICal;
    my $calendar = Data::ICal->new();
    my $vtodo = Data::ICal::Entry::Todo->new();
    $vtodo->add_properties(
        # ... see Data::ICal::Entry::Todo documentation
    );
    # ... or
    $calendar = Data::ICal->new(filename => 'foo.ics'); # parse existing file
    $calendar = Data::ICal->new(data => 'BEGIN:VCALENDAR...'); # parse existing file
    $calendar->add_entry($vtodo);
    print $calendar->as_string;

=head1 DESCRIPTION

A the Data::ICal manpage object represents a VCALENDAR object as defined in the iCalendar protocol (RFC 2445, MIME type ``text/calendar''), as implemented in many popular calendaring programs such as Apple's iCal.

Each the Data::ICal manpage object is a collection of ``entries'', which are objects of a subclass of the Data::ICal::Entry manpage. The types of entries defined by iCalendar (which refers to them as ``components'') include events, to-do items, journal entries, free/busy time indicators, and time zone descriptors; in addition, events and to-do items can contain alarm entries. (Currently, the Data::ICal manpage only implements to-do items and events.)

the Data::ICal manpage is a subclass of the Data::ICal::Entry manpage; see its manpage for more methods applicable to the Data::ICal manpage.


METHODS

new [ data => $data, ] [ filename => $file ]

Creates a new the Data::ICal manpage object.

If it is given a filename or data argument is passed, then this parses the content of the file or string into the object; otherwise it just sets its VERSION and PRODID properties to ``2.0'' and the value of the product_id method respectively.

Returns undef upon failure to open or parse the file or data.

parse [ data => $data, ] [ filename => $file ]

Parse a .ics file or string containing one, and populate $self with its contents.

Should only be called once on a given object, and will be automatically called by new if you provide arguments to new.

ical_entry_type

Returns VCALENDAR, its iCalendar entry name.

product_id

Returns the product ID used in the calendar's PRODID property; you may wish to override this in a subclass for your own application.

mandatory_unique_properties

According to the iCalendar standard, the following properties must be specified exactly one time for a calendar:

      prodid version

optional_unique_properties

According to the iCalendar standard, the following properties may be specified at most one time for a calendar:

      calscale method


CONFIGURATION AND ENVIRONMENT

the Data::ICal manpage requires no configuration files or environment variables.


DEPENDENCIES

the Data::ICal manpage requires the Class::Accessor manpage.


INCOMPATIBILITIES

None reported.


BUGS AND LIMITATIONS

the Data::ICal manpage does not support time zone daylight or standard entries, so time zone components are basically useless.

While the Data::ICal manpage tries to check which properties are required and repeatable, this only works in simple cases; it does not check for properties that must either both exist or both not exist, or for mutually exclusive properties.

the Data::ICal manpage does not check to see if property parameter names are known in general or allowed on the particular property.

the Data::ICal manpage does not check to see if nested entries are nested properly (alarms in todos and events only, everything else in calendars only).

the Data::ICal manpage has no automatic support for converting binary data to the appropriate encoding and setting the corresponding parameters.

There is no the Data::ICal::Entry::Alarm manpage base class.

No bugs have been reported.

Please report any bugs or feature requests to bug-data-ical-generator@rt.cpan.org, or through the web interface at http://rt.cpan.org.


AUTHOR

Jesse Vincent <jesse@bestpractical.com> with David Glasser and Simon Wistow


LICENCE AND COPYRIGHT

Copyright (c) 2005, Best Practical Solutions, LLC. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.


DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

 Data::ICal - Generates iCalendar calendar files