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

Public Member Functions

EntityActivitySet getActivities (Date from, String entityPath, String type)
 
Object getMainEntity (Object entity)
 
void getPolls (String path, Date from, Consumer< Poll > action)
 

Detailed Description

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

Definition at line 36 of file CommonsLastActivity.java.

Member Function Documentation

◆ getActivities()

EntityActivitySet org.turro.activity.CommonsLastActivity.getActivities ( Date  from,
String  entityPath,
String  type 
)

Implements org.turro.activity.ILastActivity.

Definition at line 39 of file CommonsLastActivity.java.

39  {
40  EntityActivitySet set = new EntityActivitySet();
41  SqlClause.select("poll").from("Poll poll")
42  .where().greater("poll.deadline", from)
43  .and().equal("poll.entityPath", entityPath)
44  .dao(getDao()).forEach(Poll.class, poll -> {
45  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
46  poll, poll.getEntityPath(), poll.getDeadline(), "Related polls");
47  ela.setSortPath(Entities.getController(poll).getHierarchicalPath());
48  set.add(ela);
49  });
50  ParticipationInfo pi = new ParticipationInfo(entityPath, null);
51  pi.getAnyParticipations(from, participation -> {
52  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
53  participation, participation.getEntityPath(), participation.getParticipationDate(), participation.getReason().toString());
54  ela.setSortPath(Entities.getController(participation).getHierarchicalPath());
55  set.add(ela);
56  });
57  return set;
58  }
Here is the call graph for this function:

◆ getMainEntity()

Object org.turro.activity.CommonsLastActivity.getMainEntity ( Object  entity)

Implements org.turro.activity.ILastActivity.

Definition at line 61 of file CommonsLastActivity.java.

61  {
62  return null;
63  }

◆ getPolls()

void org.turro.activity.CommonsLastActivity.getPolls ( String  path,
Date  from,
Consumer< Poll action 
)

Definition at line 65 of file CommonsLastActivity.java.

65  {
66  WhereClause wc = new WhereClause();
67  wc.addClause("select poll from Poll as poll");
68  wc.addClause("where poll.deadline >= :date");
69  wc.addNamedValue("date", from);
70  wc.addClause("and poll.entityPath = :path");
71  wc.addNamedValue("path", path);
72  getDao().forEach(Poll.class, wc, action);
73  }
Here is the call graph for this function:

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