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

Public Member Functions

 ContactServiceContentIterator (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)
 
ContactServiceRole getRole ()
 
void setRole (ContactServiceRole role)
 
String getType ()
 
void setType (String type)
 
boolean isInBusiness (ContactService service, 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

void preload ()
 
WhereClause getWhereClause ()
 
WhereClause getCountClause ()
 
void renderSummary (ElephantMarker marker, ContactService e, int page)
 
void renderItem (ElephantMarker marker, ContactService e, int page)
 
String entityRoot ()
 
ContactService entity (String value)
 
boolean isValid (ContactService e)
 
String title (ContactService e)
 
Collection< String > metas (ContactService e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (ContactService e)
 
Object doInterestCtrl (ContactService e)
 
Object doCommentsCtrl (ContactService e)
 
Object doAttachmentsCtrl (ContactService e)
 
Object doFilesCtrl (ContactService e)
 
Object doDescriptionsCtrl (ContactService e)
 
Object doPollsCtrl (ContactService e)
 
String getItemLink (ContactService 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 ()
 
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 59 of file ContactServiceContentIterator.java.

Constructor & Destructor Documentation

◆ ContactServiceContentIterator()

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

Definition at line 67 of file ContactServiceContentIterator.java.

67  {
68  super(new ContactsPU(), constructor, writer, contact, mail, pubPath);
69  all = Application.getApplication().isInRole("contact:all");
70  allowQuestion = ServiceContext.getAllowQuestion(constructor);
71  }
Here is the call graph for this function:

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doAttachmentsCtrl ( ContactService  e)
protected

Definition at line 309 of file ContactServiceContentIterator.java.

309  {
310  return Entities.getController(e).configureCtrl(
311  new AttachCtrl(constructor), getContact());
312  }
Here is the call graph for this function:

◆ doCommentsCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doCommentsCtrl ( ContactService  e)
protected

Definition at line 303 of file ContactServiceContentIterator.java.

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

◆ doDescriptionsCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doDescriptionsCtrl ( ContactService  e)
protected

Definition at line 321 of file ContactServiceContentIterator.java.

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

◆ doFilesCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doFilesCtrl ( ContactService  e)
protected

Definition at line 315 of file ContactServiceContentIterator.java.

315  {
316  return Entities.getController(e).configureCtrl(
317  new FileAttach(ContactsPU.getObjectPath(e)), getContact());
318  }
Here is the call graph for this function:

◆ doInterestCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doInterestCtrl ( ContactService  e)
protected

Definition at line 297 of file ContactServiceContentIterator.java.

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

◆ doPollsCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doPollsCtrl ( ContactService  e)
protected

Definition at line 327 of file ContactServiceContentIterator.java.

327  {
328  return Entities.getController(e).configureCtrl(
329  new PollsCtrl(constructor), getContact());
330  }
Here is the call graph for this function:

◆ doVotesCtrl()

Object org.turro.contacts.content.ContactServiceContentIterator.doVotesCtrl ( ContactService  e)
protected

Definition at line 291 of file ContactServiceContentIterator.java.

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

◆ entity()

ContactService org.turro.contacts.content.ContactServiceContentIterator.entity ( String  value)
protected

Definition at line 185 of file ContactServiceContentIterator.java.

185  {
186  WhereClause wc = new WhereClause();
187  wc.addClause("select distinct service from ContactService as service");
188  addCriteria(wc);
189  wc.addClause("and service.id = :id");
190  wc.addNamedValue("id", value);
191  return (ContactService) dao.getSingleResultOrNull(wc);
192  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

String org.turro.contacts.content.ContactServiceContentIterator.entityRoot ( )
protected

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

Definition at line 180 of file ContactServiceContentIterator.java.

180  {
181  return "service";
182  }

◆ getCountClause()

WhereClause org.turro.contacts.content.ContactServiceContentIterator.getCountClause ( )
protected

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

Definition at line 156 of file ContactServiceContentIterator.java.

156  {
157  WhereClause wc = new WhereClause();
158  wc.addClause("select count(distinct service) from ContactService as service");
159  addCriteria(wc);
160  return wc;
161  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.contacts.content.ContactServiceContentIterator.getItemLink ( ContactService  e)
protected

Definition at line 333 of file ContactServiceContentIterator.java.

333  {
334  return doItemLink(e, e.getId(), true);
335  }
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.contacts.content.ContactServiceContentIterator.getReadAllLink ( )
protected

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

Definition at line 338 of file ContactServiceContentIterator.java.

338  {
339  String path = getContextPath();
340  if(Strings.isBlank(path)) {
341  path = ElephantContext.getEntityWebContext("/service");
342  }
343  if(Strings.isBlank(path)) {
344  return getRestrictedLink();
345  }
346  return path;
347  }
Here is the call graph for this function:

◆ getRestrictedLink()

String org.turro.contacts.content.ContactServiceContentIterator.getRestrictedLink ( )
protected

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

Definition at line 350 of file ContactServiceContentIterator.java.

350  {
351  return "/user/services";
352  }
Here is the caller graph for this function:

◆ getRole()

ContactServiceRole org.turro.contacts.content.ContactServiceContentIterator.getRole ( )

Definition at line 97 of file ContactServiceContentIterator.java.

97  {
98  return role;
99  }

◆ getTemplateRoot()

String org.turro.contacts.content.ContactServiceContentIterator.getTemplateRoot ( )
protected

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

Definition at line 286 of file ContactServiceContentIterator.java.

286  {
287  return isMail() ? "content/newsletter/sections/services" : "service";
288  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getType()

String org.turro.contacts.content.ContactServiceContentIterator.getType ( )

Definition at line 105 of file ContactServiceContentIterator.java.

105  {
106  return type;
107  }

◆ getWhereClause()

WhereClause org.turro.contacts.content.ContactServiceContentIterator.getWhereClause ( )
protected

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

Definition at line 132 of file ContactServiceContentIterator.java.

132  {
133  WhereClause wc = new WhereClause();
134  wc.addClause("select distinct service from ContactService as service");
135  if(withDate) {
136  addCriteria(wc);
137  wc.addClause("order by service.startDate desc, service.title");
138  } else if(lastEntries) {
139  addCriteria(wc);
140  wc.addClause("order by service.creation desc, service.title");
141  } else {
142  wc = Statistics.load(constructor, "ServiceRanking", "ServiceContactMatching", wc)
143  .allowMatching(isAllowMatching())
144  .allowRanking(isAllowRanking())
145  .doMatching(isDoMatching())
146  .setContact(getContact())
147  .setEntityFields("service", "id")
148  .setDefaultSorting("service.title")
149  .onCriteria(w -> addCriteria(w))
150  .getClause();
151  }
152  return wc;
153  }
Here is the call graph for this function:

◆ isActive()

boolean org.turro.contacts.content.ContactServiceContentIterator.isActive ( )

Definition at line 81 of file ContactServiceContentIterator.java.

81  {
82  return active;
83  }

◆ isInBusiness()

boolean org.turro.contacts.content.ContactServiceContentIterator.isInBusiness ( ContactService  service,
IContact  contact 
)

Definition at line 113 of file ContactServiceContentIterator.java.

113  {
114  return all || service.getContact().isInBusiness(contact) ||
115  (ServiceContext.getAllowSingle() && service.getContact().getId().equals(contact.getId()));
116  }
Here is the call graph for this function:

◆ isLastEntries()

boolean org.turro.contacts.content.ContactServiceContentIterator.isLastEntries ( )

Definition at line 89 of file ContactServiceContentIterator.java.

89  {
90  return lastEntries;
91  }

◆ isValid()

boolean org.turro.contacts.content.ContactServiceContentIterator.isValid ( ContactService  e)
protected

Definition at line 253 of file ContactServiceContentIterator.java.

253  {
254  return super.isValid(e);
255  }

◆ isWithDate()

boolean org.turro.contacts.content.ContactServiceContentIterator.isWithDate ( )

Definition at line 73 of file ContactServiceContentIterator.java.

73  {
74  return withDate;
75  }

◆ metas()

Collection<String> org.turro.contacts.content.ContactServiceContentIterator.metas ( ContactService  e)
protected

Definition at line 271 of file ContactServiceContentIterator.java.

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

◆ preload()

void org.turro.contacts.content.ContactServiceContentIterator.preload ( )
protected

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

Definition at line 119 of file ContactServiceContentIterator.java.

119  {
120  super.preload();
121  DaoHtmlSearch dhs = DaoHtmlSearch.getInstance(constructor, ElephantContext.getContextVariable(constructor));
122  if(dhs != null && !dhs.hasAttribute(constructor, "roles")) {
123  dhs.setAttribute(constructor, "mode", ViewMode.values());
124  dhs.setAttribute(constructor, "roles", ContactServiceRole.values());
125  dhs.setAttribute(constructor, "types", dao.getResultList("select distinct service.type from ContactService as service order by 1"));
126  dhs.setAttribute(constructor, "thematics", dao.getResultList("select distinct service.thematic from ContactService as service order by 1"));
127  dhs.setAttribute(constructor, "allowNew", ServiceContext.getAllowNew(constructor));
128  }
129  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.contacts.content.ContactServiceContentIterator.renderItem ( ElephantMarker  marker,
ContactService  e,
int  page 
)
protected

Definition at line 173 of file ContactServiceContentIterator.java.

Here is the call graph for this function:

◆ renderSummary()

void org.turro.contacts.content.ContactServiceContentIterator.renderSummary ( ElephantMarker  marker,
ContactService  e,
int  page 
)
protected

Definition at line 164 of file ContactServiceContentIterator.java.

164  {
165  if(e != null) {
166  marker.put("service", e);
167  prepareValues(e, page);
168  }
170  }
Here is the call graph for this function:

◆ setActive()

void org.turro.contacts.content.ContactServiceContentIterator.setActive ( boolean  active)

Definition at line 85 of file ContactServiceContentIterator.java.

85  {
86  this.active = active;
87  }

◆ setLastEntries()

void org.turro.contacts.content.ContactServiceContentIterator.setLastEntries ( boolean  lastEntries)

Definition at line 93 of file ContactServiceContentIterator.java.

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

◆ setRole()

void org.turro.contacts.content.ContactServiceContentIterator.setRole ( ContactServiceRole  role)

Definition at line 101 of file ContactServiceContentIterator.java.

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

◆ setType()

void org.turro.contacts.content.ContactServiceContentIterator.setType ( String  type)

Definition at line 109 of file ContactServiceContentIterator.java.

109  {
110  this.type = type;
111  }
Here is the caller graph for this function:

◆ setWithDate()

void org.turro.contacts.content.ContactServiceContentIterator.setWithDate ( boolean  withDate)

Definition at line 77 of file ContactServiceContentIterator.java.

77  {
78  this.withDate = withDate;
79  }

◆ title()

String org.turro.contacts.content.ContactServiceContentIterator.title ( ContactService  e)
protected

Definition at line 263 of file ContactServiceContentIterator.java.

263  {
264  if(!Strings.isBlank(e.getTitle())) {
265  return e.getTitle();
266  }
267  return null;
268  }
Here is the call graph for this function:

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