1Data::ICal(3) User Contributed Perl Documentation Data::ICal(3)
2
3
4
6 Data::ICal - Generates iCalendar (RFC 2445) calendar files
7
9 use Data::ICal;
10
11 my $calendar = Data::ICal->new();
12
13 my $vtodo = Data::ICal::Entry::Todo->new();
14 $vtodo->add_properties(
15 # ... see Data::ICal::Entry::Todo documentation
16 );
17
18 # ... or
19 $calendar = Data::ICal->new(filename => 'foo.ics'); # parse existing file
20 $calendar = Data::ICal->new(data => 'BEGIN:VCALENDAR...'); # parse from scalar
21 $calendar->add_entry($vtodo);
22 print $calendar->as_string;
23
25 A Data::ICal object represents a "VCALENDAR" object as defined in the
26 iCalendar protocol (RFC 2445, MIME type "text/calendar"), as
27 implemented in many popular calendaring programs such as Apple's iCal.
28
29 Each Data::ICal object is a collection of "entries", which are objects
30 of a subclass of Data::ICal::Entry. The types of entries defined by
31 iCalendar (which refers to them as "components") include events, to-do
32 items, journal entries, free/busy time indicators, and time zone
33 descriptors; in addition, events and to-do items can contain alarm
34 entries. (Currently, Data::ICal only implements to-do items and
35 events.)
36
37 Data::ICal is a subclass of Data::ICal::Entry; see its manpage for more
38 methods applicable to Data::ICal.
39
41 new [ data => $data, ] [ filename => $file ], [ vcal10 => $bool ]
42 Creates a new Data::ICal object.
43
44 If it is given a filename or data argument is passed, then this parses
45 the content of the file or string into the object. If the "vcal10"
46 flag is passed, parses it according to vCalendar 1.0, not iCalendar
47 2.0; this in particular impacts the parsing of continuation lines in
48 quoted-printable sections.
49
50 If a filename or data argument is not passed, this just sets its
51 "VERSION" and "PRODID" properties to "2.0" (or "1.0" if the "vcal10"
52 flag is passed) and the value of the "product_id" method respectively.
53
54 Returns a false value upon failure to open or parse the file or data;
55 this false value is a Class::ReturnValue object and can be queried as
56 to its "error_message".
57
58 parse [ data => $data, ] [ filename => $file, ]
59 Parse a ".ics" file or string containing one, and populate $self with
60 its contents.
61
62 Should only be called once on a given object, and will be automatically
63 called by "new" if you provide arguments to "new".
64
65 Returns $self on success. Returns a false value upon failure to open
66 or parse the file or data; this false value is a Class::ReturnValue
67 object and can be queried as to its "error_message".
68
69 ical_entry_type
70 Returns "VCALENDAR", its iCalendar entry name.
71
72 product_id
73 Returns the product ID used in the calendar's "PRODID" property; you
74 may wish to override this in a subclass for your own application.
75
76 mandatory_unique_properties
77 According to the iCalendar standard, the following properties must be
78 specified exactly one time for a calendar:
79
80 prodid version
81
82 optional_unique_properties
83 According to the iCalendar standard, the following properties may be
84 specified at most one time for a calendar:
85
86 calscale method
87
89 Data::ICal requires Class::Accessor, Text::vFile::asData,
90 MIME::QuotedPrint, and Class::ReturnValue.
91
93 Data::ICal does not support time zone daylight or standard entries, so
94 time zone components are basically useless.
95
96 While Data::ICal tries to check which properties are required and
97 repeatable, this only works in simple cases; it does not check for
98 properties that must either both exist or both not exist, or for
99 mutually exclusive properties.
100
101 Data::ICal does not check to see if property parameter names are known
102 in general or allowed on the particular property.
103
104 Data::ICal does not check to see if nested entries are nested properly
105 (alarms in todos and events only, everything else in calendars only).
106
107 The only property encoding supported by Data::ICal is quoted printable.
108
109 There is no Data::ICal::Entry::Alarm base class.
110
111 Please report any bugs or feature requests to
112 "bug-data-ical@rt.cpan.org", or through the web interface at
113 <http://rt.cpan.org>.
114
116 Jesse Vincent "<jesse@bestpractical.com>" with David Glasser, Simon
117 Wistow, and Alex Vandiver
118
120 Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights
121 reserved.
122
123 This module is free software; you can redistribute it and/or modify it
124 under the same terms as Perl itself. See perlartistic.
125
127 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
128 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
129 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
130 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
131 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
132 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
133 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
134 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
135 NECESSARY SERVICING, REPAIR, OR CORRECTION.
136
137 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
138 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
139 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
140 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
141 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
142 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
143 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
144 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
145 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
146 DAMAGES.
147
148
149
150perl v5.12.0 2009-07-10 Data::ICal(3)