BrightSide Workbench Full Report + Source Code
org.turro.forum.content.ForumContentIterator Class Reference
Inheritance diagram for org.turro.forum.content.ForumContentIterator:
Collaboration diagram for org.turro.forum.content.ForumContentIterator:

Public Member Functions

 ForumContentIterator (IConstructor constructor, Writer writer, IContact contact, boolean mail, String pubPath)
 
void setSince (Date since)
 
- Public Member Functions inherited from org.turro.jpa.content.EntityDaoContentIterator< E, ID >
 EntityDaoContentIterator (Dao dao, IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
 
void setSeenStatus (SeenStatusCheck seenStatus)
 
SeenStatusCheck getSeenStatus ()
 
String getId ()
 
String getContextPath ()
 
IContact getContact ()
 
boolean isMail ()
 
Object getVotesCtrl (E e)
 
Object getInterestCtrl (E e)
 
Object getCommentsCtrl (E e)
 
Object getAttachmentsCtrl (E e)
 
Object getFilesCtrl (E e)
 
Object getDescriptionsCtrl (E e)
 
Object getPollsCtrl (E e)
 
Object getForumCtrl (E e)
 
void assignDefaultsByName (String name)
 
void assignDefaultsByMacro (MacroProcessorContext context)
 
Object getParticipationCtrl (E e, ParticipationReason reason)
 
Object getSpamCtrl (E e)
 
Object getFollowCtrl (E e)
 
Object getSeenCtrl (E e)
 
Object getLikeCtrl (E e)
 
Object getApplyCtrl (E e)
 
Object getCtrlByLabel (String ctrl, E e, IContact contact)
 
- 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, Topic e, int page)
 
void renderItem (ElephantMarker marker, Topic e, int page)
 
void renderForbidden (ElephantMarker marker, int page)
 
String entityRoot ()
 
Topic entity (Long value)
 
boolean canShow (Topic e)
 
String title (Topic e)
 
