xlawrence 2004/12/22 09:19:40 CET
Modified files:
src/java/org/jahia/suite/calendar/syncClients
CalendarFileManager.java
Log:
Added default calendar properties in case calendar properties returned by the
server are empty. This prevents a ValidationException from ical4j when building
the iCalendar file
Revision Changes Path
1.7 +8 -0
uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/CalendarFileManager.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/CalendarFileManager.java.diff?r1=1.6&r2=1.7&f=h
Index: CalendarFileManager.java
===================================================================
RCS file:
/home/cvs/repository/uwcal_JSR168/src/java/org/jahia/suite/calendar/syncClients/CalendarFileManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CalendarFileManager.java 13 Dec 2004 09:56:12 -0000 1.6
+++ CalendarFileManager.java 22 Dec 2004 08:19:40 -0000 1.7
@@ -179,6 +179,14 @@
StringBuffer calendar = new StringBuffer();
calendar.append("BEGIN:VCALENDAR\n");
for (int i=0; i<items.length; i++) {
+ if (i==0 && items[i].startsWith("BEGIN")) {
+ // before writing the first VEVENT, we need to
+ // write the calendar properties
+ calendar.append(
+ "PRODID:-//Jahia Solutions//iCalendar SyncClient 1.0
MIMEDIR//EN\n" +
+ "VERSION:2.0\n" +
+ "METHOD:PUBLISH\n");
+ }
calendar.append(items[i]+"\n");
}
calendar.append("END:VCALENDAR");