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

Public Member Functions

 DossierIterator (IConstructor constructor, String pubPath, String uniqueId)
 
 DossierIterator (IConstructor constructor, boolean mail, String pubPath, String uniqueId)
 
void setCategoryId (long categoryId)
 
void setDossierId (long dossierId)
 
void setDossierStatus (List< String > dossierStatus)
 
List< String > getProjectPhases ()
 
void setProjectPhases (List< String > projectPhases)
 
boolean isShowSubject ()
 
void setShowSubject (boolean showSubject)
 
void setAllowedCategories (String allowedCategories)
 
boolean isDirect ()
 
void setDirect (boolean direct)
 
void setRelated (Collection< IContact > related)
 
String getPendingWorths ()
 
void setPendingWorths (String pendingWorths)
 
String getIssuePath ()
 
void setIssuePath (String issuePath)
 
PhaseHtmlFilter getPhaseFilter ()
 
void setPhaseFilter (PhaseHtmlFilter phaseFilter)
 
String getActualParameters ()
 
AttachCtrl getAttachments (Object obj)
 
String getCreateIssueCtrl (String link, Dossier dossier, String template)
 
String getAddInformationCtrl (String link, Issue issue, String template)
 
Object getParticipationCtrl (Dossier dossier, ParticipationReason reason)
 
- Public Member Functions inherited from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >
 DaoHtmlIterator (Dao dao, ElephantMarker marker)
 
 DaoHtmlIterator (Dao dao, ElephantMarker marker, Writer writer)
 
void setSummaryTemplate (String summaryTemplate)
 
String getSummaryTemplate ()
 
void setFullTemplate (String fullTemplate)
 
String getFullTemplate ()
 
boolean isRestricted ()
 
void setRestricted (boolean restricted)
 
boolean isAllowInterest ()
 
void setAllowInterest (boolean allowInterest)
 
boolean isAllowComments ()
 
void setAllowComments (boolean allowComments)
 
boolean isAllowVotes ()
 
void setAllowVotes (boolean allowVotes)
 
boolean isAllowForum ()
 
void setAllowForum (boolean allowForum)
 
boolean isAllowDescriptions ()
 
void setAllowDescriptions (boolean allowDescriptions)
 
boolean isAllowAttachments ()
 
void setAllowAttachments (boolean allowAttachments)
 
boolean isAllowFiles ()
 
void setAllowFiles (boolean allowFiles)
 
boolean isAllowPolls ()
 
void setAllowPolls (boolean allowPolls)
 
boolean isAllowRanking ()
 
void setAllowRanking (boolean allowRanking)
 
boolean isAllowMatching ()
 
void setAllowMatching (boolean allowMatching)
 
boolean isDoMatching ()
 
void setDoMatching (boolean doMatching)
 
String getRankingInstance ()
 
void setRankingInstance (String rankingInstance)
 
String getMatchingInstance ()
 
void setMatchingInstance (String matchingInstance)
 
boolean isAllowSorting ()
 
void setAllowSorting (boolean allowSorting)
 
boolean isNavigatorTop ()
 
void setNavigatorTop (boolean navigatorTop)
 
boolean isNavigatorBottom ()
 
void setNavigatorBottom (boolean navigatorBottom)
 
DaoHtmlTree getNavigationTree ()
 
void setNavigationTree (DaoHtmlTree navigationTree)
 
DaoHtmlSearch getSearchEngine ()
 
void setSearchEngine (DaoHtmlSearch searchEngine)
 
boolean isSearchOption ()
 
void setSearchOption (boolean searchOption)
 
boolean isForceSummary ()
 
void setForceSummary (boolean forceSummary)
 
boolean wantItem ()
 
boolean isItem ()
 
boolean checkEntity (ID value)
 
Object addAttribute (String key, Object value)
 
Writer getWriter ()
 
void load ()
 
void forceItem (ID item)
 
String getTitle ()
 
Collection< String > getMetas ()
 
void render ()
 
boolean isFirst ()
 
boolean isLast ()
 
String renderSearchEngine ()
 
String renderTree ()
 
String renderTreeSelection ()
 
TagSet getCloudTags ()
 