Collection< String > metas (Topic e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (Topic e)
 
Object doInterestCtrl (Topic e)
 
Object doCommentsCtrl (Topic e)
 
Object doAttachmentsCtrl (Topic e)
 
Object doFilesCtrl (Topic e)
 
Object doDescriptionsCtrl (Topic e)
 
Object doPollsCtrl (Topic e)
 
String getItemLink (Topic e)
 
String getReadAllLink ()
 
String getRestrictedLink ()
 
- Protected Member Functions inherited from org.turro.jpa.content.EntityDaoContentIterator< E, ID >
void prepareControls (E entity, int page)
 
String doItemLink (E entity, ID id, boolean obfuscated)
 
abstract Object doVotesCtrl (E e)
 
abstract Object doInterestCtrl (E e)
 
abstract Object doCommentsCtrl (E e)
 
abstract Object doAttachmentsCtrl (E e)
 
abstract Object doFilesCtrl (E e)
 
abstract Object doDescriptionsCtrl (E e)
 
abstract Object doPollsCtrl (E e)
 
abstract String getItemLink (E 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)
 
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 49 of file ForumContentIterator.java.

Constructor & Destructor Documentation

◆ ForumContentIterator()

org.turro.forum.content.ForumContentIterator.ForumContentIterator ( IConstructor  constructor,
Writer  writer,
IContact  contact,
boolean  mail,
String  pubPath 
)

Definition at line 53 of file ForumContentIterator.java.

53  {
54  super(new ElephantPU(), constructor, writer, contact, mail, pubPath);
55  }

Member Function Documentation

◆ canShow()

boolean org.turro.forum.content.ForumContentIterator.canShow ( Topic  e)
protected

Definition at line 123 of file ForumContentIterator.java.

123  {
124  return super.canShow(e) && (isRestricted() || e.getEntity().canPublish(getContact()));
125  }
Here is the call graph for this function:

◆ doAttachmentsCtrl()

Object org.turro.forum.content.ForumContentIterator.doAttachmentsCtrl ( Topic  e)
protected

Definition at line 220 of file ForumContentIterator.java.

220  {
221  return null;
222  }

◆ doCommentsCtrl()

Object org.turro.forum.content.ForumContentIterator.doCommentsCtrl ( Topic  e)
protected

Definition at line 215 of file ForumContentIterator.java.

215  {
216  return null;
217  }

◆ doDescriptionsCtrl()

Object org.turro.forum.content.ForumContentIterator.doDescriptionsCtrl ( Topic  e)
protected

Definition at line 230 of file ForumContentIterator.java.

230  {
231  return null;
232  }

◆ doFilesCtrl()

Object org.turro.forum.content.ForumContentIterator.doFilesCtrl ( Topic  e)
protected

Definition at line 225 of file ForumContentIterator.java.

225  {
226  return null;
227  }

◆ doInterestCtrl()

Object org.turro.forum.content.ForumContentIterator.doInterestCtrl ( Topic  e)
protected

Definition at line 210 of file ForumContentIterator.java.

210  {
211  return null;
212  }

◆ doPollsCtrl()

Object org.turro.forum.content.ForumContentIterator.doPollsCtrl ( Topic  e)
protected

Definition at line 235 of file ForumContentIterator.java.

235  {
236  return null;
237  }

◆ doVotesCtrl()

Object org.turro.forum.content.ForumContentIterator.doVotesCtrl ( Topic  e)
protected

Definition at line 205 of file ForumContentIterator.java.

205  {
206  return null;
207  }

◆ entity()

Topic org.turro.forum.content.ForumContentIterator.entity ( Long  value)
protected

Definition at line 111 of file ForumContentIterator.java.

111  {
112  WhereClause wc = new WhereClause();
113  wc.addClause("select distinct topic from Topic as topic");
114  wc.addClause("left join Post as post");
115  wc.addClause("on post.uniquePath like concat(topic.uniquePath, '%')");
116  addCriteria(wc);
117  wc.addClause("and topic.id = :id");
118  wc.addNamedValue("id", value);
119  return (Topic) dao.getSingleResultOrNull(wc);
120  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

String org.turro.forum.content.ForumContentIterator.entityRoot ( )
protected

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

Definition at line 106 of file ForumContentIterator.java.

106  {
107  return "topic";
108  }

◆ getCountClause()

WhereClause org.turro.forum.content.ForumContentIterator.getCountClause ( )
protected

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

Definition at line 73 of file ForumContentIterator.java.

73  {
74  WhereClause wc = new WhereClause();
75  wc.addClause("select count(distinct topic) from Topic as topic");
76  wc.addClause("left join Post as post");
77  wc.addClause("on post.uniquePath like concat(topic.uniquePath, '%')");
78  addCriteria(wc);
79  return wc;
80  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.forum.content.ForumContentIterator.getItemLink ( Topic  e)
protected

Definition at line 240 of file ForumContentIterator.java.

240  {
241  return doItemLink(e, e.getId(), true);
242  }
String doItemLink(E entity, ID id, boolean obfuscated)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReadAllLink()

String org.turro.forum.content.ForumContentIterator.getReadAllLink ( )
protected

Reimplemented from org.turro.jpa.content.EntityDaoContentIterator< E, ID >.

Definition at line 245 of file ForumContentIterator.java.

245  {
246  String path = getContextPath();
247  if(Strings.isBlank(path)) {
248  path = ElephantContext.getEntityWebContext("/forum");
249  }
250  if(Strings.isBlank(path)) {
251  return getRestrictedLink();
252  }
253  return path;
254  }
Here is the call graph for this function:

◆ getRestrictedLink()

String org.turro.forum.content.ForumContentIterator.getRestrictedLink ( )
protected

Reimplemented from org.turro.jpa.content.EntityDaoContentIterator< E, ID >.

Definition at line 257 of file ForumContentIterator.java.

257  {
258  return "/user/forums";
259  }
Here is the caller graph for this function:

◆ getTemplateRoot()

String org.turro.forum.content.ForumContentIterator.getTemplateRoot ( )
protected

Reimplemented from org.turro.jpa.content.EntityDaoContentIterator< E, ID >.

Definition at line 200 of file ForumContentIterator.java.

200  {
201  return isMail() ? "content/newsletter/sections/forums" : "forum";
202  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWhereClause()

WhereClause org.turro.forum.content.ForumContentIterator.getWhereClause ( )
protected

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

Definition at line 62 of file ForumContentIterator.java.

62  {
63  WhereClause wc = new WhereClause();
64  wc.addClause("select distinct topic from Topic as topic");
65  wc.addClause("left join Post as post");
66  wc.addClause("on post.uniquePath like concat(topic.uniquePath, '%')");
67  addCriteria(wc);
68  wc.addClause("order by topic.creation desc");
69  return wc;
70  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.forum.content.ForumContentIterator.metas ( Topic  e)
protected

Definition at line 185 of file ForumContentIterator.java.

185  {
186  ArrayList<RepositoryFile> files = new ArrayList<>();
187  String path = getItemLink(e);
188 // if(!SocialImageMap.hasImage(path)) {
189 // FileAttach fa = new FileAttach(StudentsPU.getObjectPath(e));
190 // Repository repository = fa.getPublishableRepository(constructor);
191 // files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
192 // files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
193 // }
194  SocialNet sn;
195  sn = new SocialNet(path, Strings.truncateAndWarn(e.getText(), 100), e.getText(), files);
196  return sn.getMetas();
197  }
Here is the call graph for this function:

◆ renderForbidden()

void org.turro.forum.content.ForumContentIterator.renderForbidden ( ElephantMarker  marker,
int  page 
)
protected

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

Definition at line 100 of file ForumContentIterator.java.

Here is the call graph for this function:

◆ renderItem()

void org.turro.forum.content.ForumContentIterator.renderItem ( ElephantMarker  marker,
Topic  e,
int  page 
)
protected

Definition at line 92 of file ForumContentIterator.java.

92  {
93  marker.put("topic", e);
94  prepareValues(e, page);
96  Forums.markAsSeenFor(e, getContact());
97  }
Here is the call graph for this function:

◆ renderSummary()

void org.turro.forum.content.ForumContentIterator.renderSummary ( ElephantMarker  marker,
Topic  e,
int  page 
)
protected

Definition at line 83 of file ForumContentIterator.java.

83  {
84  if(e != null) {
85  marker.put("topic", e);
86  prepareValues(e, page);
87  }
89  }
Here is the call graph for this function:

◆ setSince()

void org.turro.forum.content.ForumContentIterator.setSince ( Date  since)

Definition at line 57 of file ForumContentIterator.java.

57  {
58  this.since = since;
59  }
Here is the caller graph for this function:

◆ title()

String org.turro.forum.content.ForumContentIterator.title ( Topic  e)
protected

Definition at line 177 of file ForumContentIterator.java.

177  {
178  if(!Strings.isBlank(e.getText())) {
179  return Strings.truncateAndWarn(e.getText(), 100);
180  }
181  return null;
182  }
Here is the call graph for this function:

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