System.out.println("processAttendeeLine: " + line);
String attendeeName = line.substring(line.lastIndexOf(":")+1);
System.out.println("process user: " + attendeeName);
TCalDavPrincipal attendee = TResourceFactory.findUser(attendeeName);
if (attendee == null) {
return new SchedulingResponseItem(attendeeName, ITip.StatusResponse.RS_INVALID_37, null);
} else {
String ical = "";
ical += "BEGIN:VCALENDAR\n";
ical += "VERSION:2.0\n";
ical += "PRODID:-//Example Corp.//CalDAV Server//EN\n";
ical += "METHOD:REPLY\n";
ical += "BEGIN:VFREEBUSY\n";
ical += "UID:4FD3AD926350\n";
ical += "DTSTAMP:20090602T200733Z\n";
ical += "DTSTART:20090602T000000Z\n";
ical += "DTEND:20090604T000000Z\n";
ical += "ORGANIZER;CN=\"" + organiser + "\":mailto:" + organiser + "\n"; // TODO: should be organiser user
ical += "ATTENDEE;CN=\"" + attendeeName + "\":mailto:" + attendeeName + "\n";
ical += "FREEBUSY;FBTYPE=BUSY:20090602T110000Z/20090602T120000Z\n";
ical += "FREEBUSY;FBTYPE=BUSY:20090603T170000Z/20090603T180000Z\n";
ical += "END:VFREEBUSY\n";
ical += "END:VCALENDAR\n";
return new SchedulingResponseItem(attendeeName, ITip.StatusResponse.RS_SUCCESS_20, ical);
}
}