BrightSide Workbench Full Report + Source Code
org.turro.jpa.content.EntityDaoContentIterator< E, ID > Class Template Referenceabstract
Inheritance diagram for org.turro.jpa.content.EntityDaoContentIterator< E, ID >:
Collaboration diagram for org.turro.jpa.content.EntityDaoContentIterator< E, ID >:

Public Member Functions

 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

void prepareControls (E entity, int page)
 
String doItemLink (E entity, ID id, boolean obfuscated)
 
abstract String getTemplateRoot ()
 
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)
 
abstract String getReadAllLink ()
 
abstract String getRestrictedLink ()
 
- Protected Member Functions inherited from org.turro.jpa.iterator.DaoHtmlIterator< E, ID >
VisualElements loadVisuals ()
 
abstract String entityRoot ()
 
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 ()
 
abstract WhereClause getWhereClause ()
 
abstract WhereClause getCountClause ()
 

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 44 of file EntityDaoContentIterator.java.

Constructor & Destructor Documentation

◆ EntityDaoContentIterator()

org.turro.jpa.content.EntityDaoContentIterator< E, ID >.EntityDaoContentIterator ( Dao  dao,
IConstructor  constructor,
Writer  writer,
IContact  contact,
boolean  mail,
String  contextPath 
)

Definition at line 51 of file EntityDaoContentIterator.java.

52  {
53  super(dao, new ElephantMarker(constructor, mail), writer);
54  this.contextPath = Optional.ofNullable(contextPath)
55  .orElse(
56  Optional.ofNullable(constructor)
57  .map(cons -> cons.getCurrentContext())
58  .map(ctx -> ctx.getFullPath())
59  .filter(path -> !path.endsWith("/user"))
60  .orElse(null)
61  );
62  this.contact = contact;
63  this.mail = mail;
64  }

Member Function Documentation

◆ assignDefaultsByMacro()

void org.turro.jpa.content.EntityDaoContentIterator< E, ID >.assignDefaultsByMacro ( MacroProcessorContext  context)

Definition at line 166 of file EntityDaoContentIterator.java.

166  {
167  setPage(context.getPage());
168  setNavigatorTop(context.isNavigation());
169  setNavigatorBottom(context.isNavigation());
170  setAllowRanking(context.isRanking());
171  setAllowMatching(context.isMatching());
172  setRestricted(context.isRestricted());
173  setSummaryTemplate(context.getTemplate());
174  }
void setNavigatorBottom(boolean navigatorBottom)
void setAllowMatching(boolean allowMatching)
void setSummaryTemplate(String summaryTemplate)
void setNavigatorTop(boolean navigatorTop)
void setAllowRanking(boolean allowRanking)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignDefaultsByName()

void org.turro.jpa.content.EntityDaoContentIterator< E, ID >.assignDefaultsByName ( String  name)

Definition at line 157 of file EntityDaoContentIterator.java.

157  {
158  if(name.contains("summary")) {
159  setNavigatorTop(false);
160  setNavigatorBottom(false);
161  }
162  setAllowRanking(name.contains("ranking"));
163  setRestricted(name.contains("restricted"));
164  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doAttachmentsCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doAttachmentsCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doCommentsCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doCommentsCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doDescriptionsCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doDescriptionsCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doFilesCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doFilesCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doInterestCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doInterestCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doItemLink()

String org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doItemLink ( entity,
ID  id,
boolean  obfuscated 
)
protected

Definition at line 234 of file EntityDaoContentIterator.java.

234  {
235  String ewu = EntityWebUrls.getUrlFromEntity(entity);
236  if(ewu != null) {
237  return getReadAllLink() + ewu;
238  } else {
239  if(obfuscated) {
240  return getReadAllLink() + "?" + MarkerHelper.setObfuscatedPars("item=" + stringId(id));
241  } else {
242  return getReadAllLink() + "?item=" + stringId(id);
243  }
244  }
245  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doPollsCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doPollsCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ doVotesCtrl()

abstract Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.doVotesCtrl ( e)
abstractprotected
Here is the caller graph for this function:

◆ getApplyCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getApplyCtrl ( e)

Definition at line 198 of file EntityDaoContentIterator.java.

198  {
199  return getParticipationCtrl(e, ParticipationReason.REASON_APPLY);
200  }
Object getParticipationCtrl(E e, ParticipationReason reason)
Here is the call graph for this function:

◆ getAttachmentsCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getAttachmentsCtrl ( e)

Definition at line 112 of file EntityDaoContentIterator.java.

112  {
113  if(isAllowAttachments()) {
114  return doAttachmentsCtrl(e);
115  }
116  return null;
117  }
Here is the call graph for this function:

◆ getCommentsCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getCommentsCtrl ( e)

Definition at line 105 of file EntityDaoContentIterator.java.

105  {
106  if(isAllowComments()) {
107  return doCommentsCtrl(e);
108  }
109  return null;
110  }
Here is the call graph for this function:

◆ getContact()

Definition at line 83 of file EntityDaoContentIterator.java.

83  {
84  return contact;
85  }
Here is the caller graph for this function:

◆ getContextPath()

String org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getContextPath ( )

Definition at line 79 of file EntityDaoContentIterator.java.

79  {
80  return contextPath;
81  }
Here is the caller graph for this function:

◆ getCtrlByLabel()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getCtrlByLabel ( String  ctrl,
e,
IContact  contact 
)

Definition at line 202 of file EntityDaoContentIterator.java.

202  {
203  IEntityCtrl ec = Plugins.loadImplementation(IEntityCtrl.class, ctrl);
204  if(ec != null) {
205  IElephantEntity iee = Entities.getController(e);
206  if(!Strings.isBlank(iee.getPath())) {
207  ec.setConstructor(constructor);
208  ec.setEntityPath(iee.getPath());
209  return iee.configureCtrl(ec, contact);
210  }
211  }
212  return null;
213  }
Here is the call graph for this function:

◆ getDescriptionsCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getDescriptionsCtrl ( e)

Definition at line 126 of file EntityDaoContentIterator.java.

126  {
127  if(isAllowDescriptions()) {
128  return doDescriptionsCtrl(e);
129  }
130  return null;
131  }
Here is the call graph for this function:

◆ getFilesCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getFilesCtrl ( e)

Definition at line 119 of file EntityDaoContentIterator.java.

119  {
120  if(isAllowFiles()) {
121  return doFilesCtrl(e);
122  }
123  return null;
124  }
Here is the call graph for this function:

◆ getFollowCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getFollowCtrl ( e)

Definition at line 186 of file EntityDaoContentIterator.java.

186  {
187  return getParticipationCtrl(e, ParticipationReason.REASON_FOLLOW);
188  }
Here is the call graph for this function:

◆ getForumCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getForumCtrl ( e)

Definition at line 140 of file EntityDaoContentIterator.java.

140  {
141  if(isAllowForum()) {
142  IEntityCtrl ecf = Plugins.loadImplementation(IEntityCtrl.class, "forum-ctrl");
143  if(ecf != null) {
144  IElephantEntity iee = Entities.getController(e);
145  ecf.setConstructor(constructor);
146  ecf.setEntityPath(iee.getPath());
147  ecf.setTemplate("related");
148  marker.put("forum", ecf);
149  return iee.configureCtrl(iee, getContact());
150  }
151  }
152  return null;
153  }
Object put(Object key, Object value)
Here is the call graph for this function:

◆ getId()

Definition at line 74 of file EntityDaoContentIterator.java.

74  {
75  int hash = Paths.get(contextPath).hashCode();
76  return "UID_" + (hash < 0 ? -hash : hash);
77  }

◆ getInterestCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getInterestCtrl ( e)

Definition at line 98 of file EntityDaoContentIterator.java.

98  {
99  if(isAllowInterest()) {
100  return doInterestCtrl(e);
101  }
102  return null;
103  }
Here is the call graph for this function:

◆ getItemLink()

abstract String org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getItemLink ( e)
abstractprotected
Here is the caller graph for this function:

◆ getLikeCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getLikeCtrl ( e)

Definition at line 194 of file EntityDaoContentIterator.java.

194  {
195  return getParticipationCtrl(e, ParticipationReason.REASON_LIKE);
196  }
Here is the call graph for this function:

◆ getParticipationCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getParticipationCtrl ( e,
ParticipationReason  reason 
)

Definition at line 178 of file EntityDaoContentIterator.java.

178  {
179  return Entities.getController(e).getParticipationControl(constructor, contact, reason);
180  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPollsCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getPollsCtrl ( e)

Definition at line 133 of file EntityDaoContentIterator.java.

133  {
134  if(isAllowPolls()) {
135  return doPollsCtrl(e);
136  }
137  return null;
138  }
Here is the call graph for this function:

◆ getReadAllLink()

◆ getRestrictedLink()

◆ getSeenCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getSeenCtrl ( e)

Definition at line 190 of file EntityDaoContentIterator.java.

190  {
191  return getParticipationCtrl(e, ParticipationReason.REASON_SEEN);
192  }
Here is the call graph for this function:

◆ getSeenStatus()

Definition at line 70 of file EntityDaoContentIterator.java.

70  {
71  return seenStatus;
72  }

◆ getSpamCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getSpamCtrl ( e)

Definition at line 182 of file EntityDaoContentIterator.java.

182  {
183  return getParticipationCtrl(e, ParticipationReason.REASON_SPAM);
184  }
Here is the call graph for this function:

◆ getTemplateRoot()

◆ getVotesCtrl()

Object org.turro.jpa.content.EntityDaoContentIterator< E, ID >.getVotesCtrl ( e)

Definition at line 91 of file EntityDaoContentIterator.java.

91  {
92  if(isAllowVotes()) {
93  return doVotesCtrl(e);
94  }
95  return null;
96  }
Here is the call graph for this function:

◆ isMail()

Definition at line 87 of file EntityDaoContentIterator.java.

87  {
88  return mail;
89  }
Here is the caller graph for this function:

◆ prepareControls()

void org.turro.jpa.content.EntityDaoContentIterator< E, ID >.prepareControls ( entity,
int  page 
)
protected

Definition at line 215 of file EntityDaoContentIterator.java.

215  {
216  marker.put("entiter", this);
217  if(!marker.contains("iee")) {
218  IElephantEntity iee = Entities.getController(entity);
219  if(!(iee instanceof EmptyController)) {
220  marker.put("iee", iee);
221  }
222  }
223  if(isMail()) {
224  marker.put("itemLink", "{liveref:" + getItemLink(entity) + "}");
225  marker.put("allLink", "{liveref:" + getReadAllLink() + "}");
226  marker.put("restrictedLink", "{liveref:" + getRestrictedLink() + "}");
227  } else {
228  marker.put("itemLink", getItemLink(entity));
229  marker.put("allLink", getReadAllLink());
230  marker.put("restrictedLink", getRestrictedLink());
231  }
232  }
Here is the call graph for this function:

◆ setSeenStatus()

void org.turro.jpa.content.EntityDaoContentIterator< E, ID >.setSeenStatus ( SeenStatusCheck  seenStatus)

Definition at line 66 of file EntityDaoContentIterator.java.

66  {
67  this.seenStatus = seenStatus;
68  }
Here is the caller graph for this function:

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