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

Public Member Functions

 PracticalWorkContentIterator (IConstructor constructor, Writer writer, IContact contact, boolean mail, String pubPath)
 
boolean isWithDate ()
 
void setWithDate (boolean withDate)
 
boolean isActive ()
 
void setActive (boolean active)
 
boolean isLastEntries ()
 
void setLastEntries (boolean lastEntries)
 
PracticalWorkRole getRole ()
 
void setRole (PracticalWorkRole role)
 
String getType ()
 
void setType (String type)
 
boolean isInBusiness (PracticalWork practicalWork, IContact contact)
 
- 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, PracticalWork e, int page)
 
void renderItem (ElephantMarker marker, PracticalWork e, int page)
 
String entityRoot ()
 
PracticalWork entity (Long value)
 
boolean isValid (PracticalWork e)
 
String title (PracticalWork e)
 
Collection< String > metas (PracticalWork e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (PracticalWork e)
 
Object doInterestCtrl (PracticalWork e)
 
Object doCommentsCtrl (PracticalWork e)
 
Object doAttachmentsCtrl (PracticalWork e)
 
Object doFilesCtrl (PracticalWork e)
 
Object doDescriptionsCtrl (PracticalWork e)
 
Object doPollsCtrl (PracticalWork e)
 
String getItemLink (PracticalWork 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)
 
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 62 of file PracticalWorkContentIterator.java.

Constructor & Destructor Documentation

◆ PracticalWorkContentIterator()

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

Definition at line 70 of file PracticalWorkContentIterator.java.

70  {
71  super(new StudentsPU(), constructor, writer, contact, mail, pubPath);
72  all = Application.getApplication().isInRole("contact:all");
73  allowQuestion = PracticalWorkContext.getAllowQuestion(constructor);
74  }
Here is the call graph for this function:

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doAttachmentsCtrl ( PracticalWork  e)
protected

Definition at line 302 of file PracticalWorkContentIterator.java.

302  {
303  return Entities.getController(e).configureCtrl(
304  new AttachCtrl(constructor), getContact());
305  }
Here is the call graph for this function:

◆ doCommentsCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doCommentsCtrl ( PracticalWork  e)
protected

Definition at line 296 of file PracticalWorkContentIterator.java.

296  {
297  return Entities.getController(e).configureCtrl(
298  new CommentItCtrl(constructor), getContact());
299  }
Here is the call graph for this function:

◆ doDescriptionsCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doDescriptionsCtrl ( PracticalWork  e)
protected

Definition at line 314 of file PracticalWorkContentIterator.java.

314  {
315  return Entities.getController(e).configureCtrl(
316  new DescribeItCtrl(constructor), getContact());
317  }
Here is the call graph for this function:

◆ doFilesCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doFilesCtrl ( PracticalWork  e)
protected

Definition at line 308 of file PracticalWorkContentIterator.java.

308  {
309  return Entities.getController(e).configureCtrl(
310  new FileAttach(ContactsPU.getObjectPath(e)), getContact());
311  }
Here is the call graph for this function:

◆ doInterestCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doInterestCtrl ( PracticalWork  e)
protected

Definition at line 290 of file PracticalWorkContentIterator.java.

290  {
291  return Entities.getController(e).configureCtrl(
292  new StarItCtrl(constructor), getContact());
293  }
Here is the call graph for this function:

◆ doPollsCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doPollsCtrl ( PracticalWork  e)
protected

Definition at line 320 of file PracticalWorkContentIterator.java.

320  {
321  return Entities.getController(e).configureCtrl(
322  new PollsCtrl(constructor), getContact());
323  }
Here is the call graph for this function:

◆ doVotesCtrl()

Object org.turro.students.content.PracticalWorkContentIterator.doVotesCtrl ( PracticalWork  e)
protected

Definition at line 284 of file PracticalWorkContentIterator.java.

284  {
285  return Entities.getController(e).configureCtrl(
286  new VoteItCtrl(constructor), getContact());
287  }
Here is the call graph for this function:

◆ entity()

PracticalWork org.turro.students.content.PracticalWorkContentIterator.entity ( Long  value)
protected

Definition at line 175 of file PracticalWorkContentIterator.java.

175  {
176  WhereClause wc = new WhereClause();
177  wc.addClause("select distinct practicalwork from PracticalWork as practicalwork");
178  addCriteria(wc);
179  wc.addClause("and practicalwork.id = :id");
180  wc.addNamedValue("id", value);
181  return (PracticalWork) dao.getSingleResultOrNull(wc);
182  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

String org.turro.students.content.PracticalWorkContentIterator.entityRoot ( )
protected

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

Definition at line 170 of file PracticalWorkContentIterator.java.

170  {
171  return "practicalwork";
172  }

◆ getCountClause()

WhereClause org.turro.students.content.PracticalWorkContentIterator.getCountClause ( )
protected

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

Definition at line 146 of file PracticalWorkContentIterator.java.

146  {
147  WhereClause wc = new WhereClause();
148  wc.addClause("select count(distinct practicalwork) from PracticalWork as practicalwork");
149  addCriteria(wc);
150  return wc;
151  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.students.content.PracticalWorkContentIterator.getItemLink ( PracticalWork  e)
protected

Definition at line 326 of file PracticalWorkContentIterator.java.

326  {
327  return doItemLink(e, e.getId(), true);
328  }
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.students.content.PracticalWorkContentIterator.getReadAllLink ( )
protected

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

Definition at line 331 of file PracticalWorkContentIterator.java.

331  {
332  String path = getContextPath();
333  if(Strings.isBlank(path)) {
334  path = ElephantContext.getEntityWebContext("/practicalwork");
335  }
336  if(Strings.isBlank(path)) {
337  return getRestrictedLink();
338  }
339  return path;
340  }
Here is the call graph for this function:

◆ getRestrictedLink()

String org.turro.students.content.PracticalWorkContentIterator.getRestrictedLink ( )
protected

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

Definition at line 343 of file PracticalWorkContentIterator.java.

343  {
344  return "/user/mypracticalworks";
345  }
Here is the caller graph for this function:

◆ getRole()

PracticalWorkRole org.turro.students.content.PracticalWorkContentIterator.getRole ( )

Definition at line 100 of file PracticalWorkContentIterator.java.

100  {
101  return role;
102  }

◆ getTemplateRoot()

String org.turro.students.content.PracticalWorkContentIterator.getTemplateRoot ( )
protected

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

Definition at line 279 of file PracticalWorkContentIterator.java.

279  {
280  return isMail() ? "content/newsletter/sections/practicalworks" : "practicalwork";
281  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getType()

String org.turro.students.content.PracticalWorkContentIterator.getType ( )

Definition at line 108 of file PracticalWorkContentIterator.java.

108  {
109  return type;
110  }

◆ getWhereClause()

WhereClause org.turro.students.content.PracticalWorkContentIterator.getWhereClause ( )
protected

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

Definition at line 122 of file PracticalWorkContentIterator.java.

122  {
123  WhereClause wc = new WhereClause();
124  wc.addClause("select distinct practicalwork from PracticalWork as practicalwork");
125  if(withDate) {
126  addCriteria(wc);
127  wc.addClause("order by practicalwork.startDate desc, practicalwork.title");
128  } else if(lastEntries) {
129  addCriteria(wc);
130  wc.addClause("order by practicalwork.creation desc, practicalwork.title");
131  } else {
132  wc = Statistics.load(constructor, "PracticalWorkRanking", "PracticalWorkContactMatching", wc)
133  .allowMatching(isAllowMatching())
134  .allowRanking(isAllowRanking())
135  .doMatching(isDoMatching())
136  .setContact(getContact())
137  .setEntityFields("practicalwork", "id")
138  .setDefaultSorting("practicalwork.title")
139  .onCriteria(w -> addCriteria(w))
140  .getClause();
141  }
142  return wc;
143  }
Here is the call graph for this function:

◆ isActive()

boolean org.turro.students.content.PracticalWorkContentIterator.isActive ( )

Definition at line 84 of file PracticalWorkContentIterator.java.

84  {
85  return active;
86  }

◆ isInBusiness()

boolean org.turro.students.content.PracticalWorkContentIterator.isInBusiness ( PracticalWork  practicalWork,
IContact  contact 
)

Definition at line 116 of file PracticalWorkContentIterator.java.

116  {
117  return all || practicalWork.getIContact().isInBusiness(contact) ||
118  (PracticalWorkContext.getAllowSingle() && practicalWork.getIContact().getId().equals(contact.getId()));
119  }
Here is the call graph for this function:

◆ isLastEntries()

boolean org.turro.students.content.PracticalWorkContentIterator.isLastEntries ( )

Definition at line 92 of file PracticalWorkContentIterator.java.

92  {
93  return lastEntries;
94  }

◆ isValid()

boolean org.turro.students.content.PracticalWorkContentIterator.isValid ( PracticalWork  e)
protected

Definition at line 246 of file PracticalWorkContentIterator.java.

246  {
247  return super.isValid(e);
248  }

◆ isWithDate()

boolean org.turro.students.content.PracticalWorkContentIterator.isWithDate ( )

Definition at line 76 of file PracticalWorkContentIterator.java.

76  {
77  return withDate;
78  }

◆ metas()

Collection<String> org.turro.students.content.PracticalWorkContentIterator.metas ( PracticalWork  e)
protected

Definition at line 264 of file PracticalWorkContentIterator.java.

264  {
265  ArrayList<RepositoryFile> files = new ArrayList<>();
266  String path = getItemLink(e);
267  if(!SocialImageMap.hasImage(path)) {
268  FileAttach fa = new FileAttach(ContactsPU.getObjectPath(e));
269  Repository repository = fa.getPublishableRepository(constructor);
270  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
271  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
272  }
273  SocialNet sn;
274  sn = new SocialNet(path, e.getTitle(), e.getText(), files);
275  return sn.getMetas();
276  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.students.content.PracticalWorkContentIterator.renderItem ( ElephantMarker  marker,
PracticalWork  e,
int  page 
)
protected

Definition at line 163 of file PracticalWorkContentIterator.java.

163  {
164  marker.put("practicalWork", e);
165  prepareValues(e, page);
167  }
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Here is the call graph for this function:

◆ renderSummary()

void org.turro.students.content.PracticalWorkContentIterator.renderSummary ( ElephantMarker  marker,
PracticalWork  e,
int  page 
)
protected

Definition at line 154 of file PracticalWorkContentIterator.java.

154  {
155  if(e != null) {
156  marker.put("practicalWork", e);
157  prepareValues(e, page);
158  }
160  }
Here is the call graph for this function:

◆ setActive()

void org.turro.students.content.PracticalWorkContentIterator.setActive ( boolean  active)

Definition at line 88 of file PracticalWorkContentIterator.java.

88  {
89  this.active = active;
90  }

◆ setLastEntries()

void org.turro.students.content.PracticalWorkContentIterator.setLastEntries ( boolean  lastEntries)

Definition at line 96 of file PracticalWorkContentIterator.java.

96  {
97  this.lastEntries = lastEntries;
98  }
Here is the caller graph for this function:

◆ setRole()

void org.turro.students.content.PracticalWorkContentIterator.setRole ( PracticalWorkRole  role)

Definition at line 104 of file PracticalWorkContentIterator.java.

104  {
105  this.role = role;
106  }
Here is the caller graph for this function:

◆ setType()

void org.turro.students.content.PracticalWorkContentIterator.setType ( String  type)

Definition at line 112 of file PracticalWorkContentIterator.java.

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

◆ setWithDate()

void org.turro.students.content.PracticalWorkContentIterator.setWithDate ( boolean  withDate)

Definition at line 80 of file PracticalWorkContentIterator.java.

80  {
81  this.withDate = withDate;
82  }

◆ title()

String org.turro.students.content.PracticalWorkContentIterator.title ( PracticalWork  e)
protected

Definition at line 256 of file PracticalWorkContentIterator.java.

256  {
257  if(!Strings.isBlank(e.getTitle())) {
258  return e.getTitle();
259  }
260  return null;
261  }
Here is the call graph for this function:

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