TagSet getEntityTags (Object entity)
 
boolean isSeen (Object entity)
 
VisualElements getVisuals ()
 
boolean isEmpty ()
 
- Public Member Functions inherited from org.turro.jpa.iterator.DaoIterator< E, ID >
 DaoIterator (Dao dao)
 
int getPage ()
 
void setPage (int page)
 
List< E > getItems ()
 
int getTotalCount ()
 
List< E > getTotalItems ()
 
int item ()
 
void current (int value)
 
int current ()
 
int pages ()
 
boolean beginning ()
 
boolean end ()
 
void next ()
 
void previous ()
 

Protected Member Functions

WhereClause getWhereClause ()
 
WhereClause getCountClause ()
 
void renderSummary (ElephantMarker marker, Dossier e, int page)
 
void renderItem (ElephantMarker marker, Dossier e, int page)
 
String entityRoot ()
 
Dossier entity (Long value)
 
Long getIdentifier ()
 
boolean isValid (Dossier e)
 
VisualElements loadVisuals ()
 
String title (Dossier e)
 
Collection< String > metas (Dossier e)
 
- Protected Member Functions inherited from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >
abstract E entity (ID value)
 
abstract void renderSummary (ElephantMarker marker, E e, int page)
 
abstract void renderItem (ElephantMarker marker, E e, int page)
 
abstract String title (E e)
 
abstract Collection< String > metas (E e)
 
void renderForbidden (ElephantMarker marker, int page)
 
ID getIDFromURL (String root)
 
void preload ()
 
boolean isValid (E e)
 
boolean canShow (E e)
 
ID parseId (String value)
 
String stringId (ID value)
 
- Protected Member Functions inherited from org.turro.jpa.iterator.DaoIterator< E, ID >
void initClauses ()
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.action.content.IContentIterator
static String PRELOAD_TMPL = "#preload"
 
- Protected Attributes inherited from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >
HTMLHelper html
 
IConstructor constructor
 
ElephantMarker marker
 
DaoHtmlSearch searchEngine
 
DaoHtmlTree navigationTree
 
- Protected Attributes inherited from org.turro.jpa.iterator.DaoIterator< E, ID >
List< E > items
 
Dao dao
 
int _total = -1
 

Detailed Description

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

Definition at line 90 of file DossierIterator.java.

Constructor & Destructor Documentation

◆ DossierIterator() [1/2]

org.turro.dossier.www.DossierIterator.DossierIterator ( IConstructor  constructor,
String  pubPath,
String  uniqueId 
)

Definition at line 101 of file DossierIterator.java.

101  {
102  this(constructor, false, pubPath, uniqueId);
103  }

◆ DossierIterator() [2/2]

org.turro.dossier.www.DossierIterator.DossierIterator ( IConstructor  constructor,
boolean  mail,
String  pubPath,
String  uniqueId 
)

Definition at line 105 of file DossierIterator.java.

105  {
106  super(new DossierPU(), new ElephantMarker(constructor, mail));
107  this.pubPath = pubPath;
108  this.uniqueId = uniqueId;
109  this.all = Application.getApplication().isInRole("dossier:all");
110  }
Here is the call graph for this function:

Member Function Documentation

◆ entity()

Dossier org.turro.dossier.www.DossierIterator.entity ( Long  value)
protected

Definition at line 303 of file DossierIterator.java.

