Hi
I'm trying to add a location to an existing CalendarEventEntry with
the Java Client APIs. When I look at the event after the update
everything but the location has been successfully updated. Is there a
trick I'm overlooking? Here is the routine. The user adds an event
with just the phone number in the title field and this routine fills
in the rest of the fields for the calendar event.
private void setNewAppointment(CalendarEventEntry
calendarEventEntry, Employee employee) {
String title =
calendarEventEntry.getTitle().getPlainText().trim();
logger.info(title);
ServiceOrder serviceOrder =
serviceOrderDAO.getServiceOrder(title);
if (Utilities.isBlank(serviceOrder.getDirectoryName())) {
logger.warning("Service order not found for phone number: " +
title);
return;
}
else {
logger.info("Setting appointment for : " +
serviceOrder.toString());
}
calendarEventEntry.setTitle(new
PlainTextConstruct(serviceOrder.getDirectoryName()));
calendarEventEntry.setContent(new
PlainTextConstruct(getDescription(serviceOrder, employee,
calendarEventEntry)));
logger.info("Schedule for: " + employee.getEmailAddress());
if (!Utilities.isBlank(employee.getEmailAddress())) {
Where where = new Where(Where.Rel.EVENT, "Service Address",
serviceOrder.getServiceAddress());
calendarEventEntry.addLocation(where);
calendarEventEntry.addHtmlLink(getUrlString(serviceOrder), null,
null);
ExtendedProperty extendedProperty = new ExtendedProperty();
extendedProperty.setName("orderKey");
extendedProperty.setValue(serviceOrder.getPhoneNumber() +
serviceOrder.getOrderNumber());
calendarEventEntry.addExtendedProperty(extendedProperty);
EventEntry updatedEntry = null;
try {
updatedEntry = calendarEventEntry.update();
logger.info("Updated entry title: " +
updatedEntry.getTitle());
updateServiceOrder(serviceOrder, calendarEventEntry,
employee);
}
catch (Exception e) {
logger.warning(e.getMessage());
e.printStackTrace();
Email.sendStackTrace(e);
return;
}
logger.info("Published: " + updatedEntry.getPublished() + " " +
serviceOrder.toString());
}
}
Thanx, PLA
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---