18 package org.turro.contacts.cal;
21 import java.util.Date;
22 import java.util.List;
23 import org.turro.elephant.context.ElephantContext;
24 import org.turro.elephant.impl.abstracts.AbstractImplementation;
25 import org.turro.i18n.I_;
26 import org.turro.plugin.calendar.ICalendarEvent;
27 import org.turro.plugin.calendar.ICalendarModel;
28 import org.turro.plugin.contacts.IContact;
29 import org.turro.reflection.Serializer;
30 import org.turro.util.IdGenerator;
31 import org.zkoss.lang.Strings;
39 private final static String PATH_CALENDAR =
"/WEB-INF/calendars";
66 if(!root.exists()) root.mkdir();
67 File cal =
new File(root.getAbsolutePath() +
"/" + contact.
getId());
68 return (List<ICalendarEvent>) Serializer.deserialize(cal);
72 public List<ICalendarEvent>
getEvents(Date from, Date to) {
78 public void setEvents(List<ICalendarEvent> events) {
80 if(!root.exists()) root.mkdir();
81 File cal =
new File(root.getAbsolutePath() +
"/" + contact.
getId());
82 Serializer.serialize(cal, events);
88 event.setEventId(IdGenerator.generate());
96 event.setEventId(IdGenerator.generate());
102 this.contact = contact;
static String getRealPath(String path)
static String get(String msg)