private static EventAttendee transformToEventAttendee(CalendarAttendeeModel attendee) { return new EventAttendee() .setDisplayName(attendee.getDisplayName()) .setEmail(attendee.getEmail()) .setOptional(attendee.getOptional()); }
private static CalendarAttendeeModel transformToModelAttendee(EventAttendee attendee) { return new CalendarAttendeeModel( attendee.getDisplayName(), attendee.getEmail(), Boolean.TRUE.equals(attendee.getOptional())); }
private static void fillEvent(Absence absence, Event event) { event.setSummary(absence.getEventSubject()); EventAttendee eventAttendee = new EventAttendee(); eventAttendee.setEmail(absence.getPerson().getEmail()); eventAttendee.setDisplayName(absence.getPerson().getNiceName()); event.setAttendees(Collections.singletonList(eventAttendee)); EventDateTime startEventDateTime; EventDateTime endEventDateTime; if (absence.isAllDay()) { // To create an all-day event, you must use setDate() having created DateTime objects using a String DateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN_YYYY_MM_DD); String startDateStr = dateFormat.format(absence.getStartDate()); String endDateStr = dateFormat.format(absence.getEndDate()); DateTime startDateTime = new DateTime(startDateStr); DateTime endDateTime = new DateTime(endDateStr); startEventDateTime = new EventDateTime().setDate(startDateTime); endEventDateTime = new EventDateTime().setDate(endDateTime); } else { DateTime dateTimeStart = new DateTime(absence.getStartDate()); DateTime dateTimeEnd = new DateTime(absence.getEndDate()); startEventDateTime = new EventDateTime().setDateTime(dateTimeStart); endEventDateTime = new EventDateTime().setDateTime(dateTimeEnd); } event.setStart(startEventDateTime); event.setEnd(endEventDateTime); }
public static List<EventAttendee> getAttendeesList(String attendeesString) throws AddressException { List<EventAttendee> attendeesList = new ArrayList<EventAttendee>(); if (ObjectHelper.isNotEmpty(attendeesString)) { List<String> list = Splitter.on(',').trimResults().splitToList(attendeesString); for (String string : list) { EventAttendee attendee = new EventAttendee(); attendee.setEmail(string); attendeesList.add(attendee); } } return attendeesList; }
public static String getAttendeesString(List<EventAttendee> attendees) throws AddressException { String attendeesString; List<String> attendeesList = new ArrayList<>(); for (EventAttendee eventAttendee : attendees) { attendeesList.add(eventAttendee.getEmail()); } attendeesString = StringUtils.join(attendeesList, ','); return attendeesString; } }
for (final PersonDto attendee : appointmentDto.getAttendees()) { if (emailValidator.isValid(attendee.getEmail())) { final EventAttendee eventAttendee = new EventAttendee(); eventAttendee.setDisplayName(attendee.getName()); eventAttendee.setEmail(obfuscateEmail(attendee.getEmail())); eventAttendee.setOptional(attendee.isOptional()); attendees.add(eventAttendee);
for (final EventAttendee eventAttendee : event.getAttendees()) { final PersonDto person = new PersonDto(); person.setName(eventAttendee.getDisplayName()); person.setEmail(eventAttendee.getEmail()); if (eventAttendee.getOptional() != null) { person.setOptional(eventAttendee.getOptional());