BrightSide Workbench Full Report + Source Code
org.turro.dossier.dw.DatawarehouseVM Class Reference
Collaboration diagram for org.turro.dossier.dw.DatawarehouseVM:

Public Member Functions

Date getStart ()
 
void setStart (Date start)
 
Date getEnd ()
 
void setEnd (Date end)
 
Category getCategory ()
 
void setCategory (Category category)
 
Dossier getDossier ()
 
void setDossier (Dossier dossier)
 
IContact getContact ()
 
void setContact (IContact contact)
 
void init ()
 
void update ()
 
void selectEntity (@BindingParam("entity") Object entity)
 
void selectContact (@BindingParam("contact") IContact contact)
 
void selectReport (@BindingParam("type") DWReportType type)
 
List< DWChartgetModel ()
 
DWChart getIssuesByParticipant (IssueParticipantRole role)
 
DWChart getByStatus (IssueParticipantRole role)
 
DWChart getByType (IssueParticipantRole role)
 
DWChart getByResolution (IssueParticipantRole role)
 
DWChart getTimelineByResolution (IssueParticipantRole role)
 
DWChart getTimelineByStatus (IssueParticipantRole role)
 
DWChart getTimelineByType (IssueParticipantRole role)
 
DWChartEngine getEngine ()
 

Detailed Description

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

Definition at line 49 of file DatawarehouseVM.java.

Member Function Documentation

◆ getByResolution()

DWChart org.turro.dossier.dw.DatawarehouseVM.getByResolution ( IssueParticipantRole  role)

Definition at line 231 of file DatawarehouseVM.java.

