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

Public Member Functions

 IssueIterator (IConstructor constructor, String pubPath, String uniqueId)
 
 IssueIterator (IConstructor constructor, boolean mail, String pubPath, String uniqueId)
 
void setCategoryId (long categoryId)
 
void setDossierId (long dossierId)
 
void setDossierStatus (List< String > dossierStatus)
 
void setIssueTypes (List< String > issueTypes)
 
void setIssueStatus (List< String > issueStatus)
 
boolean isShowSubject ()
 
void setShowSubject (boolean showSubject)
 
IssueOrdering getOrderBy ()
 
void setOrderBy (IssueOrdering orderBy)
 
boolean isOnlyAssists ()
 
void setOnlyAssists (boolean onlyAssists)
 
String getActualParameters ()
 
- 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, Issue e, int page)
 
void renderItem (ElephantMarker marker, Issue e, int page)
 
String entityRoot ()
 
Issue entity (Long value)
 
boolean isValid (Issue e)
 
String title (Issue e)
 
Collection< String > metas (Issue e)
 
- Protected Member Functions inherited from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >
VisualElements loadVisuals ()
 
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)
 
ID getIdentifier ()
 
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 66 of file IssueIterator.java.

Constructor & Destructor Documentation

◆ IssueIterator() [1/2]

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

Definition at line 75 of file IssueIterator.java.

75  {
76  this(constructor, false, pubPath, uniqueId);
77  }

◆ IssueIterator() [2/2]

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

Definition at line 79 of file IssueIterator.java.

79  {
80  super(new DossierPU(), new ElephantMarker(constructor, mail));
81  this.pubPath = pubPath;
82  this.uniqueId = uniqueId;
83  this.all = Application.getApplication().isInRole("issue:all");
84  }
Here is the call graph for this function:

Member Function Documentation

◆ entity()

Issue org.turro.dossier.www.IssueIterator.entity ( Long  value)
protected

Definition at line 204 of file IssueIterator.java.

