BrightSide Workbench Full Report + Source Code
org.turro.activity.LastActivities Class Reference

Static Public Member Functions

static void generateUserContent (Date date)
 
static EntityActivitySet getLastActivity (IContact contact)
 
static ContactActivityMap getLastActivitySession (Date from, String entityPath, String type)
 
static Object getMainEntity (Object entity)
 

Static Public Attributes

static final int LAST_ACTIVITY_WEEKS = -4
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 37 of file LastActivities.java.

Member Function Documentation

◆ generateUserContent()

static void org.turro.activity.LastActivities.generateUserContent ( Date  date)
static

Definition at line 41 of file LastActivities.java.

41  {
42  Date from = new CheckDate().addWeeks(LastActivities.LAST_ACTIVITY_WEEKS).getDate();
43  Date now = new Date();
44  if(!existsActivitySession(now, from, null)) {
45  tryInstance(now, from);
46  }
47  }

◆ getLastActivity()

static EntityActivitySet org.turro.activity.LastActivities.getLastActivity ( IContact  contact)
static

Definition at line 51 of file LastActivities.java.

51  {
52  if(INIT.isBussy()) return new EntityActivitySet();
53  Date from = new CheckDate().addWeeks(LastActivities.LAST_ACTIVITY_WEEKS).getDate();
54  Date now = new Date();
55  return deserializeLastActivitySession(now, from, contact);
56  }
Here is the caller graph for this function:

◆ getLastActivitySession()

static ContactActivityMap org.turro.activity.LastActivities.getLastActivitySession ( Date  from,
String  entityPath,
String  type 
)
static

Definition at line 60 of file LastActivities.java.

60  {
61  cleanOldSessions();
62  if(Strings.isBlank(entityPath) && Strings.isBlank(type)) {
63  Date now = new Date();
64  String fileName = "/activity/" + ObjectString.formatObject(now, ObjectString.URL_DATE_PATTERN, true) +
65  "-" + ObjectString.formatObject(from, ObjectString.URL_DATE_PATTERN, true) + ".ser";
66  File ser = Serializer.getFile(fileName);
67  if(ser.exists()) {
68  return (ContactActivityMap) Serializer.deserialize(ser);
69  } else {
70  ContactActivityMap current = getContactLastActivites(from, entityPath, type);
71  Serializer.serialize(ser, current);
72  return current;
73  }
74  } else {
75  return getContactLastActivites(from, entityPath, type);
76  }
77  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMainEntity()

static Object org.turro.activity.LastActivities.getMainEntity ( Object  entity)
static

Definition at line 81 of file LastActivities.java.

81  {
82  for(ILastActivity iLast : Instances.cached().byAnnotation(LastActivity.class, ILastActivity.class)) {
83  Object main = iLast.getMainEntity(entity);
84  if(main != null) {
85  return main;
86  }
87  }
88  return null;
89  }
Here is the caller graph for this function:

Member Data Documentation

◆ LAST_ACTIVITY_WEEKS

final int org.turro.activity.LastActivities.LAST_ACTIVITY_WEEKS = -4
static

Definition at line 131 of file LastActivities.java.


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