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

Public Member Functions

 ChallengeContentIterator (IConstructor constructor, Writer writer, IContact contact, boolean mail, String pubPath)
 
String getChallengeUrl (WsMember member, AxChallenge challenge)
 
- 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, AxChallenge e, int page)
 
void renderItem (ElephantMarker marker, AxChallenge e, int page)
 
String entityRoot ()
 
AxChallenge entity (ProcedenceId value)
 
ProcedenceId getIdentifier ()
 
String title (AxChallenge e)
 
Collection< String > metas (AxChallenge e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (AxChallenge e)
 
Object doInterestCtrl (AxChallenge e)
 
Object doCommentsCtrl (AxChallenge e)
 
Object doAttachmentsCtrl (AxChallenge e)
 
Object doFilesCtrl (AxChallenge e)
 
Object doDescriptionsCtrl (AxChallenge e)
 
Object doPollsCtrl (AxChallenge e)
 
String getItemLink (AxChallenge challenge)
 
String getReadAllLink ()
 
String getRestrictedLink ()
 
String stringId (ProcedenceId value)
 
ProcedenceId parseId (String value)
 
- 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)
 
void renderForbidden (ElephantMarker marker, int page)
 
ID getIDFromURL (String root)
 
void preload ()
 
boolean isValid (E e)
 
boolean canShow (E e)
 
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

Constructor & Destructor Documentation

◆ ChallengeContentIterator()

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

Definition at line 56 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

56  {
57  super(new AlliancePU(), constructor, writer, contact, mail, pubPath);
58  }

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doAttachmentsCtrl ( AxChallenge  e)
protected

Definition at line 220 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

220  {
221  return null;
222  }

◆ doCommentsCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doCommentsCtrl ( AxChallenge  e)
protected

Definition at line 215 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

215  {
216  return null;
217  }

◆ doDescriptionsCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doDescriptionsCtrl ( AxChallenge  e)
protected

Definition at line 230 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

230  {
231  return null;
232  }

◆ doFilesCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doFilesCtrl ( AxChallenge  e)
protected

Definition at line 225 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

225  {
226  return null;
227  }

◆ doInterestCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doInterestCtrl ( AxChallenge  e)
protected

Definition at line 210 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

210  {
211  return null;
212  }

◆ doPollsCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doPollsCtrl ( AxChallenge  e)
protected

Definition at line 235 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

235  {
236  return null;
237  }

◆ doVotesCtrl()

Object org.turro.alliance.content.ChallengeContentIterator.doVotesCtrl ( AxChallenge  e)
protected

Definition at line 205 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

205  {
206  return null;
207  }

◆ entity()

AxChallenge org.turro.alliance.content.ChallengeContentIterator.entity ( ProcedenceId  value)
protected

Definition at line 130 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