204  {
205  WhereClause wc = new WhereClause();
206  wc.addClause("select distinct i from Issue as i");
207  wc.addClause("join i.participants as p");
208  addCriteria(wc);
209  wc.addClause("and i.id = :id");
210  wc.addNamedValue("id", value);
211  return (Issue) dao.getSingleResultOrNull(wc);
212  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

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

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

Definition at line 199 of file IssueIterator.java.

199  {
200  return "issue";
201  }

◆ getActualParameters()

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

Definition at line 149 of file IssueIterator.java.

149  {
150  return Strings.isBlank(actualParameters) ? "?a=b" : actualParameters;
151  }

◆ getCountClause()

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

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

Definition at line 141 of file IssueIterator.java.

141  {
142  WhereClause wc = new WhereClause();
143  wc.addClause("select count(distinct i) from Issue as i");
144  wc.addClause("join i.participants as p");
145  addCriteria(wc);
146  return wc;
147  }
Here is the call graph for this function:

◆ getOrderBy()

IssueOrdering org.turro.dossier.www.IssueIterator.getOrderBy ( )

Definition at line 114 of file IssueIterator.java.

114  {
115  return orderBy;
116  }

◆ getWhereClause()

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

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

Definition at line 131 of file IssueIterator.java.

131  {
132  WhereClause wc = new WhereClause();
133  wc.addClause("select distinct i from Issue as i");
134  wc.addClause("join i.participants as p");
135  addCriteria(wc);
136  wc.addClause(IssueOrdering.ORDER_BY_ACTIVITY.getOrderBy());
137  return wc;
138  }
Here is the call graph for this function:

◆ isOnlyAssists()

boolean org.turro.dossier.www.IssueIterator.isOnlyAssists ( )

Definition at line 122 of file IssueIterator.java.

122  {
123  return onlyAssists;
124  }

◆ isShowSubject()

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

Definition at line 106 of file IssueIterator.java.

106  {
107  return showSubject;
108  }

◆ isValid()

boolean org.turro.dossier.www.IssueIterator.isValid ( Issue  e)
protected

Definition at line 279 of file IssueIterator.java.

279  {
280  if(isRestricted() && e != null) {
281  return participates(e);
282  } else {
283  return super.isValid(e);
284  }
285  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.dossier.www.IssueIterator.metas ( Issue  e)
protected

Definition at line 490 of file IssueIterator.java.

490  {
491  ArrayList<RepositoryFile> files = new ArrayList<>();
492  String path = getItemLink(e, 0);
493  if(!SocialImageMap.hasImage(path)) {
494  FileAttach fa = new FileAttach(DossierPU.getObjectPath(e));
495  Repository repository = fa.getPublishableRepository(constructor);
496  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
497  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
498  }
499  SocialNet sn = new SocialNet(path, e.getDescription(), e.getFullDescription(), files);
500  return sn.getMetas();
501  }
Here is the call graph for this function:

◆ renderItem()

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

Definition at line 169 of file IssueIterator.java.

169  {
170  Long dossId = (Long) ObjectString.parseString(constructor.getParameter("dossierId"), Long.class, false);
171  if(dossId != null) {
172  if(e.getDossier().getId().equals(dossId)) {
173  Dossier dossier = dao.find(Dossier.class, dossId);
174  marker.put("dossier", dossier);
175  if(!Strings.isBlank(dossier.getFullDescription(showSubject))) {
177  "jQuery('title').html('" + dossier.getFullDescription(showSubject).replace("'", "\\'") + "');"
178  );
179  }
180  prepareValues(dossier, page, false);
181  marker.put("restricted", isRestricted());
182  marker.process("dossier", getFullTemplate());
183  }
184  } else {
185  marker.put("issue", e);
186 // if(!Strings.isBlank(e.getFullDescription(showSubject))) {
187 // constructor.addOnLoadedJavaScript(
188 // "jQuery('title').html('" + e.getFullDescription(showSubject).replace("'", "\\'") + "');"
189 // );
190 // }
191  prepareValues(e, page, false);
192  marker.put("restricted", isRestricted());
193  marker.process("issue", getFullTemplate());
194  }
195  actualParameters = getPageLink(page);
196  }
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.IssueIterator.renderSummary ( ElephantMarker  marker,
Issue  e,
int  page 
)
protected

Definition at line 154 of file IssueIterator.java.

154  {
155  if(e != null) {
156  marker.put("issue", e);
157  marker.put("newCategory", e.getDossier().getCategory().getId() != lastCategoryId);
158  marker.put("newDossier", e.getDossier().getId() != lastDosierId);
159  lastCategoryId = e.getDossier().getCategory().getId();
160  lastDosierId = e.getDossier().getId();
161  prepareValues(e, page, false);
162  marker.put("restricted", isRestricted());
163  }
164  marker.process("issue", getSummaryTemplate());
165  actualParameters = getPageLink(page);
166  }
Here is the call graph for this function:

◆ setCategoryId()

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

Definition at line 86 of file IssueIterator.java.

86  {
87  this.categoryId = categoryId;
88  }
Here is the caller graph for this function:

◆ setDossierId()

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

Definition at line 90 of file IssueIterator.java.

90  {
91  this.dossierId = dossierId;
92  }
Here is the caller graph for this function:

◆ setDossierStatus()

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

Definition at line 94 of file IssueIterator.java.

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

◆ setIssueStatus()

void org.turro.dossier.www.IssueIterator.setIssueStatus ( List< String >  issueStatus)

Definition at line 102 of file IssueIterator.java.

102  {
103  this.issueStatus = issueStatus;
104  }
Here is the caller graph for this function:

◆ setIssueTypes()

void org.turro.dossier.www.IssueIterator.setIssueTypes ( List< String >  issueTypes)

Definition at line 98 of file IssueIterator.java.

98  {
99  this.issueTypes = issueTypes;
100  }
Here is the caller graph for this function:

◆ setOnlyAssists()

void org.turro.dossier.www.IssueIterator.setOnlyAssists ( boolean  onlyAssists)

Definition at line 126 of file IssueIterator.java.

126  {
127  this.onlyAssists = onlyAssists;
128  }
Here is the caller graph for this function:

◆ setOrderBy()

void org.turro.dossier.www.IssueIterator.setOrderBy ( IssueOrdering  orderBy)

Definition at line 118 of file IssueIterator.java.

118  {
119  this.orderBy = orderBy;
120  }
Here is the caller graph for this function:

◆ setShowSubject()

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

Definition at line 110 of file IssueIterator.java.

110  {
111  this.showSubject = showSubject;
112  }

◆ title()

String org.turro.dossier.www.IssueIterator.title ( Issue  e)
protected

Definition at line 482 of file IssueIterator.java.

482  {
483  if(!Strings.isBlank(e.getFullDescription(showSubject))) {
484  return e.getFullDescription(showSubject);
485  }
486  return null;
487  }
Here is the call graph for this function:

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