}
}
// add event to calendar
if (createEvent) {
EventEntry myEntry = new EventEntry();
myEntry.setTitle(new PlainTextConstruct(title));
String desc = parser.analyse(formatting.getContentValue(), program);
myEntry.setContent(new PlainTextConstruct(desc));
Calendar c = CalendarToolbox.getStartAsCalendar(program);
DateTime startTime = new DateTime(c.getTime(), c.getTimeZone());
c = CalendarToolbox.getEndAsCalendar(program);
DateTime endTime = new DateTime(c.getTime(), c.getTimeZone());
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
if (settings.getExporterProperty(REMINDER, false)) {
int reminderMinutes = 0;
try {
reminderMinutes = settings.getExporterProperty(REMINDER_MINUTES, 0);
} catch (NumberFormatException e) {
e.printStackTrace();
}
if (settings.getExporterProperty(REMINDER_ALERT, false)) {
addReminder(myEntry, reminderMinutes, Reminder.Method.ALERT);
}
if (settings.getExporterProperty(REMINDER_EMAIL, false)) {
addReminder(myEntry, reminderMinutes, Reminder.Method.EMAIL);
}
if (settings.getExporterProperty(REMINDER_SMS, false)) {
addReminder(myEntry, reminderMinutes, Reminder.Method.SMS);
}
}
if (settings.isShowBusy()) {
myEntry.setTransparency(BaseEventEntry.Transparency.OPAQUE);
}
else {
myEntry.setTransparency(BaseEventEntry.Transparency.TRANSPARENT);
}
// Send the request and receive the response:
myService.insert(postUrl, myEntry);
uploadedItems = true;
}