19 package org.turro.plugin.command;
22 import java.io.IOException;
23 import java.util.Date;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.amic.util.file.FileUtil;
27 import org.turro.auth.Authentication;
28 import org.turro.elephant.context.ElephantContext;
29 import org.turro.plugin.contacts.IContact;
30 import org.turro.util.IdGenerator;
31 import org.zkforge.timeline.Bandinfo;
32 import org.zkforge.timeline.Timeline;
33 import org.zkoss.zk.ui.ext.AfterCompose;
45 fname =
"/_internal/tmp/tl-" + contact.
getId() +
"-" + contact.
getId() +
".xml";
47 FileUtil.checkDirs(fxml);
48 Date now =
new Date();
50 FileUtil.setContent(fxml, xml,
null);
51 Bandinfo bm1 =
new Bandinfo();
52 bm1.setId(IdGenerator.generate());
54 bm1.setIntervalUnit(
"month");
56 bm1.setIntervalPixels(100);
57 bm1.setEventSourceUrl(fname);
59 Bandinfo bm2 =
new Bandinfo();
61 bm2.setIntervalUnit(
"year");
63 bm2.setIntervalPixels(200);
64 bm2.setEventSourceUrl(fname);
65 bm2.setOverview(
true);
67 bm2.setSyncWith(bm1.getId());
68 if(bm1 instanceof AfterCompose) {
69 ((AfterCompose) bm1).afterCompose();
71 if(bm2 instanceof AfterCompose) {
72 ((AfterCompose) bm2).afterCompose();
74 }
catch (IOException ex) {
static IContact getIContact()
static String getRealPath(String path)
static String logMsg(String msg)
static String getTimelineFor(IContact contact)