You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Marshall Roch <ma...@exclupen.com> on 2003/12/03 02:05:25 UTC

Calendaring

I need to have a calendar of events on the site I'm building.  I'd also 
like the people who maintain the calendar to also update the website. 
They use Mozilla Calendar or Apple iCal, both of which can export 
iCalendar files to the file system, FTP, or webdav.

iCalendar files are textual[1], so to use them in Forrest, some sort of 
transformation to XML will be needed.  I'd love to be able to do the 
whole thing in Forrest, but I have no idea how to transform non-XML 
files.  There is an XML-ized version of iCalendar called xCal, and one 
in RDF, so if the iCal file can be converted to either of those, I can 
handle the rest in Forrest.

An option is to use a 3rd-party program like PHP iCalendar, which will 
parse the iCalendar file per-request and generate an RSS feed, but I'd 
really rather not do that.

If there is a way to do this, or anything else you can think of that 
might get me started, please let me know.

--
Marshall Roch

[1] See http://www.apple.com/ical/library/ for a bunch of examples.


Re: Calendaring

Posted by Nicola Ken Barozzi <ni...@apache.org>.
David Crossley wrote:
...
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/webapp/samples/#dirlist
> 
> The source is at .../src/blocks/chaperon/

To test them this is where to look for.

In any case I have recently changed how chaperon resources are used in 
forrest, and the complete samples dir is now also under 
xml-forrest/src/core/context/resources/chaperon/ , so that if someone 
wants to add chaperon stuff in Forrest based on those samples it's easier.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Calendaring

Posted by David Crossley <cr...@indexgeo.com.au>.
Marshall Roch wrote:
> David Crossley wrote:
> > Well, Chaperon was going to be my suggestion, but you beat me to it.
> > There is an example at 'forrest seed site' and there are other examples
> > at the Cocoon Samples (you need a local Cocoon to see them). There
> > is of course the Chaperon.sf.net website for further info.
> 
> Sorry if I'm being dense, but I can't find these examples.  Is the one 
> included in "forrest seed site" the wiki?

That is correct.

> If the cocoon samples ones 
> are included with Cocoon, I should be able to find them in Cocoon CVS. 
> Where are they?

You would need to download Cocoon-2.1 (any version would do)
and run it locally, by following the instructions in INSTALL.txt

> No luck finding it here: 
>
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/webapp/samples/#dirlist

The source is at .../src/blocks/chaperon/

--David



Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
David Crossley wrote:
> Well, Chaperon was going to be my suggestion, but you beat me to it.
> There is an example at 'forrest seed site' and there are other examples
> at the Cocoon Samples (you need a local Cocoon to see them). There
> is of course the Chaperon.sf.net website for further info.

Sorry if I'm being dense, but I can't find these examples.  Is the one 
included in "forrest seed site" the wiki?  If the cocoon samples ones 
are included with Cocoon, I should be able to find them in Cocoon CVS. 
Where are they?

No luck finding it here: 
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/webapp/samples/#dirlist

--
Marshall Roch


Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
Marshall Roch wrote:
> Johan Kok wrote:
>> How and where do you intend to store the calendar information?
> 
> I will most likely keep it all in the .ics (iCalendar) file that Mozilla
> and iCal create.  If you make that file accessible through WebDAV, you
> can make changes right in Mozilla or iCal and it will automatically be
> uploaded to the site, which leads to your next question.

Appendum: If iCalendar is transformed into xCal, then into the doc 
format, then maybe the iCalendar step could be optional and you could 
write the calendar manually in xCal format if you didn't want to use a 
program to generate the iCalendar.

--
Marshall Roch


Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
Johan Kok wrote:
> Will have to look at the iCal and xCal specs.

xCal was a draft proposal from the IETF, but it expired and therefore 
might be hard to find on their site.  I think the most recent version I 
found was the 3rd draft, dated January, 2003, but there are several 
other older drafts.

Another option is the W3C's RDF format (possibly called RDFiCal, not 
positive on the official name).  I think the transformation might be a 
little more work, but I don't think that format is dead.

--
Marshall Roch


Re: Calendaring (status update)

Posted by Marshall Roch <ma...@exclupen.com>.
Johan Kok wrote:
> However the iCal and xCal options are likely to be able to proivde a
> solution. First cut in list format is perfect. One can always take
> that and filter and transform into whatever display format one would
> like to have.

It took a while to wrap my head around it, but I finally figured out how
to write grammars for Chaperon! :-)

