BrightSide Workbench Full Report + Source Code
org.turro.contacts.command.ConvocationCalendar Class Reference
Inheritance diagram for org.turro.contacts.command.ConvocationCalendar:
Collaboration diagram for org.turro.contacts.command.ConvocationCalendar:

Protected Member Functions

void executePlugin ()
 
- Protected Member Functions inherited from org.turro.plugin.command.CalendarPlugin
void addToResult (Object data)
 
abstract void executePlugin (Context context) throws Exception
 

Additional Inherited Members

- Public Member Functions inherited from org.turro.plugin.command.CalendarPlugin
String getName ()
 
boolean stopPropagating ()
 
IContact getContact ()
 
Date getFrom ()
 
Date getTo ()
 
void execute ()
 
String getName ()
 
boolean stopsPropagating ()
 
void setParams (Object params)
 
IContact getContact ()
 
Date getFrom ()
 
Date getTo ()
 
Object execute (Context context)
 
- Public Member Functions inherited from org.turro.action.DefaultPlugin
void setContext (Map< String, Object > params, Map< String, Object > results)
 
Object getParam (String key)
 
boolean itsMe (String name)
 
Object addResult (String key, Object value)
 
- Static Public Member Functions inherited from org.turro.plugin.command.CalendarPlugin
static Collection< Object > getCalendarFor (IContact contact, Date from, Date to)
 
static Collection< ICalendarEventgetCalendarFor (Application app, IContact contact, Date from, Date to)
 
- Protected Attributes inherited from org.turro.plugin.command.CalendarPlugin
Map< String, Object > params
 
Collection< ICalendarEventresult
 
- Protected Attributes inherited from org.turro.action.DefaultPlugin
Map< String, Object > params
 
Map< String, Object > results
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 43 of file ConvocationCalendar.java.

Member Function Documentation

◆ executePlugin()

void org.turro.contacts.command.ConvocationCalendar.executePlugin ( )
protected

Reimplemented from org.turro.plugin.command.CalendarPlugin.

Definition at line 46 of file ConvocationCalendar.java.

46  {
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 " +
56  "or exists ( " +
57  " select a from Attendee a " +
58  " where a.convocation = c " +
59  " and a.contact = ? " +
60  "))",
61  new Object[] {
62  newFrom, newTo,
65  });
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);
85  }
86  calendarEvent.setContent(pb.toString());
87  calendarEvent.setEventId(Strings.identifier("conv" + c.getId()));
88  addResult(calendarEvent.getEventId(), calendarEvent);
89  }
90  }
Object addResult(String key, Object value)
Here is the call graph for this function:

The documentation for this class was generated from the following file: