19 package org.turro.contacts.command;
21 import java.util.Date;
22 import java.util.List;
23 import org.amic.util.date.CheckDate;
24 import org.turro.string.Strings;
25 import org.turro.action.Contacts;
26 import org.turro.annotation.ElephantPlugin;
27 import org.turro.contacts.Attendee;
28 import org.turro.contacts.Convocation;
29 import org.turro.contacts.db.ContactsPU;
30 import org.turro.jpa.Dao;
31 import org.turro.plugin.calendar.CalendarColor;
32 import org.turro.plugin.calendar.DefaultCalendarEvent;
33 import org.turro.plugin.command.CalendarPlugin;
34 import org.turro.plugin.contacts.IContact;
35 import org.turro.util.Chars;
36 import org.turro.util.PhraseBuilder;
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 = ? " +
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()) {
83 pb.addPendingSeparator(
", ");
87 calendarEvent.
setEventId(Strings.identifier(
"conv" + c.getId()));
Object addResult(String key, Object value)
void setBeginDate(Date beginDate)
void setContentColor(String ccolor)
void setEventId(String eventId)
void setHeaderColor(String hcolor)
void setTitle(String title)
void setEndDate(Date endDate)
void setContent(String content)
void setOrganizer(IContact contact)
void addAttendee(IContact contact)
void setLocked(boolean locked)
void setPath(String path)