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

Public Member Functions

void generate ()
 

Detailed Description

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

Definition at line 38 of file CommonsActivity.java.

Member Function Documentation

◆ generate()

void org.turro.activity.CommonsActivity.generate ( )

Implements org.turro.activity.IElephantActivity.

Definition at line 41 of file CommonsActivity.java.

41  {
42  Activities topacts = Activities.of("New topic");
43  SqlClause.select("topic").from("Topic topic")
44  .where().greater("topic.creation", topacts.lastDate())
45  .dao(dao.get()).forEach(Topic.class, topic -> {
46  if(!topic.getEntity().isEmpty()) {
47  IElephantEntity itopic = Entities.getController(topic);
48  if(!itopic.isEmpty()) {
49  topacts.add(topic.getCreation(), itopic.getPath(), topic.getEntityPath(), itopic.getHierarchicalPath());
50  }
51  }
52  });
53  Activities ansacts = Activities.of("New answer");
54  SqlClause.select("post").from("Post post")
55  .where().greater("topic.creation", ansacts.lastDate())
56  .dao(dao.get()).forEach(Post.class, post -> {
57  if(!post.getTopic().getEntity().isEmpty()) {
58  IElephantEntity ipost = Entities.getController(post);
59  if(!ipost.isEmpty()) {
60  ansacts.add(post.getCreation(), ipost.getPath(), post.getTopic().getEntityPath(), ipost.getHierarchicalPath());
61  }
62  }
63  });
64  Activities pollacts = Activities.of("Related polls");
65  SqlClause.select("poll").from("Poll poll")
66  .where().greater("poll.deadline", pollacts.lastDate())
67  .dao(dao.get()).forEach(Poll.class, poll -> {
68  if(!poll.getEntity().isEmpty()) {
69  IElephantEntity ipoll = Entities.getController(poll);
70  if(!ipoll.isEmpty()) {
71  pollacts.add(poll.getDeadline(), ipoll.getPath(), poll.getEntityPath(), ipoll.getHierarchicalPath());
72  }
73  }
74  });
75  for(ParticipationReason reason : ParticipationReason.values()) {
76  Activities epacts = Activities.of(reason.toString());
77  SqlClause.select("ep").from("EntityParticipation ep")
78  .where().greater("ep.participationDate", epacts.lastDate())
79  .and().equal("ep.reason", reason)
80  .dao(dao.get()).forEach(EntityParticipation.class, ep -> {
81  if(!ep.getEntity().isEmpty()) {
82  String path = ElephantPU.getObjectPath(ep);
83  epacts.add(ep.getParticipationDate(), path, ep.getEntityPath(), ep.getEntity().getHierarchicalPath());
84  }
85  });
86  }
87  }
Here is the call graph for this function:

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