19 package org.turro.user.activity;
21 import java.util.Date;
22 import org.turro.elephant.context.IConstructor;
23 import org.turro.entities.Entities;
24 import org.turro.entities.IElephantEntity;
25 import org.turro.marker.ElephantMarker;
26 import org.turro.plugin.contacts.IContact;
27 import org.turro.util.CompareUtil;
33 public class Activity implements Comparable<Activity> {
35 private final Date date;
36 private final String contactId, entityPath;
38 private final Object origin;
44 this.contactId = contactId;
45 this.entityPath = entityPath;
81 String
template = type.toString().replaceAll(
"_",
"-").toLowerCase();
87 template +=
"-" + origin.getClass().getSimpleName().toLowerCase();
90 marker.
put(
"activity",
this);
91 return marker.
parse(
"widgets/activity",
template);
98 int result = CompareUtil.compare(activity.date, date);
100 result = CompareUtil.compare(type.ordinal(), activity.type.ordinal());
103 result = CompareUtil.compare(contactId, activity.contactId);
106 result = CompareUtil.compare(entityPath, activity.entityPath);
static IElephantEntity getController(String path)
static boolean existsTemplate(IConstructor constructor, boolean mail, String root, String name)
String parse(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Activity(Date date, ActivityType type, String contactId, String entityPath, Object origin)
String parseFor(IConstructor constructor, IContact contact)
int compareTo(Activity activity)
IElephantEntity getEntity()
String parse(IConstructor constructor)