303  {
304  WhereClause wc = new WhereClause();
305  wc.addClause("select distinct dossier from Dossier as dossier");
306  wc.addClause("left outer join dossier.participants participant");
307  wc.addClause("left outer join dossier.project project");
308  addCriteria(wc, true);
309  wc.addClause("and dossier.id = :id");
310  wc.addNamedValue("id", value);
311  return (Dossier) dao.getSingleResultOrNull(wc);
312  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

String org.turro.dossier.www.DossierIterator.entityRoot ( )
protected

Reimplemented from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >.

Definition at line 298 of file DossierIterator.java.

298  {
299  return "dossier";
300  }

◆ getActualParameters()

String org.turro.dossier.www.DossierIterator.getActualParameters ( )

Definition at line 211 of file DossierIterator.java.

211  {
212  return Strings.isBlank(actualParameters) ? "?a=b" : actualParameters;
213  }

◆ getAddInformationCtrl()

String org.turro.dossier.www.DossierIterator.getAddInformationCtrl ( String  link,
Issue  issue,
String  template 
)

Definition at line 246 of file DossierIterator.java.

246  {
247  return AddInformationCtrl.addInformation(new IssueWrapper(issue), link, template);
248  }
Here is the call graph for this function:

◆ getAttachments()

AttachCtrl org.turro.dossier.www.DossierIterator.getAttachments ( Object  obj)

Definition at line 215 of file DossierIterator.java.

215  {
216  if(obj instanceof Issue) {
217  Issue issue = (Issue) obj;
218  AttachCtrl ac = new AttachCtrl(constructor);
219  ac.setEntityPath(DossierPU.getObjectPath(issue));
220  if(isRestricted() && new DossierWrapper(issue.getDossier()).getCanShowAllAttachments()) {
221  ac.setPublicOnly(false);
222  } else {
223  ac.setPublicOnly(true);
224  }
225  return ac;
226  } else if(obj instanceof Dossier) {
227  Dossier dossier = (Dossier) obj;
228  AttachCtrl ac = new AttachCtrl(constructor);
229  ac.setEntityPath(DossierPU.getObjectPath(dossier));
230  IContact contact = Authentication.getIContact();
231  ac.addRestrictedFolders(dossier.getFullParticipants().getParticipationStrings(contact));
232  if(isRestricted() && new DossierWrapper(dossier).getCanShowAllAttachments()) {
233  ac.setPublicOnly(false);
234  } else {
235  ac.setPublicOnly(true);
236  }
237  return ac;
238  }
239  return null;
240  }
Here is the call graph for this function:

◆ getCountClause()

WhereClause org.turro.dossier.www.DossierIterator.getCountClause ( )
protected

Reimplemented from org.turro.jpa.iterator.DaoIterator< E, ID >.

Definition at line 202 of file DossierIterator.java.

202  {
203  WhereClause wc = new WhereClause();
204  wc.addClause("select count(distinct dossier) from Dossier as dossier");
205  wc.addClause("left outer join dossier.participants participant");
206  wc.addClause("left outer join dossier.project project");
207  addCriteria(wc, true);
208  return wc;
209  }
Here is the call graph for this function:

◆ getCreateIssueCtrl()

String org.turro.dossier.www.DossierIterator.getCreateIssueCtrl ( String  link,
Dossier  dossier,
String  template 
)

Definition at line 242 of file DossierIterator.java.

242  {
243  return CreateIssueCtrl.createIssue(link, dossier.getId() + "", template);
244  }
Here is the call graph for this function:

◆ getIdentifier()

Long org.turro.dossier.www.DossierIterator.getIdentifier ( )
protected

Reimplemented from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >.

Definition at line 315 of file DossierIterator.java.

315  {
316  Long identifier = getIDFromURL("/dossier");
317  if(identifier == null) {
318  identifier = super.getIdentifier();
319  }
320  return identifier;
321  }
Here is the call graph for this function:

◆ getIssuePath()

String org.turro.dossier.www.DossierIterator.getIssuePath ( )

Definition at line 168 of file DossierIterator.java.

168  {
169  return issuePath;
170  }

◆ getParticipationCtrl()

Object org.turro.dossier.www.DossierIterator.getParticipationCtrl ( Dossier  dossier,
ParticipationReason  reason 
)

Definition at line 250 of file DossierIterator.java.

250  {
251  return Entities.getController(dossier).getParticipationControl(constructor, reason);
252  }
Here is the call graph for this function:

◆ getPendingWorths()

String org.turro.dossier.www.DossierIterator.getPendingWorths ( )

Definition at line 160 of file DossierIterator.java.

160  {
161  return pendingWorths;
162  }

◆ getPhaseFilter()

PhaseHtmlFilter org.turro.dossier.www.DossierIterator.getPhaseFilter ( )

Definition at line 176 of file DossierIterator.java.

176  {
177  return phaseFilter;
178  }

◆ getProjectPhases()

List<String> org.turro.dossier.www.DossierIterator.getProjectPhases ( )

Definition at line 128 of file DossierIterator.java.

128  {
129  return projectPhases;
130  }

◆ getWhereClause()

WhereClause org.turro.dossier.www.DossierIterator.getWhereClause ( )
protected

Reimplemented from org.turro.jpa.iterator.DaoIterator< E, ID >.

Definition at line 185 of file DossierIterator.java.

185  {
186  WhereClause wc = new WhereClause();
187  wc.addClause("select distinct dossier from Dossier as dossier");
188  wc.addClause("left outer join dossier.participants participant");
189  wc.addClause("left outer join dossier.project project");
190  return Statistics.load(constructor, "DossierRanking", "DossierContactMatching", wc)
191  .allowMatching(isAllowMatching())
192  .allowRanking(isAllowRanking())
193  .doMatching(isDoMatching())
194  .setContact(Authentication.getIContact())
195  .setEntityFields("dossier", "id")
196  .setDefaultSorting("dossier.description")
197  .onCriteria(w -> addCriteria(w, true))
198  .getClause();
199  }
Here is the call graph for this function:

◆ isDirect()

boolean org.turro.dossier.www.DossierIterator.isDirect ( )

Definition at line 148 of file DossierIterator.java.

148  {
149  return direct;
150  }

◆ isShowSubject()

boolean org.turro.dossier.www.DossierIterator.isShowSubject ( )

Definition at line 136 of file DossierIterator.java.

136  {
137  return showSubject;
138  }

◆ isValid()

boolean org.turro.dossier.www.DossierIterator.isValid ( Dossier  e)
protected

Definition at line 396 of file DossierIterator.java.

396  {
397  if(isRestricted() && e != null) {
398  return all || new DossierWrapper(e).isParticipant();
399  } else {
400  return super.isValid(e);
401  }
402  }
Here is the call graph for this function:

◆ loadVisuals()

VisualElements org.turro.dossier.www.DossierIterator.loadVisuals ( )
protected

Reimplemented from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >.

Definition at line 405 of file DossierIterator.java.

405  {
406  return DossierVisualElements.load();
407  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.dossier.www.DossierIterator.metas ( Dossier  e)
protected

Definition at line 636 of file DossierIterator.java.

636  {
637  ArrayList<RepositoryFile> files = new ArrayList<>();
638  String path = getItemLink(e, 0);
639  if(!SocialImageMap.hasImage(path)) {
640  FileAttach fa = new FileAttach(DossierPU.getObjectPath(e));
641  Repository repository = fa.getPublishableRepository(constructor);
642  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
643  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
644  }
645  SocialNet sn;
646  if(e.getProject() != null) {
647  sn = new SocialNet(path, e.getDescription(), e.getProject().getGoal(), files);
648  } else {
649  sn = new SocialNet(path, e.getDescription(), e.getFullDescription(), files);
650  }
651  return sn.getMetas();
652  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.dossier.www.DossierIterator.renderItem ( ElephantMarker  marker,
Dossier  e,
int  page 
)
protected

Definition at line 268 of file DossierIterator.java.

268  {
269  Long issueId = (Long) ObjectString.parseString(constructor.getParameter("issueId"), Long.class, false);
270  if(issueId != null) {
271  Issue issue = dao.find(Issue.class, issueId);
272  if(issue != null && issue.getDossier().getId().equals(e.getId())) {
273  marker.put("issue", issue);
274  if(!Strings.isBlank(issue.getFullDescription(showSubject))) {
276  "jQuery('title').html('" + issue.getFullDescription(showSubject).replace("'", "\\'") + "');"
277  );
278  }
279  prepareValues(issue, page, false);
280  marker.put("restricted", isRestricted());
281  marker.process("issue", getFullTemplate());
282  }
283  } else {
284  marker.put("dossier", e);
285 // if(!Strings.isBlank(e.getFullDescription(showSubject))) {
286 // constructor.addOnLoadedJavaScript(
287 // "jQuery('title').html('" + e.getFullDescription(showSubject).replace("'", "\\'") + "');"
288 // );
289 // }
290  prepareValues(e, page, false);
291  marker.put("restricted", isRestricted());
292  marker.process("dossier", getFullTemplate());
293  }
294  actualParameters = getPageLink(page);
295  }
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
void addOnLoadedJavaScript(String script)
Here is the call graph for this function:

◆ renderSummary()

void org.turro.dossier.www.DossierIterator.renderSummary ( ElephantMarker  marker,
Dossier  e,
int  page 
)
protected

Definition at line 255 of file DossierIterator.java.

255  {
256  if(e != null) {
257  marker.put("dossier", e);
258  marker.put("newCategory", e.getCategory().getId() != lastCategoryId);
259  lastCategoryId = e.getCategory().getId();
260  prepareValues(e, page, false);
261  marker.put("restricted", isRestricted());
262  }
263  marker.process("dossier", getSummaryTemplate());
264  actualParameters = getPageLink(page);
265  }
Here is the call graph for this function:

◆ setAllowedCategories()

void org.turro.dossier.www.DossierIterator.setAllowedCategories ( String  allowedCategories)

Definition at line 144 of file DossierIterator.java.

144  {
145  this.allowedCategories = allowedCategories;
146  }
Here is the caller graph for this function:

◆ setCategoryId()

void org.turro.dossier.www.DossierIterator.setCategoryId ( long  categoryId)

Definition at line 112 of file DossierIterator.java.

112  {
113  this.categoryId = categoryId;
114  }
Here is the caller graph for this function:

◆ setDirect()

void org.turro.dossier.www.DossierIterator.setDirect ( boolean  direct)

Definition at line 152 of file DossierIterator.java.

152  {
153  this.direct = direct;
154  }
Here is the caller graph for this function:

◆ setDossierId()

void org.turro.dossier.www.DossierIterator.setDossierId ( long  dossierId)

Definition at line 116 of file DossierIterator.java.

116  {
117  this.dossierId = dossierId;
118  }
Here is the caller graph for this function:

◆ setDossierStatus()

void org.turro.dossier.www.DossierIterator.setDossierStatus ( List< String >  dossierStatus)

Definition at line 124 of file DossierIterator.java.

124  {
125  this.dossierStatus = dossierStatus;
126  }
Here is the caller graph for this function:

◆ setIssuePath()

void org.turro.dossier.www.DossierIterator.setIssuePath ( String  issuePath)

Definition at line 172 of file DossierIterator.java.

172  {
173  this.issuePath = issuePath;
174  }
Here is the caller graph for this function:

◆ setPendingWorths()

void org.turro.dossier.www.DossierIterator.setPendingWorths ( String  pendingWorths)

Definition at line 164 of file DossierIterator.java.

164  {
165  this.pendingWorths = pendingWorths;
166  }
Here is the caller graph for this function:

◆ setPhaseFilter()

void org.turro.dossier.www.DossierIterator.setPhaseFilter ( PhaseHtmlFilter  phaseFilter)

Definition at line 180 of file DossierIterator.java.

180  {
181  this.phaseFilter = phaseFilter;
182  }
Here is the caller graph for this function:

◆ setProjectPhases()

void org.turro.dossier.www.DossierIterator.setProjectPhases ( List< String >  projectPhases)

Definition at line 132 of file DossierIterator.java.

132  {
133  this.projectPhases = projectPhases;
134  }
Here is the caller graph for this function:

◆ setRelated()

void org.turro.dossier.www.DossierIterator.setRelated ( Collection< IContact related)

Definition at line 156 of file DossierIterator.java.

156  {
157  this.related = related;
158  }
Here is the caller graph for this function:

◆ setShowSubject()

void org.turro.dossier.www.DossierIterator.setShowSubject ( boolean  showSubject)

Definition at line 140 of file DossierIterator.java.

140  {
141  this.showSubject = showSubject;
142  }

◆ title()

String org.turro.dossier.www.DossierIterator.title ( Dossier  e)
protected

Definition at line 628 of file DossierIterator.java.

628  {
629  if(!Strings.isBlank(e.getFullDescription(showSubject))) {
630  return e.getFullDescription(showSubject);
631  }
632  return null;
633  }
Here is the call graph for this function:

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