startDate.setTimeZone(timeZone);
endDate.setTimeZone(timeZone);
DateTime start = new DateTime(startDate.getTime());
DateTime end = new DateTime(endDate.getTime());
VEvent meeting = new VEvent(start, end, name);
log.debug("DateTime start addNewMeeting "+start);
log.debug("DateTime end addNewMeeting "+end);
// add timezone info..
VTimeZone tz = timeZone.getVTimeZone();
meeting.getProperties().add(tz.getTimeZoneId());
meeting.getProperties().add(new Description(description));
meeting.getProperties().add(new Sequence(1));
// generate unique identifier (if not submitted)
Uid ui = null;
if(uid == null || uid.length() < 1){
ui = new UidGenerator("uidGen").generateUid();
log.debug("Generating Meeting UID : " + ui.getValue());
}
else{
ui = new Uid(uid);
log.debug("Using Meeting UID : " + ui.getValue());
}
meeting.getProperties().add(ui);
for(int i = 0; i <attendees.size(); i++){
HashMap<String, String> oneAtt = attendees.get(i);
Attendee uno = new Attendee(URI.create(oneAtt.get("uri")));
String chair = oneAtt.get("chair");
if(chair.equals("0"))
uno.getParameters().add(Role.REQ_PARTICIPANT);
else
uno.getParameters().add(Role.CHAIR);
uno.getParameters().add(new Cn(oneAtt.get("cn")));
meeting.getProperties().add(uno);
}
Organizer orger = new Organizer(URI.create(organizer.get("uri")));
orger.getParameters().add(new Cn(organizer.get("cn")));
meeting.getProperties().add(orger);
icsCalendar.getComponents().add(meeting);
return ui.getValue();