iCal-Parser-SAX-1.09/0000755000076500007650000000000011032266422012650 5ustar rickrickiCal-Parser-SAX-1.09/Build.PL0000444000076500007650000000203211032266422014137 0ustar rickrickuse Module::Build; # See perldoc Module::Build for details of how this works my $prog; my $build=Module::Build->new ( module_name => 'iCal::Parser::SAX', version_from => 'iCal::Parser::SAX', license => 'perl', requires => { iCal::Parser => 1.07, IO::File => 1.10, IO::String => 1.05, XML::SAX::Base => 1.04, DateTime => 0.22, XML::SAX::Writer => 0.44, }, build_requires => { Test::More => 0.47, Test::XML => 0.06, }, recommends => { LWP::UserAgent => 2.032, }, create_readme => 1, create_makefile_pl => 'passthrough', ); if($build->y_n ('Would you like to install ical2xml, a command line frontend?','n')) { $build->{properties}->{script_files}=['scripts/ical2xml']; } $build->create_build_script; if($build->y_n(q{Would you like to test a remote (http) calendar? (Requires LWP::UserAgent and may fail if you don't have access to the internet or the remote file has moved) },'y')) { open OUT, '>_build/DOHTTP'; close(OUT); } iCal-Parser-SAX-1.09/ChangeLog0000444000076500007650000000200111032266422014411 0ustar rickrick2005-06-19 Rick Frankel * lib/iCal/Parser/SAX.pm (process_day): fix issue with 0 hour events 2005-06-11 Rick Frankel * lib/iCal/Parser/SAX.pm (process_events): fix bad (string) sorting of months/years. 2005-02-01 Rick Frankel * lib/iCal/Parser/SAX.pm (process_day): subtract 1 second from end of each event to avoid end->start intersection (conflict) problem. * t/01parse.t: fix timezone to 'America/New_York' so tests won't fail in other locales. * scripts/ical2xml: added support for -z tz argument to support updated iCal::Parser. 2005-01-04 Rick Frankel * t/01parse.t: fix current year dependency 2004-12-27 Rick Frankel * lib/iCal/Parser/SAX.pm (process_component): only add uid, idref if they exists (fixes empty uid, idref on valarm, attendee) 2004-12-18 Rick Frankel * lib/iCal/Parser/SAX.pm (pod): fix bad link * ical2xml: change -e to -E for consistency, fix documentation iCal-Parser-SAX-1.09/lib/0000755000076500007650000000000011032266422013416 5ustar rickrickiCal-Parser-SAX-1.09/lib/iCal/0000755000076500007650000000000011032266422014266 5ustar rickrickiCal-Parser-SAX-1.09/lib/iCal/Parser/0000755000076500007650000000000011032266422015522 5ustar rickrickiCal-Parser-SAX-1.09/lib/iCal/Parser/SAX.pm0000444000076500007650000002550011032266422016513 0ustar rickrick#$Id: SAX.pm 505 2008-06-27 22:53:18Z rick $ package iCal::Parser::SAX; use strict; use base qw(XML::SAX::Base); use iCal::Parser; use IO::File; use IO::String; use DateTime; # Get version from subversion url of tag or branch. our $VERSION= do {(q$URL: svn+ssh://xpc/var/lib/svn/rick/perl/ical/iCal-Parser-SAX/tags/1.09/lib/iCal/Parser/SAX.pm $=~ m$.*/(?:tags|branches)/([^/ ]+)$)[0]||'0.1'}; our %NAMES=('X-WR-RELCALID'=>'id', 'X-WR-CALNAME'=>'name', 'X-WR-CALDESC'=>'description'); sub new { my($class,%options)=@_; my $handler=delete $options{Handler}; my $self=XML::SAX::Base->new($handler ? (Handler=>$handler) : ()); $self=bless $self,$class; $self->{no_escape}=delete $options{no_escape}; $self->{_calparser}=iCal::Parser->new(%options); return $self; } sub _parse_characterstream { shift->_parse_fh(@_); } sub _parse_bytestream { shift->_parse_fh(@_); } sub _parse_systemid { my ($self, $sysid, $options) = @_; $self->_parse_fh(__systemid_to_fh($sysid)); } sub _parse_string { my ($self, $str, $options) = @_; $self->_parse_fh(IO::String->new($str)); } sub _parse_fh { my($self,$fh,$options)=@_; return $self->parse_hash($self->{_calparser}->parse($fh)); } sub parse_uris { my $self=shift; foreach my $uri (@_) { $self->{_calparser}->parse(__systemid_to_fh($uri)); } return $self->parse_hash($self->{_calparser}->calendar); } sub __systemid_to_fh { my $sysid=shift; if($sysid =~ m{^(http|ftp|https)://}) { eval {require LWP::UserAgent;}; die "LWP required for $sysid\n" if $@; my $req=HTTP::Request->new(GET => $sysid); my $ua=LWP::UserAgent->new; $ua->agent(__PACKAGE__); my $res=$ua->request($req); unless($res->is_success) { die "Can't read $sysid\n"; } return IO::String->new($res->content); } else { return IO::File->new($sysid,'r') or die "Can't open $sysid, $!\n"; } } sub parse_hash { my($self,$hash)=@_; $self->SUPER::start_document; $self->start('ical'); foreach my $cal (@{ $hash->{cals} }) { $self->start('calendar',{ map { ($NAMES{$_}||lc $_)=>$cal->{$_} } keys %$cal }); $self->end('calendar'); } $self->process_events($hash); if(scalar @{$hash->{todos}}) { $self->start('todos'); map {$self->process_component($_,'todo')} @{ $hash->{todos} }; $self->end('todos'); } $self->end('ical'); $self->SUPER::end_document; } sub process_events { my($self,$hash)=@_; my $events=$hash->{events}; return unless $events; my $cals=$hash->{cals}; $self->start('events'); my @years=sort { $a <=> $b } keys %$events; foreach my $y (@years) { $self->start('year',{year=>$y}); my $year=$events->{$y}; #fill in missing months from start->end my @months=sort { $a <=> $b } keys %$year; my $sm= $months[0]; my $se= $months[-1]; foreach my $m ($sm .. $se) { my $month=$year->{$m}; my $d1=DateTime->new(year=>$y,month=>$m,day=>1); warn $d1->ymd, " ---\n" if $self->{debug}; $self->start('month', {month=>$m}); my $week=$d1->week_number; $self->start('week',{week=>$week}); #pad beggining of week my $dow=$d1->day_of_week; for($d1->subtract(days=>$d1->day_of_week-1);$d1->day_of_week!=$dow; $d1->add(days=>1)) { $self->process_day($d1,$self->day($d1,$events)); } for(;$d1->month == $m;$d1->add(days=>1)) { if($d1->week != $week) { $self->end('week',{week=>$week}); $week=$d1->week; $self->start('week',{week=>$week}); } $self->process_day($d1,$self->day($d1,$events)); } #pad end of month for(;$d1->day_of_week != 1;$d1->add(days=>1)) { $self->process_day($d1,$self->day($d1,$events)); } $self->end('week'); $self->end('month'); } $self->end('year'); } $self->end('events'); } sub day { my($self,$d,$events)=@_; my($yr,$mo); return unless $yr=$events->{$d->year}; return unless $mo=$yr->{$d->month}; return $mo->{$d->day}; } sub process_day { my($self,$d,$day)=@_; #warn $d->ymd,"\n" if $self->{debug}; # figure out max# conflicting appointments. and output in xml # makes html generation of weekly/daily calendar easier my @events=(); my $conflict=0; if($day) { @events=sort by_type_time values %$day; my @a=(); #event span foreach my $e (@events) { if($e->{allday}) { push @a,undef; next; } #if an event ends at e.g., 9am and another starts #at 9, intersect will generate an overlap. #so, subtract 1 sec from the end of each event ## unless start == end ## note start > end is an error! my $end=$e->{DTSTART}->compare($e->{DTEND}) < 0 ? $e->{DTEND}->clone->subtract(seconds=>1) : $e->{DTEND}; push @a, DateTime::Span->from_datetimes (start=>$e->{DTSTART}, end=>$end); } my @overlap=(0); # each conflict adds one to the count of conflicts for the event # it conflicts with foreach my $i (1..$#a) { my $span=$a[$i]; $overlap[$i]=0; next unless $span; foreach my $j (0..$i-1) { next unless $a[$j]; $overlap[$i]=$overlap[$j]+1 if $span->intersects($a[$j]); } $events[$i]->{'conflict-number'}=$overlap[$i] if $overlap[$i]; } map { $conflict = $_ if $_ > $conflict } @overlap; } $self->start('day',{date=>$d->ymd, $conflict ? (conflict=>$conflict) : ()}); map {$self->process_component($_,'event')} @events; $self->end('day'); } sub by_type_time { # For sorting lists of events # Two events on the same day? All day events come first return -1 if $a->{allday} && !$b->{allday}; return 1 if $b->{allday} && !$a->{allday}; # If they're both all day events, sort by summary text return $a->{SUMMARY} cmp $b->{SUMMARY} if $a->{allday} && $b->{allday}; # Otherwise, sort by start time return $a->{DTSTART} <=> $b->{DTSTART}; } sub process_component { my($self,$ee,$type)=@_; my %attrs=(); # pull out attributes before generic processing # of key/value pairs into elements #clone in case event processed more than once my %e=%$ee; $attrs{uid}=delete $e{UID} if $e{UID}; $attrs{idref}=delete $e{idref} if $e{idref}; $attrs{'all-day'}=delete $e{allday} if $e{allday}; # used in xslt stylesheet to figure out which # overlapping event this is $attrs{'conflict-number'}=delete $e{'conflict-number'} if $e{'conflict-number'}; $self->start($type,%attrs); while(my($k,$v)=each(%e)) { if(ref $v eq 'ARRAY') { my $list=$k . 's'; $self->start($list,count=>scalar @$v); map {$self->process_component($_,$k)} @$v; $self->end($list); } elsif(ref $v eq 'HASH') { $self->process_component($v,$k); } else { $self->text_element($k,$v); } } $self->end($type); } sub start { my $self=shift; $self->SUPER::start_element($self->make_element(@_)); } sub end { my $self=shift; $self->SUPER::end_element($self->make_element(@_)); } sub make_element { my $self=shift; my $n=lc shift; my %a=ref $_[0] ? %{$_[0]} : @_; my %h=(Name=>"$n"); return \%h unless %a; while(my($k,$v) = each %a) { $h{Attributes}->{"{}$k"} = {Name=>$k, Value=>escape($v,$self->{no_escape})}; } return \%h; } sub escape { my $text=shift; my $no_escape=shift; return '' unless $text; unless($no_escape) { $text=~s/&/\&/go; $text=~s/"/\"/go; $text=~s/'/'/go; } $text=~s/start($n, %a); if($v) { my $text=escape($v,$self->{no_escape}); $self->SUPER::characters({Data=>$text}); } $self->end($n); } 1; __END__ =head1 NAME iCal::Parser::SAX - Generate SAX events from an iCalendar =head1 SYNOPSIS use iCal::Parser::SAX; my $parser=iCal::Parser::SAX->new(Handler=>SAXHandler,%args); $parser->parse_uri($file); $parser->parse_uris(@files); =head1 DESCRIPTION This module uses L to generates SAX events for the calendar contents. The xml document generated is designed for creating monthly calendars with weeks beginning on monday (e.g., by passing the output through an xsl styleheet). The basic structure of the generated document (if output through a simple output handler like C), is as follows: Along with basics, such as converting calendar attributes to lowercase elements (e.g., a C attribute in the input would generate a sax event like C'dtstart'})>), a number of other processes occur: =over 4 =item * C elements are are generated for each date within the months from the first month in the input to the last, even if there are no calendar events on that day. This guarantees a complete calendar month for further processing. If there is an overlap between two or more events, the attribute C, containing the number of concurrent overlaps, is added to the element. =item * If the beginning or end of the month does not start on a monday, or end on a sunday, the days from the previous (next) month month are duplicated within the first (last) week of the current month, including duplicate copies of any calendar events occuring on those days. This allows for displaying a monthly calendar the same way a program such as Apple's iCal would, with calendar events showing up if they fall within the overlapping days in the first or last week of a monthly calendar. =back =head1 METHODS Along with the standard SAX parsing methods C, C, etc.), the following methods are supported. =head2 new(%args) Create a new SAX parser. All arguments other than C and C are passed to L. =head3 Arguments =over 4 =item Handler The SAX handler. =item no_escape If not set, quotes, ampersands and apostrophes are converted to entites. In any case E is converted to an entity, C<\\n> is converted to the return entity and double backslashes (C<\\>) are removed. =back =head2 parse_uris(@uris) Pass all the input uris to C and generate a combined output calendar. =head2 parse_hash($hash) Parse the hash returned from L directly. =head1 AUTHOR Rick Frankel, cpan@rickster.com =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO L, L iCal-Parser-SAX-1.09/LICENSE0000444000076500007650000005010111032266422013650 0ustar rickrickTerms of Perl itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --------------------------------------------------------------------------- The General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. 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 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS --------------------------------------------------------------------------- The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End iCal-Parser-SAX-1.09/Makefile.PL0000444000076500007650000000211511032266422014617 0ustar rickrick# Note: this file was auto-generated by Module::Build::Compat version 0.03 unless (eval "use Module::Build::Compat 0.02; 1" ) { print "This module requires Module::Build to install itself.\n"; require ExtUtils::MakeMaker; my $yn = ExtUtils::MakeMaker::prompt (' Install Module::Build now from CPAN?', 'y'); unless ($yn =~ /^y/i) { die " *** Cannot install without Module::Build. Exiting ...\n"; } require Cwd; require File::Spec; require CPAN; # Save this 'cause CPAN will chdir all over the place. my $cwd = Cwd::cwd(); CPAN::Shell->install('Module::Build::Compat'); CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate or die "Couldn't install Module::Build, giving up.\n"; chdir $cwd or die "Cannot chdir() back to $cwd: $!"; } eval "use Module::Build::Compat 0.02; 1" or die $@; Module::Build::Compat->run_build_pl(args => \@ARGV); require Module::Build; Module::Build::Compat->write_makefile(build_class => 'Module::Build'); iCal-Parser-SAX-1.09/MANIFEST0000444000076500007650000000210611032266422013776 0ustar rickricklib/iCal/Parser/SAX.pm LICENSE Build.PL Makefile.PL MANIFEST This list of files META.yml README ChangeLog scripts/ical2xml t/00load.t t/01parse.t t/calendars/00no-name-or-id.ics t/calendars/00no-name-or-id.ics.xml t/calendars/01name-and-id.ics t/calendars/01name-and-id.ics.xml t/calendars/02event-duration.ics t/calendars/02event-duration.ics.xml t/calendars/02no-summary.ics t/calendars/02no-summary.ics.xml t/calendars/03all-day-event.ics t/calendars/03all-day-event.ics.xml t/calendars/04recurrence.ics t/calendars/04recurrence.ics.xml t/calendars/04zero-hr-event.ics t/calendars/04zero-hr-event.ics.xml t/calendars/05exdate.ics t/calendars/05exdate.ics.xml t/calendars/06multi-day.ics t/calendars/06multi-day.ics.xml t/calendars/07rrule.ics t/calendars/07rrule.ics.xml t/calendars/08todo-with-alarm.ics t/calendars/08todo-with-alarm.ics.xml t/calendars/09recurrence-update.ics t/calendars/09recurrence-update.ics.xml t/calendars/10multi-cal.ics.xml t/calendars/11complex.ics t/calendars/11complex.ics.xml t/calendars/12multi-year.ics t/calendars/12multi-year.ics.xml t/calendars/url.xml iCal-Parser-SAX-1.09/META.yml0000444000076500007650000000117211032266422014120 0ustar rickrick--- name: iCal-Parser-SAX version: 1.09 author: - 'Rick Frankel, cpan@rickster.com' abstract: Generate SAX events from an iCalendar license: perl resources: license: http://dev.perl.org/licenses/ requires: DateTime: 0.22 IO::File: 1.1 IO::String: 1.05 XML::SAX::Base: 1.04 XML::SAX::Writer: 0.44 iCal::Parser: 1.07 build_requires: Test::More: 0.47 Test::XML: 0.06 recommends: LWP::UserAgent: 2.032 provides: iCal::Parser::SAX: file: lib/iCal/Parser/SAX.pm version: 1.09 generated_by: Module::Build version 0.2808 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 iCal-Parser-SAX-1.09/README0000444000076500007650000000673311032266422013537 0ustar rickrickNAME iCal::Parser::SAX - Generate SAX events from an iCalendar SYNOPSIS use iCal::Parser::SAX; my $parser=iCal::Parser::SAX->new(Handler=>SAXHandler,%args); $parser->parse_uri($file); $parser->parse_uris(@files); DESCRIPTION This module uses iCal::Parser to generates SAX events for the calendar contents. The xml document generated is designed for creating monthly calendars with weeks beginning on monday (e.g., by passing the output through an xsl styleheet). The basic structure of the generated document (if output through a simple output handler like `XML::SAX::Writer'), is as follows: Along with basics, such as converting calendar attributes to lowercase elements (e.g., a `DTSTART' attribute in the input would generate a sax event like `element({Name=''dtstart'})>), a number of other processes occur: * `day' elements are are generated for each date within the months from the first month in the input to the last, even if there are no calendar events on that day. This guarantees a complete calendar month for further processing. If there is an overlap between two or more events, the attribute `conflict', containing the number of concurrent overlaps, is added to the element. * If the beginning or end of the month does not start on a monday, or end on a sunday, the days from the previous (next) month month are duplicated within the first (last) week of the current month, including duplicate copies of any calendar events occuring on those days. This allows for displaying a monthly calendar the same way a program such as Apple's iCal would, with calendar events showing up if they fall within the overlapping days in the first or last week of a monthly calendar. METHODS Along with the standard SAX parsing methods `parse_uri', `parse_file', etc.), the following methods are supported. new(%args) Create a new SAX parser. All arguments other than `Handler' and `no_escape' are passed to iCal::Parser. Arguments Handler The SAX handler. no_escape If not set, quotes, ampersands and apostrophes are converted to entites. In any case < is converted to an entity, `\\n' is converted to the return entity and double backslashes (`\\') are removed. parse_uris(@uris) Pass all the input uris to `iCal::Parser' and generate a combined output calendar. parse_hash($hash) Parse the hash returned from iCal::Parser::calendar directly. AUTHOR Rick Frankel, cpan@rickster.com COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO iCal::Parser, XML::SAX::Base iCal-Parser-SAX-1.09/scripts/0000755000076500007650000000000011032266422014337 5ustar rickrickiCal-Parser-SAX-1.09/scripts/ical2xml0000555000076500007650000000414011032266422015775 0ustar rickrick#!/usr/local/bin/perl -w use strict; use iCal::Parser::SAX; use XML::SAX::Writer; use Getopt::Std; our $VERSION=sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/); our %opts=(); our $opts='f:t:m:z:TEdh'; our $usage=qq{usage: $0 {$opts} file ... -f yyyymmdd only output events from inclusive date -t yyyymmdd only output events until date -m num only output num month of events -z tz timezone to use (e.g "America/New_York") -T don't output todos -E don't output events -d debug -h the ususal }; our %optmap=(f=>'start', t=>'end', m=>'months', z=>'tz', T=>'no_todos', E=>'no_events', d=>'debug', ); getopts($opts,\%opts) || die $usage; print $usage and exit 0 if $opts{h}; die $usage unless @ARGV; my %args=(); map {$args{$optmap{$_}}=$opts{$_} if defined $opts{$_}} keys %optmap; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer->new(Escape=>{XXX=>'XXX'}), %args)->parse_uris(@ARGV); exit 0; __END__ =head1 NAME ical2xml - Convert iCalendar files to XML =head1 SYNOPSIS ical2xml [options] file.ics .. =head1 DESCRIPTION This program uses L to convert iCalendar files to XML. The xml document generated is designed for creating monthly calendars with weeks beginning on monday (e.g., by passing the output through an xsl styleheet). Multiple input files are merged into a single XML output stream. =head1 OPTIONS =over 4 =item -f yyyymmdd only output events from inclusive date =item -t yyyymmdd only output events until date =item m num only output events num month from the start date =item z tz adjust dates to specified timezone (defaults to local timezone) =item -T don't output todos =item -E don't output events =item -d debug =item -h the ususal =back =head1 AUTHOR Rick Frankel, cpan@rickster.com =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO L iCal-Parser-SAX-1.09/t/0000755000076500007650000000000011032266422013113 5ustar rickrickiCal-Parser-SAX-1.09/t/00load.t0000444000076500007650000000035111032266422014354 0ustar rickrick# -*- perl -*- # t/001_load.t - check module loading and create testing directory use Test::More tests => 2; BEGIN { use_ok( 'iCal::Parser::SAX' ); } my $object = iCal::Parser::SAX->new (); isa_ok ($object, 'iCal::Parser::SAX'); iCal-Parser-SAX-1.09/t/01parse.t0000444000076500007650000000442411032266422014555 0ustar rickrick# -*- cperl -*- use Test::More; use Test::XML; use IO::File; use IO::String; use XML::SAX::Writer; use iCal::Parser::SAX; my @files=glob("t/calendars/[0-9]*.ics"); plan tests => scalar @files + 5; foreach my $f (@files) { my $expect=slurp($f . ".xml"); my $got=''; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{XXX=>'XXX'},Output=>\$got), start=>'20040101',tz=>'America/New_York', )->parse_uri($f); is_xml($got,$expect,$f=~/.+\d+(.+)\.ics/); } my $expect=slurp("t/calendars/10multi-cal.ics.xml"); my $got=''; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{},Output=>\$got), start=>'20040101',tz=>'America/New_York', )->parse_uris(qw{ t/calendars/02event-duration.ics t/calendars/03all-day-event.ics}); is_xml($got,$expect,"multi-cal input"); my $f="t/calendars/03all-day-event.ics"; $expect=slurp($f . ".xml"); my $fh=IO::File->new($f,'r'); $got=''; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{},Output=>\$got), start=>'20040101',tz=>'America/New_York', )->parse_file($fh); is_xml($got,$expect,'parse filehandle'); $got=''; my $input=slurp($f); iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{XXX=>'XXX'},Output=>\$got), start=>'20040101',tz=>'America/New_York', )->parse_string($input); is_xml($got,$expect,'parse string'); my $h=iCal::Parser->new(start=>'20040101',tz=>'America/New_York')->parse($f); #parse now tries to use filename $h->{cals}[0]{'X-WR-CALNAME'}='Calendar 1'; $got=''; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{XXX=>'XXX'},Output=>\$got), start=>'20040101', )->parse_hash($h); is_xml($got,$expect,'parse hash'); SKIP: { eval "use LWP::UserAgent"; skip "http url", 1 unless -f "_build/DOHTTP" && !$@; my $url="http://www.rickster.com/xml-sax-ical/test-cal.ics"; $got=''; iCal::Parser::SAX->new(Handler=>XML::SAX::Writer ->new(Escape=>{XXX=>'XXX'},Output=>\$got), start=>'20040101',tz=>'America/New_York', )->parse_uri($url); is_xml($got,$expect,'parse http url'); } sub slurp { my $f=shift; local $/=undef; open IN, $f or die "Can't open $f, $!"; my $s=; close IN; return $s; } iCal-Parser-SAX-1.09/t/calendars/0000755000076500007650000000000011032266422015047 5ustar rickrickiCal-Parser-SAX-1.09/t/calendars/00no-name-or-id.ics0000444000076500007650000000011211032266422020241 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/00no-name-or-id.ics.xml0000444000076500007650000000022311032266422021043 0ustar rickrickiCal-Parser-SAX-1.09/t/calendars/01name-and-id.ics0000444000076500007650000000036511032266422017764 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 X-WR-CALNAME:Test PRODID:-//Apple Computer\, Inc//iCal 1.5//EN X-WR-RELCALID:7CCE8555-3516-11D9-8A43-000D93C45D90 X-WR-TIMEZONE:America/New_York CALSCALE:GREGORIAN X-WR-CALDESC:My Test Calendar END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/01name-and-id.ics.xml0000444000076500007650000000036411032266422020562 0ustar rickrickiCal-Parser-SAX-1.09/t/calendars/02event-duration.ics0000444000076500007650000000037211032266422020655 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DURATION:PT1H DTSTAMP:20041113T220634Z UID:823732B9-3516-11D9-8A43-000D93C45D90 DTSTART;TZID=America/New_York:20041112T210000 SUMMARY:1 hr event END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/02event-duration.ics.xml0000444000076500007650000000262111032266422021453 0ustar rickrick1 hr event1.002004-11-13T17:06:342004-11-12T22:00:002004-11-12T21:00:00iCal-Parser-SAX-1.09/t/calendars/02no-summary.ics0000444000076500007650000000036011032266422020015 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DURATION:PT1H DTSTAMP:20041113T220634Z UID:823732B9-3516-11D9-8A43-000D93C45D90 DTSTART;TZID=America/New_York:20041112T210000 SUMMARY: END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/02no-summary.ics.xml0000444000076500007650000000257711032266422020630 0ustar rickrick1.002004-11-13T17:06:342004-11-12T22:00:002004-11-12T21:00:00iCal-Parser-SAX-1.09/t/calendars/03all-day-event.ics0000444000076500007650000000037511032266422020357 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;VALUE=DATE:20041115 DTEND;VALUE=DATE:20041116 SUMMARY:all day UID:A4E57872-3516-11D9-8A43-000D93C45D90 SEQUENCE:2 DTSTAMP:20041113T015226Z END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/03all-day-event.ics.xml0000444000076500007650000000260711032266422021156 0ustar rickrickall day2004-11-12T20:52:262004-11-16T00:00:002004-11-15T00:00:00iCal-Parser-SAX-1.09/t/calendars/04recurrence.ics0000444000076500007650000000045511032266422020052 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;TZID=America/New_York:20041117T210000 STATUS:CONFIRMED UID:D5EEE785-3516-11D9-8A43-000D93C45D90 DTSTAMP:20041113T220701Z RECURRENCE-ID;TZID=America/New_York:20041117T210000 DURATION:PT1H END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/04recurrence.ics.xml0000444000076500007650000000261611032266422020652 0ustar rickrick1.00CONFIRMED2004-11-13T17:07:012004-11-17T22:00:002004-11-17T21:00:00iCal-Parser-SAX-1.09/t/calendars/04zero-hr-event.ics0000444000076500007650000000040411032266422020414 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;TZID=America/New_York:20041117T210000 DTEND;TZID=America/New_York:20041117T210000 UID:D5EEE785-3516-11D9-8A43-000D93C45D90 DTSTAMP:20041113T220701Z END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/04zero-hr-event.ics.xml0000444000076500007650000000256411032266422021224 0ustar rickrick0.002004-11-13T17:07:012004-11-17T21:00:002004-11-17T21:00:00iCal-Parser-SAX-1.09/t/calendars/05exdate.ics0000444000076500007650000000067111032266422017170 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;TZID=America/New_York:20041127T190000 EXDATE;TZID=America/New_York:20041204T190000 EXDATE;TZID=America/New_York:20041218T190000 DTEND;TZID=America/New_York:20041127T200000 SUMMARY:another weekly UID:EE9B2B93-35CC-11D9-8110-000D93C45D90 SEQUENCE:8 DTSTAMP:20041114T002037Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20041228T045959Z END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/05exdate.ics.xml0000444000076500007650000000554111032266422017770 0ustar rickrickanother weekly1.002004-11-13T19:20:372004-11-27T20:00:002004-11-27T19:00:00another weekly1.002004-11-13T19:20:372004-12-11T20:00:002004-12-11T19:00:00another weekly1.002004-11-13T19:20:372004-12-25T20:00:002004-12-25T19:00:00iCal-Parser-SAX-1.09/t/calendars/06multi-day.ics0000444000076500007650000000037211032266422017622 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;VALUE=DATE:20041101 DTEND;VALUE=DATE:20041105 SUMMARY:span UID:AA403AC0-35CD-11D9-8110-000D93C45D90 SEQUENCE:3 DTSTAMP:20041113T234243Z END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/06multi-day.ics.xml0000444000076500007650000000401711032266422020421 0ustar rickrickspan2004-11-13T18:42:432004-11-02T00:00:002004-11-01T00:00:00span2004-11-13T18:42:432004-11-03T00:00:002004-11-02T00:00:00span2004-11-13T18:42:432004-11-04T00:00:002004-11-03T00:00:00span2004-11-13T18:42:432004-11-05T00:00:002004-11-04T00:00:00iCal-Parser-SAX-1.09/t/calendars/07rrule.ics0000444000076500007650000000051211032266422017043 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;TZID=America/New_York:20041202T000000 SUMMARY:wierd UID:5A4E636A-35E7-11D9-9E64-000D93C45D90 SEQUENCE:3 DTSTAMP:20041114T024734Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20041203T045959Z;BYDAY=TH,FR;WKST=SU DURATION:PT1H END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/07rrule.ics.xml0000444000076500007650000000261411032266422017647 0ustar rickrickwierd1.002004-11-13T21:47:342004-12-02T01:00:002004-12-02T00:00:00iCal-Parser-SAX-1.09/t/calendars/08todo-with-alarm.ics0000444000076500007650000000055411032266422020731 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VTODO DTSTART;TZID=America/New_York:20041112T000000 SUMMARY:todo 3 UID:0BC74A86-35E9-11D9-9E64-000D93C45D90 SEQUENCE:3 DTSTAMP:20041114T033144Z PRIORITY:5 DUE;VALUE=DATE:20041114 BEGIN:VALARM TRIGGER:-PT15M ACTION:DISPLAY DESCRIPTION:Event reminder END:VALARM END:VTODO END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/08todo-with-alarm.ics.xml0000444000076500007650000000101411032266422021520 0ustar rickrick2004-11-11T23:45:00DISPLAYEvent remindertodo 352004-11-13T22:31:442004-11-14T00:00:002004-11-12T00:00:00iCal-Parser-SAX-1.09/t/calendars/09recurrence-update.ics0000444000076500007650000000110211032266422021325 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DTSTART;TZID=America/New_York:20041117T210000 SUMMARY:daily UID:D5EEE785-3516-11D9-8A43-000D93C45D90 SEQUENCE:4 DTSTAMP:20041113T015405Z RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20041121T045959Z DURATION:PT1H END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041118T210000 STATUS:CANCELLED DTEND;TZID=America/New_York:20041118T230000 UID:D5EEE785-3516-11D9-8A43-000D93C45D90 SEQUENCE:5 RECURRENCE-ID;TZID=America/New_York:20041118T210000 DTSTAMP:20041113T203354Z END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/09recurrence-update.ics.xml0000444000076500007650000000411111032266422022127 0ustar rickrickdaily1.002004-11-12T20:54:052004-11-17T22:00:002004-11-17T21:00:00daily2.00CANCELLED2004-11-13T15:33:542004-11-18T23:00:002004-11-18T21:00:00daily1.002004-11-12T20:54:052004-11-19T22:00:002004-11-19T21:00:00daily1.002004-11-12T20:54:052004-11-20T22:00:002004-11-20T21:00:00iCal-Parser-SAX-1.09/t/calendars/10multi-cal.ics.xml0000444000076500007650000000335111032266422020376 0ustar rickrick1 hr event1.002004-11-13T17:06:342004-11-12T22:00:002004-11-12T21:00:00all day2004-11-12T20:52:262004-11-16T00:00:002004-11-15T00:00:00iCal-Parser-SAX-1.09/t/calendars/11complex.ics0000444000076500007650000001675111032266422017370 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 X-WR-CALNAME:Test PRODID:-//Apple Computer\, Inc//iCal 1.5//EN X-WR-RELCALID:7CCE8555-3516-11D9-8A43-000D93C45D90 X-WR-TIMEZONE:America/New_York CALSCALE:GREGORIAN X-WR-CALDESC:My Test Calendar BEGIN:VEVENT DURATION:PT1H ATTENDEE;CN="Lindsey Biel":mailto:lindsey ATTENDEE;CN="Jay Frankel":mailto:jayfrankel ATTENDEE;CN="someone else":invalid:nomail DTSTAMP:20041113T220634Z UID:823732B9-3516-11D9-8A43-000D93C45D90 SEQUENCE:3 URL;VALUE=URI:http://foo STATUS:TENTATIVE DTSTART;TZID=America/New_York:20041112T210000 SUMMARY:1 hr event DESCRIPTION:this is a note\nline 2\nand a longer line for line three. ma ke it wrap X-WR-ITIPSTATUSML:UNCLEAN ORGANIZER;CN="Rick Frankel":mailto:rick BEGIN:VALARM TRIGGER:-PT15M DESCRIPTION:Event reminder ACTION:DISPLAY END:VALARM END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041115 DTEND;VALUE=DATE:20041116 SUMMARY:all day UID:A4E57872-3516-11D9-8A43-000D93C45D90 SEQUENCE:2 DTSTAMP:20041113T015226Z END:VEVENT BEGIN:VEVENT DURATION:PT1H ATTENDEE;CN="Biel Lindsey":mailto:lindsey ATTENDEE;CN="Frankel Jay":mailto:jayfrankel DTSTAMP:20041130T224644Z ORGANIZER;CN="Frankel Rick":mailto:rick UID:B347D452-3516-11D9-8A43-000D93C45D90 SEQUENCE:7 DTSTART;TZID=America/New_York:20041116T210000 SUMMARY:weekly X-WR-ITIPSTATUSML:UNCLEAN RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20041202T045959Z END:VEVENT BEGIN:VEVENT DURATION:PT1H ATTENDEE;CN="Lindsey Biel":mailto:lindsey DTSTAMP:20041117T024941Z ORGANIZER;CN="Rick Frankel":mailto:rick UID:D5EEE785-3516-11D9-8A43-000D93C45D90 SEQUENCE:5 DTSTART;TZID=America/New_York:20041117T210000 SUMMARY:daily X-WR-ITIPSTATUSML:UNCLEAN RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20041121T045959Z END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041124 DTEND;VALUE=DATE:20041125 SUMMARY:all day repeat UID:E7E912A0-3516-11D9-8A43-000D93C45D90 SEQUENCE:5 DTSTAMP:20041113T162820Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=3 END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041117T210000 STATUS:CONFIRMED UID:D5EEE785-3516-11D9-8A43-000D93C45D90 DTSTAMP:20041126T220730Z RECURRENCE-ID;TZID=America/New_York:20041117T210000 DURATION:PT1H BEGIN:VALARM ACTION:EMAIL SUMMARY:Alarm notification TRIGGER:-P1D ATTENDEE:mailto:rick DESCRIPTION:This is an event reminder END:VALARM END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041118T210000 STATUS:CANCELLED DTEND;TZID=America/New_York:20041118T230000 UID:D5EEE785-3516-11D9-8A43-000D93C45D90 SEQUENCE:5 RECURRENCE-ID;TZID=America/New_York:20041118T210000 DTSTAMP:20041113T203354Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041201T180000 SUMMARY:mon/wed UID:1C98FD62-35C6-11D9-8110-000D93C45D90 SEQUENCE:4 DTSTAMP:20041114T024527Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=6;BYDAY=MO,WE;WKST=SU DURATION:PT1H END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041127T190000 EXDATE;TZID=America/New_York:20041204T190000 EXDATE;TZID=America/New_York:20041218T190000 DTEND;TZID=America/New_York:20041127T200000 SUMMARY:another weekly UID:EE9B2B93-35CC-11D9-8110-000D93C45D90 SEQUENCE:8 DTSTAMP:20041114T002037Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20041228T045959Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041108T190000 LOCATION:here DTEND;TZID=America/New_York:20041110T200000 SUMMARY:long1 UID:783BF902-35CD-11D9-8110-000D93C45D90 SEQUENCE:4 DTSTAMP:20041114T202430Z END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041107 DTEND;VALUE=DATE:20041111 SUMMARY:span UID:AA403AC0-35CD-11D9-8110-000D93C45D90 SEQUENCE:5 DTSTAMP:20041209T004711Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041202T000000 DTEND;TZID=America/New_York:20041202T010000 SUMMARY:weird UID:5A4E636A-35E7-11D9-9E64-000D93C45D90 SEQUENCE:108 DTSTAMP:20041117T023708Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20050105T045959Z;BYDAY=TH,FR;WKST=SU BEGIN:VALARM ACTION:DISPLAY DESCRIPTION:Event reminder TRIGGER:-PT15M END:VALARM BEGIN:VALARM ACTION:DISPLAY DESCRIPTION:Event reminder TRIGGER:-PT30M END:VALARM END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041201T180000 SUMMARY:mon/wed-changed UID:1C98FD62-35C6-11D9-8110-000D93C45D90 RECURRENCE-ID;TZID=America/New_York:20041201T180000 DURATION:PT1H END:VEVENT BEGIN:VTODO PRIORITY:9 DTSTAMP:20041114T024952Z UID:B78E68F2-35E7-11D9-9E64-000D93C45D90 SEQUENCE:2 URL;VALUE=URI:mailto:me STATUS:COMPLETED DTSTART;TZID=America/New_York:20041113T000000 SUMMARY:todo 1 COMPLETED:20041113T050000Z END:VTODO BEGIN:VTODO DTSTART;TZID=America/New_York:20041113T000000 SUMMARY:todo 2 UID:BC83F9D2-35E7-11D9-9E64-000D93C45D90 SEQUENCE:5 DTSTAMP:20041211T040210Z PRIORITY:1 DUE;VALUE=DATE:20041120 BEGIN:VALARM ACTION:PROCEDURE ATTACH;VALUE=URI:file://localhost/Applications/iCal.app/ TRIGGER:PT2M END:VALARM BEGIN:VALARM ACTION:EMAIL SUMMARY:Alarm notification TRIGGER:-PT15M ATTENDEE:mailto:rick DESCRIPTION:This is an event reminder END:VALARM END:VTODO BEGIN:VTODO DTSTART;TZID=America/New_York:20041112T000000 SUMMARY:todo 3 UID:0BC74A86-35E9-11D9-9E64-000D93C45D90 SEQUENCE:5 DTSTAMP:20041117T021921Z PRIORITY:5 DUE;VALUE=DATE:20041114 BEGIN:VALARM ACTION:PROCEDURE ATTACH;VALUE=URI:file://localhost/Users/rick/Documents/businesscard.bcar d TRIGGER:-PT15M END:VALARM BEGIN:VALARM TRIGGER:-PT15M DESCRIPTION:Event reminder ACTION:DISPLAY END:VALARM END:VTODO BEGIN:VTODO DTSTART;TZID=America/New_York:20041113T000000 SUMMARY:todo 4 UID:FF6841B4-35ED-11D9-98FE-000D93C45D90 SEQUENCE:1 DTSTAMP:20041114T033428Z DESCRIPTION:not much END:VTODO BEGIN:VEVENT DTSTART;TZID=America/New_York:20041111T090000 DTEND;TZID=America/New_York:20041112T140000 SUMMARY:overnight UID:95CCBF98-3685-11D9-8CA5-000D93C45D90 SEQUENCE:8 DTSTAMP:20041114T214258Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041113T170000 DTEND;TZID=America/New_York:20041114T163000 SUMMARY:short overnight UID:4D97CFCB-3687-11D9-8CA5-000D93C45D90 SEQUENCE:13 DTSTAMP:20041114T215137Z END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041231 DTEND;VALUE=DATE:20050101 SUMMARY:eoy all UID:D97AFD6E-3DCB-11D9-A9BF-000D93C45D90 SEQUENCE:28 DTSTAMP:20041124T035246Z END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041130 LOCATION:here DTEND;VALUE=DATE:20041201 SUMMARY:eom allday UID:0C86E2CB-3DCC-11D9-A9BF-000D93C45D90 SEQUENCE:6 DTSTAMP:20041130T231246Z DESCRIPTION:this is < a note END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041129 DTEND;VALUE=DATE:20041130 SUMMARY:monday UID:4F2C757A-431A-11D9-B3AF-000D93C45D90 SEQUENCE:2 DTSTAMP:20041130T215351Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041212T170000 SUMMARY:sunday UID:A94F4AE4-431A-11D9-9399-000D93C45D90 SEQUENCE:1 DTSTAMP:20041130T215623Z DURATION:PT1H END:VEVENT BEGIN:VEVENT DTSTART;VALUE=DATE:20041110 DTEND;VALUE=DATE:20041113 SUMMARY:overlapping span UID:CC534437-4977-11D9-B3AD-000D93C45D90 SEQUENCE:5 DTSTAMP:20041209T004703Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041112T110000 DTEND;TZID=America/New_York:20041112T154500 SUMMARY:third overlap UID:FFB5DD62-4991-11D9-B3AD-000D93C45D90 SEQUENCE:5 DTSTAMP:20041209T032845Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041112T030000 DTEND;TZID=America/New_York:20041112T043000 SUMMARY:mid-overlap UID:A29A6C78-4A34-11D9-B3AD-000D93C45D90 SEQUENCE:1 DTSTAMP:20041209T224956Z END:VEVENT BEGIN:VEVENT DTSTART;TZID=America/New_York:20041112T160000 SUMMARY:another UID:40E3266B-4A36-11D9-B3AD-000D93C45D90 SEQUENCE:3 DTSTAMP:20041209T230232Z DURATION:PT1H END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/11complex.ics.xml0000444000076500007650000011270211032266422020160 0ustar rickrick span 2004-12-08T19:47:11 2004-11-08T00:00:00 2004-11-07T00:00:00 span 2004-12-08T19:47:11 2004-11-09T00:00:00 2004-11-08T00:00:00 long1 here 5.00 2004-11-14T15:24:30 2004-11-09T00:00:00 2004-11-08T19:00:00 span 2004-12-08T19:47:11 2004-11-10T00:00:00 2004-11-09T00:00:00 long1 here 24.00 2004-11-14T15:24:30 2004-11-10T00:00:00 2004-11-09T00:00:00 overlapping span 2004-12-08T19:47:03 2004-11-11T00:00:00 2004-11-10T00:00:00 span 2004-12-08T19:47:11 2004-11-11T00:00:00 2004-11-10T00:00:00 long1 20.00 here 2004-11-14T15:24:30 2004-11-10T20:00:00 2004-11-10T00:00:00 overlapping span 2004-12-08T19:47:03 2004-11-12T00:00:00 2004-11-11T00:00:00 overnight 15.00 2004-11-14T16:42:58 2004-11-12T00:00:00 2004-11-11T09:00:00 overlapping span 2004-12-08T19:47:03 2004-11-13T00:00:00 2004-11-12T00:00:00 overnight 14.00 2004-11-14T16:42:58 2004-11-12T14:00:00 2004-11-12T00:00:00 mid-overlap 1.50 2004-12-09T17:49:56 2004-11-12T04:30:00 2004-11-12T03:00:00 third overlap 4.75 2004-12-08T22:28:45 2004-11-12T15:45:00 2004-11-12T11:00:00 another 1.00 2004-12-09T18:02:32 2004-11-12T17:00:00 2004-11-12T16:00:00 http://foo 1 hr event 1.00 TENTATIVE 2004-11-13T17:06:34 2004-11-12T22:00:00 2004-11-12T20:45:00 DISPLAY Event reminder Rick Frankel mailto:rick this is a note line 2 and a longer line for line three. make it wrap UNCLEAN 2004-11-12T21:00:00 Lindsey Biel mailto:lindsey Jay Frankel mailto:jayfrankel someone else invalid:nomail short overnight 7.00 2004-11-14T16:51:37 2004-11-14T00:00:00 2004-11-13T17:00:00 short overnight 16.50 2004-11-14T16:51:37 2004-11-14T16:30:00 2004-11-14T00:00:00 all day 2004-11-12T20:52:26 2004-11-16T00:00:00 2004-11-15T00:00:00 weekly 1.00 2004-11-30T17:46:44 2004-11-16T22:00:00 Frankel Rick mailto:rick UNCLEAN 2004-11-16T21:00:00 Biel Lindsey mailto:lindsey Frankel Jay mailto:jayfrankel daily 1.00 CONFIRMED 2004-11-26T17:07:30 2004-11-17T22:00:00 Alarm notification 2004-11-16T21:00:00 EMAIL This is an event reminder mailto:rick Rick Frankel mailto:rick UNCLEAN Lindsey Biel mailto:lindsey 2004-11-17T21:00:00 daily 2.00 CANCELLED 2004-11-13T15:33:54 2004-11-18T23:00:00 Rick Frankel mailto:rick UNCLEAN Lindsey Biel mailto:lindsey 2004-11-18T21:00:00 daily 1.00 2004-11-16T21:49:41 2004-11-19T22:00:00 Rick Frankel mailto:rick UNCLEAN 2004-11-19T21:00:00 Lindsey Biel mailto:lindsey daily 1.00 2004-11-16T21:49:41 2004-11-20T22:00:00 Rick Frankel mailto:rick UNCLEAN 2004-11-20T21:00:00 Lindsey Biel mailto:lindsey weekly 1.00 2004-11-30T17:46:44 2004-11-23T22:00:00 Frankel Rick mailto:rick UNCLEAN 2004-11-23T21:00:00 Biel Lindsey mailto:lindsey Frankel Jay mailto:jayfrankel all day repeat 2004-11-13T11:28:20 2004-11-25T00:00:00 2004-11-24T00:00:00 all day repeat 2004-11-13T11:28:20 2004-11-26T00:00:00 2004-11-25T00:00:00 all day repeat 2004-11-13T11:28:20 2004-11-27T00:00:00 2004-11-26T00:00:00 another weekly 1.00 2004-11-13T19:20:37 2004-11-27T20:00:00 2004-11-27T19:00:00 monday 2004-11-30T16:53:51 2004-11-30T00:00:00 2004-11-29T00:00:00 eom allday here 2004-11-30T18:12:46 2004-12-01T00:00:00 this is < a note 2004-11-30T00:00:00 weekly 1.00 2004-11-30T17:46:44 2004-11-30T22:00:00 Frankel Rick mailto:rick UNCLEAN 2004-11-30T21:00:00 Biel Lindsey mailto:lindsey Frankel Jay mailto:jayfrankel mon/wed-changed 1.00 2004-11-13T21:45:27 2004-12-01T19:00:00 2004-12-01T18:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-02T01:00:00 2004-12-01T23:45:00 DISPLAY Event reminder 2004-12-01T23:30:00 DISPLAY Event reminder 2004-12-02T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-03T01:00:00 2004-12-02T23:45:00 DISPLAY Event reminder 2004-12-02T23:30:00 DISPLAY Event reminder 2004-12-03T00:00:00 monday 2004-11-30T16:53:51 2004-11-30T00:00:00 2004-11-29T00:00:00 eom allday here 2004-11-30T18:12:46 2004-12-01T00:00:00 this is < a note 2004-11-30T00:00:00 weekly 1.00 2004-11-30T17:46:44 2004-11-30T22:00:00 Frankel Rick mailto:rick UNCLEAN 2004-11-30T21:00:00 Biel Lindsey mailto:lindsey Frankel Jay mailto:jayfrankel mon/wed-changed 1.00 2004-11-13T21:45:27 2004-12-01T19:00:00 2004-12-01T18:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-02T01:00:00 2004-12-01T23:45:00 DISPLAY Event reminder 2004-12-01T23:30:00 DISPLAY Event reminder 2004-12-02T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-03T01:00:00 2004-12-02T23:45:00 DISPLAY Event reminder 2004-12-02T23:30:00 DISPLAY Event reminder 2004-12-03T00:00:00 mon/wed 1.00 2004-11-13T21:45:27 2004-12-06T19:00:00 2004-12-06T18:00:00 mon/wed 1.00 2004-11-13T21:45:27 2004-12-08T19:00:00 2004-12-08T18:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-09T01:00:00 2004-12-08T23:45:00 DISPLAY Event reminder 2004-12-08T23:30:00 DISPLAY Event reminder 2004-12-09T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-10T01:00:00 2004-12-09T23:45:00 DISPLAY Event reminder 2004-12-09T23:30:00 DISPLAY Event reminder 2004-12-10T00:00:00 another weekly 1.00 2004-11-13T19:20:37 2004-12-11T20:00:00 2004-12-11T19:00:00 sunday 1.00 2004-11-30T16:56:23 2004-12-12T18:00:00 2004-12-12T17:00:00 mon/wed 1.00 2004-11-13T21:45:27 2004-12-13T19:00:00 2004-12-13T18:00:00 mon/wed 1.00 2004-11-13T21:45:27 2004-12-15T19:00:00 2004-12-15T18:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-16T01:00:00 2004-12-15T23:45:00 DISPLAY Event reminder 2004-12-15T23:30:00 DISPLAY Event reminder 2004-12-16T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-17T01:00:00 2004-12-16T23:45:00 DISPLAY Event reminder 2004-12-16T23:30:00 DISPLAY Event reminder 2004-12-17T00:00:00 mon/wed 1.00 2004-11-13T21:45:27 2004-12-20T19:00:00 2004-12-20T18:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-23T01:00:00 2004-12-22T23:45:00 DISPLAY Event reminder 2004-12-22T23:30:00 DISPLAY Event reminder 2004-12-23T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-24T01:00:00 2004-12-23T23:45:00 DISPLAY Event reminder 2004-12-23T23:30:00 DISPLAY Event reminder 2004-12-24T00:00:00 another weekly 1.00 2004-11-13T19:20:37 2004-12-25T20:00:00 2004-12-25T19:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-30T01:00:00 2004-12-29T23:45:00 DISPLAY Event reminder 2004-12-29T23:30:00 DISPLAY Event reminder 2004-12-30T00:00:00 eoy all 2004-11-23T22:52:46 2005-01-01T00:00:00 2004-12-31T00:00:00 weird 1.00 2004-11-16T21:37:08 2004-12-31T01:00:00 2004-12-30T23:45:00 DISPLAY Event reminder 2004-12-30T23:30:00 DISPLAY Event reminder 2004-12-31T00:00:00 todo 1 mailto:me 2004-11-13T00:00:00 COMPLETED 2004-11-13T21:49:52 9 2004-11-13T00:00:00 todo 2 2004-12-10T23:02:10 2004-11-13T00:02:00 file://localhost/Applications/iCal.app/ PROCEDURE Alarm notification 2004-11-12T23:45:00 EMAIL This is an event reminder mailto:rick 1 2004-11-20T00:00:00 2004-11-13T00:00:00 todo 3 2004-11-16T21:19:21 2004-11-11T23:45:00 file://localhost/Users/rick/Documents/businesscard.bcard PROCEDURE 2004-11-11T23:45:00 DISPLAY Event reminder 5 2004-11-14T00:00:00 2004-11-12T00:00:00 todo 4 2004-11-13T22:34:28 99 not much 2004-11-13T00:00:00 iCal-Parser-SAX-1.09/t/calendars/12multi-year.ics0000444000076500007650000000065211032266422020003 0ustar rickrickBEGIN:VCALENDAR VERSION:2.0 PRODID:-//Testing//Test//EN BEGIN:VEVENT DURATION:PT1H DTSTAMP:20041113T220634Z UID:823732B9-3516-11D9-8A43-000D93C45D90 DTSTART;TZID=America/New_York:20041112T210000 SUMMARY:1 hr event END:VEVENT BEGIN:VEVENT DURATION:PT1H DTSTAMP:20041113T220634Z UID:823732B9-3516-11D9-8A43-000D93C45D90 DTSTART;TZID=America/New_York:20051112T210000 SUMMARY:1 hr event END:VEVENT END:VCALENDAR iCal-Parser-SAX-1.09/t/calendars/12multi-year.ics.xml0000444000076500007650000000521011032266422020575 0ustar rickrick1 hr event1.002004-11-13T17:06:342004-11-12T22:00:002004-11-12T21:00:001 hr event1.002004-11-13T17:06:342005-11-12T22:00:002005-11-12T21:00:00iCal-Parser-SAX-1.09/t/calendars/url.xml0000444000076500007650000000373111032266422016375 0ustar rickrick all day 2004-11-13T01:52:26 2004-11-16T00:00:00 2004-11-15T00:00:00