iCalendar library (critique new use cases for qCal library)
Moderator: General Moderators
The problem with PHPiCal is that it's already taken. I guess that leaves iCalPHPKieran Huggins wrote:Php Extension for Normalized iCal Syntax
I happen to know of a computer store with the ideal logo!
Seriously though, maybe you should stick with the incredibly un-sexy "PHPiCal" name, it's far more Google friendly.
EDIT: OH and LOL!!! that is awesome. I wish I could name it that, but nobody would use it.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
ReverendDexter and I have come up with a decent use case for this library. It may see the light of day after all. We're just looking for advice, comments etc. Thanks! (arborint
)
We've decided to simply call the libary "qCal" 
Code: Select all
<?php
// create icalendar object
$cal = new qCal();
// create import of external calendar and import it into our calendar
$import = new qCal_Import_file($cal); // implements the qCal_Import_Interface
$import->import('../calendars/holidays.ical');
$import->import('../calendars/somethingelse.ical');
// create another importer from custom database application
$anotherimport = new qCal_Import_DatabaseCustom($cal); // custom-written import class for database crud application
$anotherimport->import();
// create a renderer to render our calendar to html hCal format
$renderer = new qCal_Renderer_hCal($cal); // implements qCal_Renderer_Interface or qCal_Renderer_Abstract
$renderer->render('../html/calendar_display.html');
// create a renderer to render our calendar to rss
$renderer = new qCal_Renderer_rss($cal); // implements qCal_Renderer_Interface or qCal_Renderer_Abstract
$renderer->render('../rss/rss.xml');
// renders to a custom html output of our calendar
$renderer = new qCal_Renderer_HTMLCustoqCalendar($cal);
$renderer->render('../templates/some-template.phtml');
// create an event object
$event = new qCal_Event(); // extends qCal_Attachable
$event->setStartDate(new qCal_Date('04/23/2007')); // internally it will accept qCal_Date and if not one, it will accept a string with date
$event->setRecurringRule(new qCal_Event_Recur()); // this is possible (not sure of the syntax)
// attach the event object
// detach & attach accept qCal objects, any kind of qCal_Attachable object, uids (detach only), or arrays of any combination
// if event uids of $events conflict with uids from $cal, the $events overwrite
$cal->attach($event);
// create a todo object
$todo = new qCal_Todo(); // extends qCal_Attachable
$todo->setDate(new qCal_Date('04/23/2007'));
$cal->attach($todo);
// attach a new journal entry
$cal->attach(new qCal_Journal());
// create a filter to grab a range of dates (filters can grab any number / types of objects from the qCal object)
$range = new qCal_Filter_DateRange(new qCal_Date('12/25/2007'), new qCal_Date('1/1/2008')); // exnteds qCal_Filter
$event_range = $range->filter($cal); // returns an qCal object
$filter = new qCal_Filter_RemoveDuplicates($cal2);
$unique = $filter->filter($cal); // $unique is our new qCal object with no duplicates (duplicates = different uid, but same everything else)
// internally it would do $this->detachMultiple($events) or possibly just a foreach
// detach & attach accept qCal objects, any kind of qCal_Attachable object, uids (detach only), or arrays of any combination
$cal->detach($event_range);
// export event range (qCal object) to a file
$export = new qCal_Export_File($event_range);
$export->export('../calendars/christmas-newyears.ical');
$event = $event->get('1234@something');
$event->setStartDate('04/23/2007'); // internally it will accept qCal_Date and if not one, it will accept a string with date and create a qCal_Date object
$cal->attach($event); // this is how we "edit" objects, get->edit->attach()
// export calendar to a file
$export = new qCal_Export_file($cal);
$export->export('../calendars/newcalendar.ics');
// export calendar with custom database object that implements qCal_Export_Interface or qCal_Interface_Abstract
$export = new qCal_Export_DatabaseCustom($cal); // custom-written import class for application
$export->export();
Last edited by Luke on Tue Sep 25, 2007 2:58 pm, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
If you are asking if there is a library yet, the answer is no. I'm just trying to nail down at least an idea of an interface.
EDIT: When the library is finished, we'll be releasing it as free/open source though. We are also developing an (ajaxified) events calendar application that will (likely) be built on top of the Zend Framework and it will use this library extensively. This will not be free... it will be licensed to our clients for a fee.
UPDATE- 9/25/07 - I have added a google code homepage for this project here: http://code.google.com/p/qcal/
EDIT: When the library is finished, we'll be releasing it as free/open source though. We are also developing an (ajaxified) events calendar application that will (likely) be built on top of the Zend Framework and it will use this library extensively. This will not be free... it will be licensed to our clients for a fee.
UPDATE- 9/25/07 - I have added a google code homepage for this project here: http://code.google.com/p/qcal/
OK there is some groundwork laid out now, so if you would like to see the work I've done so far you can check it out on the google code page. I'd love some feedback from folks on what I've done so far.. but I realize downloading and looking through code is a lot to ask of people... so no big deal if you don't wanna. 
EDIT - Almost forgot - you can browse the library's subversion repository here:
http://qcal.googlecode.com/svn/trunk/lib/
I do not have any packaged downloads yet... only subversion.
EDIT - Almost forgot - you can browse the library's subversion repository here:
http://qcal.googlecode.com/svn/trunk/lib/
I do not have any packaged downloads yet... only subversion.
I'm also a little confused by the description of a version in the rfc. Maybe one of you could help me interpret it?
VERSION:1.0;2.0;
So if I had a minimum and a maximum, would it look like this?4.7.4 Version
Property Name: VERSION
Purpose: This property specifies the identifier corresponding to the
highest version number or the minimum and maximum range of the
iCalendar specification that is required in order to interpret the
iCalendar object.
Value Type: TEXT
Property Parameters: Non-standard property parameters can be
specified on this property.
Conformance: This property MUST be specified by an iCalendar object,
but MUST only be specified once.
Description: A value of "2.0" corresponds to this memo.
Format Definition: The property is defined by the following notation:
version = "VERSION" verparam ":" vervalue CRLF
verparam = *(";" xparam)
vervalue = "2.0" ;This memo
/ maxver
/ (minver ";" maxver)
minver = <A IANA registered iCalendar version identifier>
;Minimum iCalendar version needed to parse the iCalendar object
maxver = <A IANA registered iCalendar version identifier>
;Maximum iCalendar version needed to parse the iCalendar object
Example: The following is an example of this property:
VERSION:2.0
VERSION:1.0;2.0;
Is there any interest in a library such as this? We'll have the first release ready by the end of the month. The only real goal for the first release is the ability to create an icalendar from scratch and serialize it for saving / outputting. Other than that it will be pretty sparse on functionality. The release will come with documentation, and unit tests although I don't know how thorough they'll be. Also we'll be announcing the release on our blog with more details as well.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA