Search

Is it possible to import my iCal into Symphony and produce XML that will in turn be parsed onto a website. I basically want to have a dynamic calendar on my site so clients can see if I am available or not.

Looking at a few online resources it doesn't look possible. Shame because I think it would be really cool if I could upload my iCal information and it was reflected online.

I can't see a way to do this directly. However there are cheap software tools which exist to synchronise your local iCal to a Google Calendar. And a Google Calendar has an Atom feed, which could be plugged into Symphony as a Dynamic Data Source.

We use BusySync for iCal syncing on our LAN.

Will this article from Symphony super user Stephen Bau help? Also, as Stephen points out in another article, maybe this article from Apple can help.

cheers guys, all good stuff.

The Apple article requires special server requirements. I suppose what would be easier to do is to export the calendar in .ics format and then upload that into Symphony and it synch's the online calendar up.

I can think of loads of ways where that functionality would be so useful in Symphony.

Hi Nick, got your email, but figured this would be useful for others to know.

Have you grabbed the ensemble? See the list of ensembles. With the Calendar Ensemble that I've developed, you can grab the XSLT template I developed to parse ICS files into the xCalendar format.

For example, start with Boxing Day as an ICS file as the text() value of the vcalendar element of an XML data source:

<?xml version='1.0' encoding='utf-8'?>
<data>
<vcalendar>
BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:Holidays
PRODID:-//Apple Computer\, Inc//iCal 2.0//EN
X-WR-RELCALID:EC7545B7-4F3E-4339-99F7-7EABF10CC71D
X-WR-TIMEZONE:America/Vancouver
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART;VALUE=DATE:20021226
DTEND;VALUE=DATE:20021227
SUMMARY:Boxing Day
UID:28D02380-F52B-49D2-AACA-70A808BC36E1
DTSTAMP:20020917T175456Z
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=12
END:VEVENT
END:VCALENDAR
</vcalendar>
</data>

Then, use the attached XSL file to transform this data into the following:

<!DOCTYPE h1 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<h1>XSL Transformation of iCalendar ICS format to XHTML</h1><h2>Individual iCalendar Events</h2><h3>iCalendar to xCalendar XSL Transformation</h3><iCalendar>
  <vcalendar version="2.0" x-wr-calname="Holidays" prodid="-//Apple Computer\, Inc//iCal 2.0//EN" x-wr-relcalid="EC7545B7-4F3E-4339-99F7-7EABF10CC71D" x-wr-timezone="America/Vancouver" calscale="GREGORIAN" method="PUBLISH">
    <vevent>
      <dtstart value="date">20021226</dtstart>
      <dtend value="date">20021227</dtend>
      <summary>Boxing Day</summary>
      <uid>28D02380-F52B-49D2-AACA-70A808BC36E1</uid>
      <dtstamp>20020917T175456Z</dtstamp>
      <rrule><item class="freq">yearly</item><item class="interval">1</item><item class="bymonth">12</item>&#13;        </rrule>
    </vevent>
  </vcalendar>
</iCalendar>

Now, once you have your xCal data, you can create a static XML data source that uses this XML to insert the date in the proper place. I have added a parameter that takes an ICS file for Canadian Holidays, then inserts the title of the holiday into the calendar.

<xsl:param name="is-holiday">
    <xsl:for-each select="iCalendar/vcalendar[@x-wr-calname='Holidays']/vevent[substring(dtstart,5) = $this-month-day][not(rrule/item/@class='byday') and rrule/item[@class='freq']='yearly']">
        <xsl:if test="substring(dtstart,5) = $this-month-day">1</xsl:if>
    </xsl:for-each>
</xsl:param>

Then, use this parameter in the days template to insert the day in the proper place:

    <xsl:when test="$index &gt; $start - 1">
        <td>
            <xsl:if test="$day-int = $day">
                <xsl:attribute name="class">current</xsl:attribute>
            </xsl:if>
            <xsl:if test="$is-today = 1">
                <xsl:attribute name="id">today</xsl:attribute>
            </xsl:if>
            <span><a href="/calendar/{$year}/{$month}/{$day-dd}/"><xsl:value-of select="$day-int"/></a></span>
            <xsl:if test="$is-holiday = 1">
                <p class="holiday"><xsl:value-of select="iCalendar/vcalendar[@x-wr-calname='Holidays']/vevent[substring(dtstart,5) = $this-month-day]/summary"/></p>
            </xsl:if>
        </td>
    </xsl:when>

You can view this in context in the XSL template that drives the calendar month page on one of my sites: this page shows Canada Day.

Attachments

Found this interesting XSLT stylesheet by Doug Royer, xCal to iCal.

Syncing ical and google calender should not need any 3th party apps anymore, they now both support the caldav standard (just like contacts support the carddav):

Is there a known library /method for providing .ics compliant format for use in ical from an XML feed? basically the reverse of what's been outlined above?

Started reading this webpage and it seems to provide some form of xmltoical.xsl file: http://www.fprimex.com/coding/tv-cal.html

Ignore me, found this thread on the forum: http://getsymphony.com/discuss/thread/79850/

@bauhouse Any chance you can respost or send me the ical-to-xcal-xml.xsl.zip file? The link no longer works. Thanks!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details