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

Public Member Functions

EntityActivitySet getActivities (Date from, String entityPath, String type)
 
Object getMainEntity (Object entity)
 
List getDossiers (Date from, String select)
 
List getProjects (Date from, String select, String field)
 
List getParticipants (Date from, String select)
 
List getIssues (Date from, String select)
 
List getIssueComments (Date from, String select)
 

Detailed Description

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

Definition at line 40 of file DossierLastActivity.java.

Member Function Documentation

◆ getActivities()

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

Implements org.turro.activity.ILastActivity.

Definition at line 43 of file DossierLastActivity.java.

43  {
44  EntityActivitySet set = new EntityActivitySet();
45  Path path = Strings.isBlank(entityPath) ? null : new Path(entityPath);
46  if(path == null || "dossier".equals(path.getRoot())) {
47  for(Object obj : getProjects(from, null, "startDate")) {
48  Project project = (Project) obj;
49  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
50  project.getDossier(), DossierPU.getObjectPath(project.getDossier()), project.getStartDate(), "Started");
51  ela.setSortPath(Entities.getController(project.getDossier()).getHierarchicalPath());
52  set.add(ela);
53  }
54  for(Object obj : getProjects(from, null, "approvedDate")) {
55  Project project = (Project) obj;
56  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
57  project.getDossier(), DossierPU.getObjectPath(project.getDossier()), project.getApprovedDate(), "lApproved");
58  ela.setSortPath(Entities.getController(project.getDossier()).getHierarchicalPath());
59  set.add(ela);
60  }
61  for(Object obj : getProjects(from, null, "oppositingEndDate")) {
62  Project project = (Project) obj;
63  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
64  project.getDossier(), DossierPU.getObjectPath(project.getDossier()), project.getOppositingEndDate(), "lEndOppositing");
65  ela.setSortPath(Entities.getController(project.getDossier()).getHierarchicalPath());
66  set.add(ela);
67  }
68  for(Object obj : getProjects(from, null, "endDate")) {
69  Project project = (Project) obj;
70  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
71  project.getDossier(), DossierPU.getObjectPath(project.getDossier()), project.getEndDate(), "Ended");
72  ela.setSortPath(Entities.getController(project.getDossier()).getHierarchicalPath());
73  set.add(ela);
74  }
75  for(Object obj : getProjects(from, null, "changePhase")) {
76  Project project = (Project) obj;
77  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
78  project.getDossier(), DossierPU.getObjectPath(project.getDossier()), project.getChangePhase(), "Changed phase");
79  ela.setSortPath(Entities.getController(project.getDossier()).getHierarchicalPath());
80  set.add(ela);
81  }
82  for(Object obj : getDossiers(from, null)) {
83  Dossier dossier = (Dossier) obj;
84  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
85  dossier, DossierPU.getObjectPath(dossier), dossier.getCreation(), "Created");
86  ela.setSortPath(Entities.getController(dossier).getHierarchicalPath());
87  set.add(ela);
88  }
89  for(Object obj : getParticipants(from, null)) {
90  Participant participant = (Participant) obj;
91  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
92  participant, DossierPU.getObjectPath(participant.getDossier()), participant.getCreation(), "New Participant");
93  ela.setSortPath(Entities.getController(participant.getDossier()).getHierarchicalPath());
94  set.add(ela);
95  }
96  }
97  if(path == null || "issue".equals(path.getRoot())) {
98 // for(Object obj : getIssues(from, null)) {
99 // Issue issue = (Issue) obj;
100 // DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
101 // issue, DossierPU.getObjectPath(issue), issue.getModification(), "Modified");
102 // set.add(ela);
103 // }
104  for(Object obj : getIssueComments(from, null)) {
105  IssueComment comment = (IssueComment) obj;
106  DefaultEntityLastActivity ela = new DefaultEntityLastActivity(
107  comment, DossierPU.getObjectPath(comment.getIssue()), comment.getModification(), "Informed");
108  ela.setSortPath(Entities.getController(comment.getIssue()).getHierarchicalPath());
109  set.add(ela);
110  }
111  }
112  return set;
113  }
List getDossiers(Date from, String select)
List getIssueComments(Date from, String select)
List getParticipants(Date from, String select)
List getProjects(Date from, String select, String field)
Here is the call graph for this function:

◆ getDossiers()

List org.turro.activity.DossierLastActivity.getDossiers ( Date  from,
String  select 
)

Definition at line 127 of file DossierLastActivity.java.

127  {
128  WhereClause wc = new WhereClause();
129  wc.addClause("select dossier" + check(select) + " from Dossier as dossier");
130  wc.addClause("where dossier.creation >= :date");
131  wc.addNamedValue("date", from);
132  return getDao().getResultList(wc);
133  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIssueComments()

List org.turro.activity.DossierLastActivity.getIssueComments ( Date  from,
String  select 
)

Definition at line 164 of file DossierLastActivity.java.

164  {
165  WhereClause wc = new WhereClause();
166  wc.addClause("select comment" + check(select) + " from IssueComment as comment");
167  wc.addClause("where comment.modification >= :date");
168  wc.addNamedValue("date", from);
169  return getDao().getResultList(wc);
170  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIssues()

List org.turro.activity.DossierLastActivity.getIssues ( Date  from,
String  select 
)

Definition at line 156 of file DossierLastActivity.java.

156  {
157  WhereClause wc = new WhereClause();
158  wc.addClause("select issue" + check(select) + " from Issue as issue");
159  wc.addClause("where issue.modification >= :date");
160  wc.addNamedValue("date", from);
161  return getDao().getResultList(wc);
162  }
Here is the call graph for this function:

◆ getMainEntity()

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

Implements org.turro.activity.ILastActivity.

Definition at line 116 of file DossierLastActivity.java.

116  {
117  if(entity instanceof IssueComment) {
118  return ((IssueComment) entity).getIssue().getDossier();
119  } else if(entity instanceof Project) {
120  return ((Project) entity).getDossier();
121  } else if(entity instanceof Issue) {
122  return ((Issue) entity).getDossier();
123  }
124  return null;
125  }

◆ getParticipants()

List org.turro.activity.DossierLastActivity.getParticipants ( Date  from,
String  select 
)

Definition at line 148 of file DossierLastActivity.java.

148  {
149  WhereClause wc = new WhereClause();
150  wc.addClause("select participant" + check(select) + " from Participant as participant");
151  wc.addClause("where participant.creation >= :date");
152  wc.addNamedValue("date", from);
153  return getDao().getResultList(wc);
154  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProjects()

List org.turro.activity.DossierLastActivity.getProjects ( Date  from,
String  select,
String  field 
)

Definition at line 135 of file DossierLastActivity.java.

135  {
136  WhereClause wc = new WhereClause();
137  wc.addClause("select project" + check(select) + " from Project as project");
138  wc.addClause("where project." + field + " >= :date");
139  wc.addNamedValue("date", from);
140  if("changePhase".equals(field)) {
141  // Dismiss IDEA since they show as Created
142  wc.addClause("and dossier.project.phase != :phase");
143  wc.addNamedValue("phase", 0);
144  }
145  return getDao().getResultList(wc);
146  }
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: