19 package org.turro.plugin.command;
21 import java.text.DateFormat;
22 import java.text.SimpleDateFormat;
23 import java.util.Date;
24 import java.util.TimeZone;
25 import org.turro.string.Strings;
26 import org.turro.elephant.context.Application;
27 import org.turro.elephant.context.ElephantContext;
28 import org.turro.html.HTMLGenerator;
29 import org.turro.util.CompareUtil;
35 public class TimelineEvent
implements Comparable<TimelineEvent> {
37 private Date start, end;
38 private boolean duration;
39 private String title, image, inside, link;
46 this.duration = duration;
98 DateFormat df =
new SimpleDateFormat(
"yyyy/MM/dd HH:mm:ss");
99 df.setTimeZone(TimeZone.getTimeZone(
"GMT"));
102 (start !=
null ?
"start=\"" + df.format(start) +
"\"" :
null),
103 (end !=
null ?
"end=\"" + df.format(end) +
"\"" :
null),
104 (duration ?
"isDuration=\"true\"" :
null),
105 (!Strings.isBlank(title) ?
"title=\"" + Strings.escapeXML(title) +
"\"" :
null),
107 (!Strings.isBlank(link) ?
"link=\"" + Strings.escapeXML(link) +
"\"" :
null)
110 if(!Strings.isBlank(inside)) {
121 int result = CompareUtil.compare(start, o.start);
123 result = CompareUtil.compare(end, o.end);
126 result = CompareUtil.compare(title, o.title);
static String getRootWebPath()
HTMLGenerator endAllTags()
HTMLGenerator write(String value)
HTMLGenerator startTag(String tag)
void setLink(String link)
String getEvent(Application app)
void setStart(Date start)
int compareTo(TimelineEvent o)
void setInside(String inside)
void setTitle(String title)
void setImage(String image)
void setDuration(boolean duration)