I am attempting to implement Julian Buss' terrific method of ical output as a non rendered xpage (http://blog.youatnotes.de/web/youatnotes/blog-jb.nsf/dx/how-to-implement-an-icalendar-feed-with-xpages.htm?opendocument&comments). But I am unable to get the date to show up as a proper ISO date format yyyymmdd
I am getting my date from a notes view. Formatting the columns has no affect. I have tried various methods of formatting the date using javascript and failed.
I am not sure if what I am doing is possible. If I should be looking at making the change to the Notes view. Or should I make the change in javascript?
Also open to alternative methods of producing an ics file from a notes database.
Here is the code from my non rendered xpage
<xp:this.afterRenderResponse><![CDATA[#{javascript:var exCon = facesContext.getExternalContext();
var writer = facesContext.getResponseWriter();
var response = exCon.getResponse();
var nview:NotesView = database.getView("ical");
nview.setAutoUpdate(false);
var vc:NotesViewEntryCollection = nview.getAllEntries();
var ve:NotesViewEntry = vc.getFirstEntry();
var values;
var date;
var body;
var period;
var i = 0;
response.setContentType("text/calendar");
response.setHeader("Cache-Control", "no-cache");
writer.write("BEGIN:VCALENDAR\r\n");
writer.write("VERSION:2.0\r\n");
writer.write("X-LOTUS-CHARSET:UTF-8\r\n");
while (ve) {
values = ve.getColumnValues();
date = ve.getColumnValues()[1];
edate = ve.getColumnValues()[2];
body = values.elementAt(3);
period = values.elementAt(2);
writer.write("BEGIN:VEVENT\r\n");
writer.write("DTSTART:"+date+"T080000\r\n");
writer.write("DTEND:"+edate+"T080000\r\n");
writer.write("DESCRIPTION:"+body+"\r\n");
writer.write("END:VEVENT\r\n");
ve = vc.getNextEntry(ve); } writer.write("END:VCALENDAR\r\n");
writer.endDocument(); }]]></xp:this.afterRenderResponse>
This is the output from an event
BEGIN:VEVENT
DTSTART:08/12/2004T080000
DTEND:08/13/2004T080000
DESCRIPTION:Patrick Sawyer: Out of Office
END:VEVENT