BrightSide Workbench Full Report + Source Code
org.turro.user.activity.Activity Class Reference
Inheritance diagram for org.turro.user.activity.Activity:
Collaboration diagram for org.turro.user.activity.Activity:

Public Member Functions

 Activity (Date date, ActivityType type, String contactId, String entityPath, Object origin)
 
Date getDate ()
 
String getContactId ()
 
String getEntityPath ()
 
IElephantEntity getEntity ()
 
ActivityType getType ()
 
Object getOrigin ()
 
String parse (IConstructor constructor)
 
String parseFor (IConstructor constructor, IContact contact)
 
int compareTo (Activity activity)
 

Detailed Description

Constructor & Destructor Documentation

◆ Activity()

org.turro.user.activity.Activity.Activity ( Date  date,
ActivityType  type,
String  contactId,
String  entityPath,
Object  origin 
)

Definition at line 41 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

41  {
42  this.date = date;
43  this.type = type;
44  this.contactId = contactId;
45  this.entityPath = entityPath;
46  this.origin = origin;
47  }

Member Function Documentation

◆ compareTo()

int org.turro.user.activity.Activity.compareTo ( Activity  activity)

Definition at line 97 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

97  {
98  int result = CompareUtil.compare(activity.date, date);
99  if(result == 0) {
100  result = CompareUtil.compare(type.ordinal(), activity.type.ordinal());
101  }
102  if(result == 0) {
103  result = CompareUtil.compare(contactId, activity.contactId);
104  }
105  if(result == 0) {
106  result = CompareUtil.compare(entityPath, activity.entityPath);
107  }
108  return result;
109  }

◆ getContactId()

String org.turro.user.activity.Activity.getContactId ( )

Definition at line 53 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

53  {
54  return contactId;
55  }

◆ getDate()

Date org.turro.user.activity.Activity.getDate ( )

Definition at line 49 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

49  {
50  return date;
51  }

◆ getEntity()

IElephantEntity org.turro.user.activity.Activity.getEntity ( )

Definition at line 61 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

61  {
62  if(entity == null) {
63  entity = Entities.getController(entityPath);
64  }
65  return entity;
66  }
IElephantEntity getController(String entityPath)
Here is the call graph for this function:

◆ getEntityPath()

String org.turro.user.activity.Activity.getEntityPath ( )

Definition at line 57 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

57  {
58  return entityPath;
59  }

◆ getOrigin()

Object org.turro.user.activity.Activity.getOrigin ( )

Definition at line 72 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

72  {
73  return origin;
74  }

◆ getType()

ActivityType org.turro.user.activity.Activity.getType ( )

Definition at line 68 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

68  {
69  return type;
70  }

◆ parse()

String org.turro.user.activity.Activity.parse ( IConstructor  constructor)

Definition at line 76 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

76  {
77  return parseFor(constructor, null);
78  }
String parseFor(IConstructor constructor, IContact contact)
Here is the call graph for this function:

◆ parseFor()

String org.turro.user.activity.Activity.parseFor ( IConstructor  constructor,
IContact  contact 
)

Definition at line 80 of file elephant/src/main/java/org/turro/user/activity/Activity.java.

80  {
81  String template = type.toString().replaceAll("_", "-").toLowerCase();
82  if(contact != null) {
83  if(ActivityType.ACTIVITY_FOLLOW.equals(type) && entityPath.equals("/contact/" + contact.getId())) {
84  template += "ed"; // followed
85  }
86  }
87  template += "-" + origin.getClass().getSimpleName().toLowerCase();
88  if(ElephantMarker.existsTemplate(constructor, false, "widgets/activity", template)) {
89  ElephantMarker marker = new ElephantMarker(constructor);
90  marker.put("activity", this);
91  return marker.parse("widgets/activity", template);
92  }
93  return "";
94  }
Here is the call graph for this function:
Here is the caller graph for this function:

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