BrightSide Workbench Full Report + Source Code
org.turro.dossier.command.DossierSummary Class Reference
Inheritance diagram for org.turro.dossier.command.DossierSummary:
Collaboration diagram for org.turro.dossier.command.DossierSummary:

Public Member Functions

String render (IConstructor constructor)
 
boolean isRequired ()
 
void init (IConstructor constructor)
 
int getOrder ()
 
int compareTo (IUserSummary o)
 

Detailed Description

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

Definition at line 52 of file DossierSummary.java.

Member Function Documentation

◆ compareTo()

int org.turro.dossier.command.DossierSummary.compareTo ( IUserSummary  o)

Definition at line 221 of file DossierSummary.java.

221  {
222  int result = CompareUtil.compare(getOrder(), o.getOrder());
223  if(result == 0) {
224  result = CompareUtil.compare(getClass().getName(), o.getClass().getName());
225  }
226  return result;
227  }
Here is the call graph for this function:

◆ getOrder()

int org.turro.dossier.command.DossierSummary.getOrder ( )

Implements org.turro.action.IUserSummary.

Definition at line 216 of file DossierSummary.java.

216  {
217  return 0;
218  }
Here is the caller graph for this function:

◆ init()

void org.turro.dossier.command.DossierSummary.init ( IConstructor  constructor)

Implements org.turro.action.IUserSummary.

Definition at line 73 of file DossierSummary.java.

73  {
74 
75  IContact contact = Authentication.getIContact();
76 
77  /* Dossiers */
78 
79  DWDossierModel dossierModel = (DWDossierModel) UserSummaries.getAttribute("dossierModel");
80 
81  if(dossierModel == null) {
82 
83  dossierModel = new DWDossierModel();
84 
85  UserSummaries.setAttribute("dossierFullCount", dossierModel.getCount());
86  UserSummaries.setAttribute("projectFullCount", dossierModel.getProjectCount());
87  UserSummaries.setAttribute("dossierParticipantsFullCount", dossierModel.getParticipantsCount());
88 
89  if(!contact.isOutsider()) {
90  dossierModel.setIParticipant(contact);
91 
92  UserSummaries.setAttribute("dossierModel", dossierModel);
93  UserSummaries.setAttribute("dossierCount", dossierModel.getCount());
94  UserSummaries.setAttribute("projectCount", dossierModel.getProjectCount());
95  UserSummaries.setAttribute("dossierParticipantsCount", dossierModel.getParticipantsCount());
96  UserSummaries.setAttribute("acceptCount", (Long) pending());
97  UserSummaries.setAttribute("pendingCount", new PendingRevisionQuery().getCount());
98 
99  UserSummaries.setAttribute("dStatusChart", new DWWebChart(constructor) {
100  @Override
101  protected void onCreate(Data data, Object[] pars) {
102  // create link
103  }
104  @Override
105  protected void loadData() {
106  IContact c = ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).getIParticipant();
107  ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).setIParticipant(null);
108  setData(I_.get("Status"),
109  ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).getByStatus());
110  ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).setIParticipant(c);
111  }
112  });
113 
114  UserSummaries.setAttribute("dPhaseChart", new DWWebChart(constructor) {
115  @Override
116  protected void onCreate(Data data, Object[] pars) {
117  // create link
118  }
119  @Override
120  protected void loadData() {
121  IContact c = ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).getIParticipant();
122  ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).setIParticipant(null);
123  List<Object[]> data = ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).getByPhase();
124  for(Object[] obj : data) {
125  obj[0] = PhaseDefinitions.instance().get((int) obj[0]).getName();
126  }
127  setData(I_.get("Phase"), data);
128  ((DWDossierModel) UserSummaries.getAttribute("dossierModel")).setIParticipant(c);
129  }
130  });
131  }
132  }
133 
134  /* Issues */
135 
136  DWIssueModel issueModel = (DWIssueModel) UserSummaries.getAttribute("issueModel");
137 
138  if(issueModel == null) {
139 
140  issueModel = new DWIssueModel();
141 
142  UserSummaries.setAttribute("issueModel", issueModel);
143 
144  UserSummaries.setAttribute("issueFullCount", issueModel.getCount());
145  UserSummaries.setAttribute("issueParticipantsFullCount", issueModel.getParticipantsCount());
146  UserSummaries.setAttribute("issueCommentFullCount", issueModel.getCommentCount());
147 
148  if(!contact.isOutsider()) {
149  issueModel.setIParticipant(contact);
150 
151  UserSummaries.setAttribute("issueCount", issueModel.getCount());
152  UserSummaries.setAttribute("issueParticipantsCount", issueModel.getParticipantsCount());
153  UserSummaries.setAttribute("issueOpenCount", issueModel.getOpenedCount());
154  UserSummaries.setAttribute("issueCommentCount", issueModel.getCommentCount());
155 
156  UserSummaries.setAttribute("typeChart", new DWWebChart(constructor) {
157  @Override
158  protected void onCreate(Data data, Object[] pars) {
159  data.setLink(ElephantContext.getRootWebPath() + KnowledgeBaseDashboard.createLink("*", false,
160  (Set<IssueType>) EnumSet.of((IssueType) pars[0]), null, null, 0L));
161  }
162  @Override
163  protected void loadData() {
164  IContact c = ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getIParticipant();
165  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(null);
166  setData(I_.get("Type"),
167  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getByType());
168  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(c);
169  }
170  });
171  UserSummaries.setAttribute("statusChart", new DWWebChart(constructor) {
172  @Override
173  protected void onCreate(Data data, Object[] pars) {
174  data.setLink(ElephantContext.getRootWebPath() + KnowledgeBaseDashboard.createLink("*", false, null,
175  (Set<IssueStatus>) EnumSet.of((IssueStatus) pars[0]), null, 0L));
176  }
177  @Override
178  protected void loadData() {
179  IContact c = ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getIParticipant();
180  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(null);
181  setData(I_.get("Status"),
182  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getByStatus());
183  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(c);
184  }
185  });
186  UserSummaries.setAttribute("resolutionChart", new DWWebChart(constructor) {
187  @Override
188  protected void onCreate(Data data, Object[] pars) {
189  data.setLink(ElephantContext.getRootWebPath() + KnowledgeBaseDashboard.createLink("*", false, null, null,
190  (Set<IssueResolution>) EnumSet.of((IssueResolution) pars[0]), 0L));
191  }
192  @Override
193  protected void loadData() {
194  IContact c = ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getIParticipant();
195  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(null);
196  setData(I_.get("Resolution"),
197  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).getByResolution());
198  ((DWIssueModel) UserSummaries.getAttribute("issueModel")).setIParticipant(c);
199  }
200  });
201  }
202 
203  }
204  }
Here is the call graph for this function:

◆ isRequired()

boolean org.turro.dossier.command.DossierSummary.isRequired ( )

Implements org.turro.action.IUserSummary.

Definition at line 68 of file DossierSummary.java.

68  {
69  return false;
70  }

◆ render()

String org.turro.dossier.command.DossierSummary.render ( IConstructor  constructor)

Implements org.turro.action.IUserSummary.

Definition at line 55 of file DossierSummary.java.

55  {
56  ElephantMarker marker = new ElephantMarker(constructor);
57  marker.putAll(UserSummaries.getAttributes());
58 
59  if(UserSummaries.isNotZero("dossierCount") ||
60  UserSummaries.isNotZero("issueCount")) {
61  return marker.parse("dossier", "userSummary");
62  }
63 
64  return "";
65  }
Here is the call graph for this function:

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