The iCal spec allows programs to extend the format by adding their own
properties, and there are a ton of existing properties, so instead of
defining rules for each property, I have it directly translating iCal
properties to XML elements, which seems to work very well, even though
there can't be a DTD.

Chaperon's output is extremely messy, so I'm using an XSL stylesheet to
get the mapping of properties to elements right.  I think we should keep
this intermediate format instead of jumping straight to docv12, so that
it's easier to transform to a bunch of different outputs, but I don't
know how Forrest handles this.

How would I go about setting up a transformation like the following?

                             .-- list of events
iCal --> intermediate XML ----- monthly table
                             `-- RSS, some other format, etc.

I can throw the .grm and .xsl online if people want to see them.

--
Marshall Roch


Re: Calendaring

Posted by Johan Kok <jk...@messianic.dyndns.org>.
> Will have to look at the iCal and xCal specs. I was considering 
> storing the data into a database. Selection to be via a calendar based 
> front-end with various display format. However the iCal and xCal 
> options are likely to be able to proivde a solution. First cut in list 
> format is perfect. One can always take that and filter and transform 
> into whatever display format one would like to have.
>
> JK
>
> Marshall Roch wrote:
>
>> Johan Kok wrote:
>>
>>> You're a little ahead of me, as I am also interested in a calendar 
>>> application(s), but in two very different forms. One in the classic 
>>> form displaying days in a month and the other in a timeline format. 
>>> The former is higher on the priority list, with a number of different
>>>  output formats. The initial application is for sports events.
>>
>>
>>
>> Right now, all I need is for it to list the events in order by date,
>> separated into months (which i think is what you refer to as a
>> timeline).  Eventually, it would be cool to generate it in a table
>> format for the current month, but that can't happen until it at least
>> can list the events.
>>
>> What are you looking for for output formats?  I'm thinking about the
>> plain list, month view as a table, iCalendar, and RSS.  Once it's
>> parsed, it shouldn't be hard to make these different formats.
>>
>> By making the iCalendar file public, anyone using Mozilla, iCal,
>> Evolution, Outlook, Palm Desktop, or any of a bunch of other
>> iCalendar-aware programs can "subscribe" to the calendar and have your
>> calendar events automatically added to their calendars.
>>
>>> How and where do you intend to store the calendar information?
>>
>>
>>
>> I will most likely keep it all in the .ics (iCalendar) file that Mozilla
>> and iCal create.  If you make that file accessible through WebDAV, you
>> can make changes right in Mozilla or iCal and it will automatically be
>> uploaded to the site, which leads to your next question.
>>
>>> Do you intend to use staticly published pages, or dynamically 
>>> generated pages? The latter would imply doing a seperate cocoon 
>>> sitemap which may be called from the static forrest pages.
>>
>>
>>
>> I don't know Cocoon well enough to know how hard it will be to do it
>> dynamically, but having both would be nice.  If it's dynamic, changes to
>> the calendar in your program will be reflected on the site immmediately,
>> which I think is cool.
>>
>> -- 
>> Marshall Roch
>>
>>
>>
>


Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
Johan Kok wrote:
> You're a little ahead of me, as I am also interested in a calendar 
> application(s), but in two very different forms. One in the classic 
> form displaying days in a month and the other in a timeline format. 
> The former is higher on the priority list, with a number of different
>  output formats. The initial application is for sports events.

Right now, all I need is for it to list the events in order by date,
separated into months (which i think is what you refer to as a
timeline).  Eventually, it would be cool to generate it in a table
format for the current month, but that can't happen until it at least
can list the events.

What are you looking for for output formats?  I'm thinking about the
plain list, month view as a table, iCalendar, and RSS.  Once it's
parsed, it shouldn't be hard to make these different formats.

By making the iCalendar file public, anyone using Mozilla, iCal,
Evolution, Outlook, Palm Desktop, or any of a bunch of other
iCalendar-aware programs can "subscribe" to the calendar and have your
calendar events automatically added to their calendars.

> How and where do you intend to store the calendar information?

I will most likely keep it all in the .ics (iCalendar) file that Mozilla
and iCal create.  If you make that file accessible through WebDAV, you
can make changes right in Mozilla or iCal and it will automatically be
uploaded to the site, which leads to your next question.

> Do you intend to use staticly published pages, or dynamically 
> generated pages? The latter would imply doing a seperate cocoon 
> sitemap which may be called from the static forrest pages.

I don't know Cocoon well enough to know how hard it will be to do it
dynamically, but having both would be nice.  If it's dynamic, changes to
the calendar in your program will be reflected on the site immmediately,
which I think is cool.

--
Marshall Roch


Re: Calendaring

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le Mercredi, 3 déc 2003, à 03:35 Europe/Zurich, Marshall Roch a écrit :

> ...Here's a sample from the SAT calendar that I imported into Mozilla  
> Calendar and then exported again.
>
> It uses "line folding," where a line can be broken up as long as there  
> is a space as the first character of the split line (see UID, SUMMARY,  
> and DESCRIPTION below).

Currently SLOP parses lines like

   BEGIN:VCALENDAR

into

   <BEGIN>VCALENDAR</BEGIN>

But it won't handle the line folding as is.

If you have a look at the source code  
(cocoon-2.1/src/blocks/slop/java/org/apache/cocoon/slop/parsing/ 
SimpleSlopParser.java) you'll see that it would be easy to implement  
(optional) line folding, by modifying the processLine() and  
endDocument() methods so that folded lines are accumulated before  
calling parseLine().

If you want to modify it, I'd be glad to integrate your modified code  
in the Cocoon CVS (with due credit of course).
--
   Bertrand Delacretaz
   independent consultant, Lausanne, Switzerland
   http://cvs.apache.org/~bdelacretaz/


Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
David Crossley wrote:
> Well, Chaperon was going to be my suggestion, but you beat me to it.
> There is an example at 'forrest seed site' and there are other examples
> at the Cocoon Samples (you need a local Cocoon to see them). There
> is of course the Chaperon.sf.net website for further info.

I'll check them out, thanks. :)

> There may be another possibility: Cocoon also has the SLOP parser -
> Simple Line-Oriented Parser. However, i cannot see the ical examples
> that you referenced - they may be too complex for SLOP.

Here's a sample from the SAT calendar that I imported into Mozilla 
Calendar and then exported again.

It uses "line folding," where a line can be broken up as long as there 
is a space as the first character of the split line (see UID, SUMMARY, 
and DESCRIPTION below).

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
METHOD:PUBLISH
BEGIN:VEVENT
UID
  :9363BE64-E919-11D7-AF7F-000A27E16A94
SUMMARY
  :SAT I&II
DESCRIPTION
  :Deadlines:\nUS Regular:  Oct. 30\, 2003\nUS Late:  Nov. 12\, 2003\nIntl
   Early: Oct. 8\, 2003\nIntl Regular: Oct. 30\, 2003\n\nGo to
  URL for specific details on application deadlines and test 
administration\n
  \n\n\n
URL:http://www.collegeboard.com/student/testing/sat/calenfees.html
CLASS:PUBLIC
X-MOZILLA-RECUR-DEFAULT-INTERVAL:0
DTSTART;VALUE=DATE:20031206
DTEND;VALUE=DATE:20031207
DTSTAMP:20030917T141559Z
END:VEVENT
END:VCALENDAR

Let me know which parser you think is better suited for the job.

Thanks!

--
Marshall Roch


Re: Calendaring

Posted by David Crossley <cr...@indexgeo.com.au>.
Marshall Roch wrote:
> Marshall Roch wrote:
> > iCalendar files are textual[1], so to use them in Forrest, some sort of 
> > transformation to XML will be needed.  I'd love to be able to do the 
> > whole thing in Forrest, but I have no idea how to transform non-XML 
> > files.
> 
> Of course, I don't find something promising until /after/ posting about 
> it... Chaperon looks like it could be what I'm looking for here.  I just 
> have to figure out how to use it.  I will see what I can come up with on 
> my own.
> 
> Unless there are any other suggestions, I seem to have more-or-less 
> figured it out on my own. :)

Well, Chaperon was going to be my suggestion, but you beat me to it.
There is an example at 'forrest seed site' and there are other examples
at the Cocoon Samples (you need a local Cocoon to see them). There
is of course the Chaperon.sf.net website for further info.

There may be another possibility: Cocoon also has the SLOP parser -
Simple Line-Oriented Parser. However, i cannot see the ical examples
that you referenced - they may be too complex for SLOP.

--David



Re: Calendaring

Posted by Marshall Roch <ma...@exclupen.com>.
Marshall Roch wrote:
> iCalendar files are textual[1], so to use them in Forrest, some sort of 
> transformation to XML will be needed.  I'd love to be able to do the 
> whole thing in Forrest, but I have no idea how to transform non-XML 
> files.

Of course, I don't find something promising until /after/ posting about 
it... Chaperon looks like it could be what I'm looking for here.  I just 
have to figure out how to use it.  I will see what I can come up with on 
my own.

Unless there are any other suggestions, I seem to have more-or-less 
figured it out on my own. :)

--
Marshall Roch