HashMap<String, String> organizer, String uid, java.util.TimeZone normalTimeZone)
throws Exception {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timeZone = registry.getTimeZone(normalTimeZone.getID());
DateTime start = new DateTime(startDate);
start.setTimeZone(timeZone);
DateTime end = new DateTime(endDate);
end.setTimeZone(timeZone);
VEvent meeting = new VEvent(start, end, name);
meeting.getProperties().add(new Description(description));
meeting.getProperties().add(new Sequence(0));
meeting.getProperties().add(new Location(""));
meeting.getProperties().add(Transp.OPAQUE);
// 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(timeZone.getVTimeZone());
icsCalendar.getComponents().add(meeting);
return ui.getValue();
}