47 Dao dao =
new ContactsPU();
48 Date newFrom =
new CheckDate(
getFrom()).addDays(-7).getDate(),
49 newTo =
new CheckDate(
getTo()).addDays(7).getDate();
50 List<Convocation> list = dao.getResultList(
51 "select c from Convocation c " +
52 "where c.callDate >= ? " +
53 "and c.callDate <= ? " +
54 "and (c.organizer = ? " +
55 "or c.publishable = TRUE " +
57 " select a from Attendee a " +
58 " where a.convocation = c " +
59 " and a.contact = ? " +
66 for(Convocation c : list) {
67 DefaultCalendarEvent calendarEvent =
new DefaultCalendarEvent();
68 calendarEvent.setLocked(
false);
69 calendarEvent.setHeaderColor(CalendarColor.PURPLE.getHeader());
70 calendarEvent.setContentColor(CalendarColor.PURPLE.getContent());
71 calendarEvent.setBeginDate(c.getCallDate());
72 calendarEvent.setEndDate(c.getEndDate());
73 calendarEvent.setPath(ContactsPU.getObjectPath(c));
74 calendarEvent.setOrganizer(Contacts.getContact(c.getOrganizer()));
75 calendarEvent.setTitle(c.getName());
76 PhraseBuilder pb =
new PhraseBuilder();
77 pb.addPendingSeparator(Chars.nl().repeat(2).toString());
78 pb.addWord(c.getPlainText());
79 pb.addPendingSeparator(Chars.nl().repeat(2).toString());
80 for(Attendee attendee : c.getAttendees()) {
81 IContact ic = Contacts.getContact(attendee.getContact());
82 pb.addWord(ic.getName());
83 pb.addPendingSeparator(
", ");
84 calendarEvent.addAttendee(ic);
86 calendarEvent.setContent(pb.toString());
87 calendarEvent.setEventId(Strings.identifier(
"conv" + c.getId()));
88 addResult(calendarEvent.getEventId(), calendarEvent);
Object addResult(String key, Object value)