130  {
131  WhereClause wc = new WhereClause();
132  wc.addClause("select distinct challenge from AxChallenge as challenge");
133  wc.addClause("join AxTalentCategory as category on challenge.categoryId = category.categoryId");
134  wc.addClause("left outer join challenge.responses response");
135  wc.addClause("where 1=1");
136  addCriteria(wc, true);
137  wc.addClause("and challenge.challengeId = :id");
138  wc.addNamedValue("id", value);
139  return (AxChallenge) dao.getSingleResultOrNull(wc);
140  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

String org.turro.alliance.content.ChallengeContentIterator.entityRoot ( )
protected

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

Definition at line 125 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

125  {
126  return "axchallenge";
127  }

◆ getChallengeUrl()

String org.turro.alliance.content.ChallengeContentIterator.getChallengeUrl ( WsMember  member,
AxChallenge  challenge 
)

Definition at line 60 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

60  {
61  if(ObjectUtils.allNotNull(member, challenge)) {
62  if(member.getMemberId() == challenge.getChallengeId().getMemberId()) {
63  return Interceptors.parameters("challenge", challenge.getChallengeId().getEntityId())
64  .url(member.getMemberUrl())
65  .encoded();
66  } else {
67  return Interceptors.parameters("axchallenge", challenge.getId().replaceAll("#", "_"))
68  .add("server", ElephantContext.getSiteForcedDomain())
69  .url(member.getMemberUrl())
70  .encoded();
71  }
72  }
73  return "#";
74  }
Here is the call graph for this function:

◆ getCountClause()

WhereClause org.turro.alliance.content.ChallengeContentIterator.getCountClause ( )
protected

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

Definition at line 89 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

89  {
90  WhereClause wc = new WhereClause();
91  wc.addClause("select count(distinct challenge) from AxChallenge as challenge");
92  wc.addClause("join AxTalentCategory as category on challenge.categoryId = category.categoryId");
93  wc.addClause("left outer join challenge.responses response");
94  wc.addClause("where 1=1");
95  addCriteria(wc, true);
96  wc.addClause("order by challenge.creation desc");
97  return wc;
98  }
Here is the call graph for this function:

◆ getIdentifier()

ProcedenceId org.turro.alliance.content.ChallengeContentIterator.getIdentifier ( )
protected

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

Definition at line 143 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

143  {
144  ProcedenceId identifier = getIDFromURL("/axchallenge");
145  if(identifier == null) {
146  identifier = super.getIdentifier();
147  }
148  return identifier;
149  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.alliance.content.ChallengeContentIterator.getItemLink ( AxChallenge  challenge)
protected

Definition at line 240 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

240  {
241  return doItemLink(challenge, challenge.getChallengeId(), 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.alliance.content.ChallengeContentIterator.getReadAllLink ( )
protected

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

Definition at line 245 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

245  {
246  String path = getContextPath();
247  if(Strings.isBlank(path)) {
248  path = ElephantContext.getEntityWebContext("/axchallenge");
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.alliance.content.ChallengeContentIterator.getRestrictedLink ( )
protected

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

Definition at line 257 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

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

◆ getTemplateRoot()

String org.turro.alliance.content.ChallengeContentIterator.getTemplateRoot ( )
protected

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

Definition at line 200 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

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

◆ getWhereClause()

WhereClause org.turro.alliance.content.ChallengeContentIterator.getWhereClause ( )
protected

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

Definition at line 77 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

77  {
78  WhereClause wc = new WhereClause();
79  wc.addClause("select distinct challenge from AxChallenge as challenge");
80  wc.addClause("join AxTalentCategory as category on challenge.categoryId = category.categoryId");
81  wc.addClause("left outer join challenge.responses response");
82  wc.addClause("where 1=1");
83  addCriteria(wc, true);
84  wc.addClause("order by challenge.creation desc");
85  return wc;
86  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.alliance.content.ChallengeContentIterator.metas ( AxChallenge  e)
protected

Definition at line 186 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

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

◆ parseId()

ProcedenceId org.turro.alliance.content.ChallengeContentIterator.parseId ( String  value)
protected

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

Definition at line 267 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

267  {
268  return ProcedenceId.from(value);
269  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.alliance.content.ChallengeContentIterator.renderItem ( ElephantMarker  marker,
AxChallenge  e,
int  page 
)
protected

◆ renderSummary()

void org.turro.alliance.content.ChallengeContentIterator.renderSummary ( ElephantMarker  marker,
AxChallenge  e,
int  page 
)
protected

Definition at line 101 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

101  {
102  if(e != null) {
103  marker.put("challenge", e);
104  if(e.getCategory() != null) {
105  marker.put("newCategory", e.getCategory().getCategoryId() != lastCategoryId);
106  lastCategoryId = e.getCategory().getCategoryId();
107  } else {
108  lastCategoryId = 0;
109  }
110  prepareValues(e, page);
111  marker.put("restricted", isRestricted());
112  }
114  }
Here is the call graph for this function:

◆ stringId()

String org.turro.alliance.content.ChallengeContentIterator.stringId ( ProcedenceId  value)
protected

Definition at line 262 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

262  {
263  return value.stringify();
264  }
Here is the call graph for this function:

◆ title()

String org.turro.alliance.content.ChallengeContentIterator.title ( AxChallenge  e)
protected

Definition at line 178 of file elephant-alliance/src/main/java/org/turro/alliance/content/ChallengeContentIterator.java.

178  {
179  if(!Strings.isBlank(e.getName())) {
180  return e.getName();
181  }
182  return null;
183  }
Here is the call graph for this function:

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