return new Function<ObjectAdapter, Event>() {
public Event apply(final ObjectAdapter input) {
final Object domainObject = input.getObject();
final CalendarEvent calendarEvent = calendarEventFor(domainObject, calendarName);
if(calendarEvent == null) {
return null;
}
final Event event = new Event();
final DateTime start = calendarEvent.getDateTime();
final DateTime end = start;
event.setStart(start);
event.setEnd(end);
event.setAllDay(true);
final String oidStr = input.getOid().enString(IsisContext.getOidMarshaller());
event.setId(oidStr + "-" + calendarName);
event.setClassName("fullCalendar2-event-" + calendarName);
event.setEditable(false);
event.setPayload(oidStr);
event.setTitle(calendarEvent.getTitle());
//event.setBackgroundColor(backgroundColor)
//event.setBorderColor(borderColor)
//event.setColor(color)
//event.setTextColor(textColor)