231  {
232  SimplePieModel cm = new SimplePieModel();
233  WhereClause wc = new WhereClause();
234  wc.addClause("select resolution, count(distinct issueId)");
235  wc.addClause("from DWIssue");
236  wc.addClause("where 1=1");
237  addFilter(wc, "startDate", role);
238  wc.addClause("group by resolution");
239  List<Object[]> results = getDao().getResultList(wc);
240  for(Object o[] : results) {
241  IssueResolution resolution = (IssueResolution) o[0];
242  cm.setValue(resolution.toString(), (Number) o[1]);
243  }
244  DWChart chart = new DWChart();
245  chart.setTitle("Resolutions");
246  chart.setModel(cm);
247  chart.setType("pie");
248  chart.setHeight("300");
249  chart.setWidth("500");
250  return chart;
251  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getByStatus()

DWChart org.turro.dossier.dw.DatawarehouseVM.getByStatus ( IssueParticipantRole  role)

Definition at line 187 of file DatawarehouseVM.java.

187  {
188  SimplePieModel cm = new SimplePieModel();
189  WhereClause wc = new WhereClause();
190  wc.addClause("select status, count(distinct issueId)");
191  wc.addClause("from DWIssue");
192  wc.addClause("where 1=1");
193  addFilter(wc, "startDate", role);
194  wc.addClause("group by status");
195  List<Object[]> results = getDao().getResultList(wc);
196  for(Object o[] : results) {
197  IssueStatus status = (IssueStatus) o[0];
198  cm.setValue(status.toString(), (Number) o[1]);
199  }
200  DWChart chart = new DWChart();
201  chart.setTitle("Status");
202  chart.setModel(cm);
203  chart.setType("pie");
204  chart.setHeight("300");
205  chart.setWidth("500");
206  return chart;
207  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getByType()

DWChart org.turro.dossier.dw.DatawarehouseVM.getByType ( IssueParticipantRole  role)

Definition at line 209 of file DatawarehouseVM.java.

209  {
210  SimplePieModel cm = new SimplePieModel();
211  WhereClause wc = new WhereClause();
212  wc.addClause("select type, count(distinct issueId)");
213  wc.addClause("from DWIssue");
214  wc.addClause("where 1=1");
215  addFilter(wc, "startDate", role);
216  wc.addClause("group by type");
217  List<Object[]> results = getDao().getResultList(wc);
218  for(Object o[] : results) {
219  IssueType type = (IssueType) o[0];
220  cm.setValue(type.toString(), (Number) o[1]);
221  }
222  DWChart chart = new DWChart();
223  chart.setTitle("Type");
224  chart.setModel(cm);
225  chart.setType("pie");
226  chart.setHeight("300");
227  chart.setWidth("500");
228  return chart;
229  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCategory()

Category org.turro.dossier.dw.DatawarehouseVM.getCategory ( )

Definition at line 75 of file DatawarehouseVM.java.

75  {
76  return category;
77  }

◆ getContact()

IContact org.turro.dossier.dw.DatawarehouseVM.getContact ( )

Definition at line 91 of file DatawarehouseVM.java.

91  {
92  return contact;
93  }

◆ getDossier()

Dossier org.turro.dossier.dw.DatawarehouseVM.getDossier ( )

Definition at line 83 of file DatawarehouseVM.java.

83  {
84  return dossier;
85  }

◆ getEnd()

Date org.turro.dossier.dw.DatawarehouseVM.getEnd ( )

Definition at line 67 of file DatawarehouseVM.java.

67  {
68  return end;
69  }

◆ getEngine()

DWChartEngine org.turro.dossier.dw.DatawarehouseVM.getEngine ( )

Definition at line 325 of file DatawarehouseVM.java.

325  {
326  return engine;
327  }

◆ getIssuesByParticipant()

DWChart org.turro.dossier.dw.DatawarehouseVM.getIssuesByParticipant ( IssueParticipantRole  role)

Definition at line 157 of file DatawarehouseVM.java.

157  {
158  SimpleCategoryModel cm = new SimpleCategoryModel();
159  WhereClause wc = new WhereClause();
160  wc.addClause("select participantId, resolution, count(distinct issueId)");
161  wc.addClause("from DWIssue");
162  wc.addClause("where participantRole = :role");
163  wc.addNamedValue("role", role);
164  IContact temp = contact;
165  contact = null;
166  addFilter(wc, "startDate", null);
167  contact = temp;
168  wc.addClause("group by participantId, resolution");
169  List<Object[]> results = getDao().getResultList(wc);
170  for(Object o[] : results) {
171  IContact participant = Contacts.getContactById((String) o[0]);
172  if(participant.isValid()) {
173  IssueResolution resolution = (IssueResolution) o[1];
174  cm.setValue(resolution.toString(), participant.getName(), (Number) o[2]);
175  }
176  }
177  DWChart chart = new DWChart();
178  chart.setTitle(role.toString());
179  chart.setModel(cm);
180  chart.setType("bar");
181  chart.setOrient("horizontal");
182  chart.setWidth("900");
183  chart.setHeight((results.size() * 90 + 40) + "");
184  return chart;
185  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getModel()

List<DWChart> org.turro.dossier.dw.DatawarehouseVM.getModel ( )

Definition at line 139 of file DatawarehouseVM.java.

139  {
140  charts.clear();
141  if(report.equals(DWReportType.DW_TIMELINE)) {
142  charts.add(getTimelineByStatus(null));
143  charts.add(getTimelineByType(null));
144  charts.add(getTimelineByResolution(null));
145  } else if(report.equals(DWReportType.DW_PARTICIPANTS)) {
146  charts.add(getIssuesByParticipant(IssueParticipantRole.ISSUE_RESPONSIBLE));
147  charts.add(getIssuesByParticipant(IssueParticipantRole.ISSUE_REPORTER));
148  charts.add(getIssuesByParticipant(IssueParticipantRole.ISSUE_QA));
149  } else if(report.equals(DWReportType.DW_ISSUES)) {
150  charts.add(getByStatus(null));
151  charts.add(getByType(null));
152  charts.add(getByResolution(null));
153  }
154  return charts;
155  }
DWChart getByType(IssueParticipantRole role)
DWChart getTimelineByStatus(IssueParticipantRole role)
DWChart getByStatus(IssueParticipantRole role)
DWChart getTimelineByResolution(IssueParticipantRole role)
DWChart getIssuesByParticipant(IssueParticipantRole role)
DWChart getTimelineByType(IssueParticipantRole role)
DWChart getByResolution(IssueParticipantRole role)
Here is the call graph for this function:

◆ getStart()

Date org.turro.dossier.dw.DatawarehouseVM.getStart ( )

Definition at line 59 of file DatawarehouseVM.java.

59  {
60  return start;
61  }

◆ getTimelineByResolution()

DWChart org.turro.dossier.dw.DatawarehouseVM.getTimelineByResolution ( IssueParticipantRole  role)

Definition at line 253 of file DatawarehouseVM.java.

253  {
254  SimpleCategoryModel cm = new SimpleCategoryModel();
255  WhereClause wc = new WhereClause();
256  wc.addClause("select concat(year(solvedDate), '-', month(solvedDate)), resolution, count(distinct issueId)");
257  wc.addClause("from DWIssue");
258  wc.addClause("where 1=1");
259  addFilter(wc, "solvedDate", role);
260  wc.addClause("group by concat(year(solvedDate), '-', month(solvedDate)), resolution");
261  wc.addClause("order by concat(year(solvedDate), '-', month(solvedDate))");
262  List<Object[]> results = getDao().getResultList(wc);
263  for(Object o[] : results) {
264  IssueResolution resolution = (IssueResolution) o[1];
265  String month = (String) o[0];
266  cm.setValue(resolution.toString(), month, (Number) o[2]);
267  }
268  DWChart chart = new DWChart();
269  chart.setTitle("Resolution");
270  chart.setModel(cm);
271  chart.setType("line");
272  chart.setHeight("300");
273  chart.setWidth((cm.getCategories().size() * 70 + 40) + "");
274  return chart;
275  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimelineByStatus()

DWChart org.turro.dossier.dw.DatawarehouseVM.getTimelineByStatus ( IssueParticipantRole  role)

Definition at line 277 of file DatawarehouseVM.java.

277  {
278  SimpleCategoryModel cm = new SimpleCategoryModel();
279  WhereClause wc = new WhereClause();
280  wc.addClause("select concat(year(startDate), '-', month(startDate)), status, count(distinct issueId)");
281  wc.addClause("from DWIssue");
282  wc.addClause("where 1=1");
283  addFilter(wc, "startDate", role);
284  wc.addClause("group by concat(year(startDate), '-', month(startDate)), status");
285  wc.addClause("order by concat(year(startDate), '-', month(startDate))");
286  List<Object[]> results = getDao().getResultList(wc);
287  for(Object o[] : results) {
288  IssueStatus status = (IssueStatus) o[1];
289  String month = (String) o[0];
290  cm.setValue(status.toString(), month, (Number) o[2]);
291  }
292  DWChart chart = new DWChart();
293  chart.setTitle("Status");
294  chart.setModel(cm);
295  chart.setType("line");
296  chart.setHeight("300");
297  chart.setWidth((cm.getCategories().size() * 70 + 40) + "");
298  return chart;
299  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimelineByType()

DWChart org.turro.dossier.dw.DatawarehouseVM.getTimelineByType ( IssueParticipantRole  role)

Definition at line 301 of file DatawarehouseVM.java.

301  {
302  SimpleCategoryModel cm = new SimpleCategoryModel();
303  WhereClause wc = new WhereClause();
304  wc.addClause("select concat(year(startDate), '-', month(startDate)), type, count(distinct issueId)");
305  wc.addClause("from DWIssue");
306  wc.addClause("where 1=1");
307  addFilter(wc, "startDate", role);
308  wc.addClause("group by concat(year(startDate), '-', month(startDate)), type");
309  wc.addClause("order by concat(year(startDate), '-', month(startDate))");
310  List<Object[]> results = getDao().getResultList(wc);
311  for(Object o[] : results) {
312  IssueType type = (IssueType) o[1];
313  String month = (String) o[0];
314  cm.setValue(type.toString(), month, (Number) o[2]);
315  }
316  DWChart chart = new DWChart();
317  chart.setTitle("Type");
318  chart.setModel(cm);
319  chart.setType("line");
320  chart.setHeight("300");
321  chart.setWidth((cm.getCategories().size() * 70 + 40) + "");
322  return chart;
323  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void org.turro.dossier.dw.DatawarehouseVM.init ( )

Definition at line 100 of file DatawarehouseVM.java.

100  {
101  engine = new DWChartEngine();
102  start = new CheckDate().addYears(-5).setDay(1).getDate();
103  end = new CheckDate().addMonths(1).setDay(31).getDate();
104  charts = new ArrayList<>();
105  report = DWReportType.DW_TIMELINE;
106  }

◆ selectContact()

void org.turro.dossier.dw.DatawarehouseVM.selectContact ( @BindingParam("contact") IContact  contact)

Definition at line 129 of file DatawarehouseVM.java.

129  {
130  setContact(contact);
131  }
Here is the call graph for this function:

◆ selectEntity()

void org.turro.dossier.dw.DatawarehouseVM.selectEntity ( @BindingParam("entity") Object  entity)

Definition at line 114 of file DatawarehouseVM.java.

114  {
115  if(entity instanceof Category) {
116  this.category = (Category) entity;
117  this.dossier = null;
118  } else if(entity instanceof Dossier) {
119  this.dossier = (Dossier) entity;
120  this.category = null;
121  } else {
122  this.dossier = null;
123  this.category = null;
124  }
125  }

◆ selectReport()

void org.turro.dossier.dw.DatawarehouseVM.selectReport ( @BindingParam("type") DWReportType  type)

Definition at line 135 of file DatawarehouseVM.java.

135  {
136  this.report = type;
137  }

◆ setCategory()

void org.turro.dossier.dw.DatawarehouseVM.setCategory ( Category  category)

Definition at line 79 of file DatawarehouseVM.java.

79  {
80  this.category = category;
81  }

◆ setContact()

void org.turro.dossier.dw.DatawarehouseVM.setContact ( IContact  contact)

Definition at line 95 of file DatawarehouseVM.java.

95  {
96  this.contact = contact;
97  }
Here is the caller graph for this function:

◆ setDossier()

void org.turro.dossier.dw.DatawarehouseVM.setDossier ( Dossier  dossier)

Definition at line 87 of file DatawarehouseVM.java.

87  {
88  this.dossier = dossier;
89  }

◆ setEnd()

void org.turro.dossier.dw.DatawarehouseVM.setEnd ( Date  end)

Definition at line 71 of file DatawarehouseVM.java.

71  {
72  this.end = end;
73  }

◆ setStart()

void org.turro.dossier.dw.DatawarehouseVM.setStart ( Date  start)

Definition at line 63 of file DatawarehouseVM.java.

63  {
64  this.start = start;
65  }

◆ update()

void org.turro.dossier.dw.DatawarehouseVM.update ( )

Definition at line 110 of file DatawarehouseVM.java.

110 {}

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