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

Public Member Functions

 DirectoryContentIterator (IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
 
Set< DirectoryTypegetTypes ()
 
void setTypes (Set< DirectoryType > types)
 
void setTypes (String types)
 
void setSyndications (List< String > syndications)
 
void setSyndications (String syndications)
 
void setContactIds (List< String > contactIds)
 
SkillSet getCloudSkills ()
 
SkillSet getEntitySkills (Object entity)
 
- 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, Contact e, int page)
 
void renderItem (ElephantMarker marker, Contact e, int page)
 
String entityRoot ()
 
Contact entity (String value)
 
boolean isValid (Contact e)
 
String title (Contact e)
 
Collection< String > metas (Contact e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (Contact e)
 
Object doInterestCtrl (Contact e)
 
Object doCommentsCtrl (Contact e)
 
Object doAttachmentsCtrl (Contact e)
 
Object doFilesCtrl (Contact e)
 
Object doDescriptionsCtrl (Contact e)
 
Object doPollsCtrl (Contact e)
 
String getItemLink (Contact 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 68 of file DirectoryContentIterator.java.

Constructor & Destructor Documentation

◆ DirectoryContentIterator()

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

Definition at line 74 of file DirectoryContentIterator.java.

74  {
75  super(new ContactsPU(), constructor, writer, contact, mail, contextPath);
76  }

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doAttachmentsCtrl ( Contact  e)
protected

Definition at line 374 of file DirectoryContentIterator.java.

374  {
375  return Entities.getController(e).configureCtrl(
376  new AttachCtrl(constructor), getContact());
377  }
Here is the call graph for this function:

◆ doCommentsCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doCommentsCtrl ( Contact  e)
protected

Definition at line 368 of file DirectoryContentIterator.java.

368  {
369  return Entities.getController(e).configureCtrl(
370  new CommentItCtrl(constructor), getContact());
371  }
Here is the call graph for this function:

◆ doDescriptionsCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doDescriptionsCtrl ( Contact  e)
protected

Definition at line 386 of file DirectoryContentIterator.java.

386  {
387  return Entities.getController(e).configureCtrl(
388  new DescribeItCtrl(constructor), getContact());
389  }
Here is the call graph for this function:

◆ doFilesCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doFilesCtrl ( Contact  e)
protected

Definition at line 380 of file DirectoryContentIterator.java.

380  {
381  return Entities.getController(e).configureCtrl(
382  new FileAttach(ContactsPU.getObjectPath(e)), getContact());
383  }
Here is the call graph for this function:

◆ doInterestCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doInterestCtrl ( Contact  e)
protected

Definition at line 362 of file DirectoryContentIterator.java.

362  {
363  return Entities.getController(e).configureCtrl(
364  new StarItCtrl(constructor), getContact());
365  }
Here is the call graph for this function:

◆ doPollsCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doPollsCtrl ( Contact  e)
protected

Definition at line 392 of file DirectoryContentIterator.java.

392  {
393  return Entities.getController(e).configureCtrl(
394  new PollsCtrl(constructor), getContact());
395  }
Here is the call graph for this function:

◆ doVotesCtrl()

Object org.turro.contacts.content.DirectoryContentIterator.doVotesCtrl ( Contact  e)
protected

Definition at line 356 of file DirectoryContentIterator.java.

356  {
357  return Entities.getController(e).configureCtrl(
358  new VoteItCtrl(constructor), getContact());
359  }
Here is the call graph for this function:

◆ entity()

Contact org.turro.contacts.content.DirectoryContentIterator.entity ( String  value)
protected

Definition at line 192 of file DirectoryContentIterator.java.

192  {
193  WhereClause wc = new WhereClause();
194  wc.addClause("select distinct contact from Contact contact");
195  wc.addClause("left outer join contact.connectors connector on connector.description = :trade");
196  wc.addClause("left outer join contact.businessRelations relation");
197  wc.addClause("left outer join relation.business business");
198  wc.addClause("left outer join business.connectors bconnector on bconnector.description = :trade");
199  wc.addNamedValue("trade", IUser.CONNECTOR_TRADE);
200  if(syndications != null && !syndications.isEmpty()) {
201  wc.addClause("left outer join contact.syndications syndication");
202  }
203  addCriteria(wc);
204  wc.addClause("and contact.id = :id");
205  wc.addNamedValue("id", value);
206  return (Contact) dao.getSingleResultOrNull(wc);
207  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ entityRoot()

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

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

Definition at line 187 of file DirectoryContentIterator.java.

187  {
188  return "contact";
189  }
Here is the caller graph for this function:

◆ getCloudSkills()

SkillSet org.turro.contacts.content.DirectoryContentIterator.getCloudSkills ( )

Definition at line 123 of file DirectoryContentIterator.java.

123  {
124  return canShowSkills() ? SkillCloud.getSkills(constructor, entityRoot(), isUserType()) : null;
125  }
Here is the call graph for this function:

◆ getCountClause()

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

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

Definition at line 155 of file DirectoryContentIterator.java.

155  {
156  WhereClause wc = new WhereClause();
157  wc.addClause("select count(distinct contact) from Contact contact");
158  wc.addClause("left outer join contact.connectors connector on connector.description = :trade");
159  wc.addClause("left outer join contact.businessRelations relation");
160  wc.addClause("left outer join relation.business business");
161  wc.addClause("left outer join business.connectors bconnector on bconnector.description = :trade");
162  wc.addNamedValue("trade", IUser.CONNECTOR_TRADE);
163  if(syndications != null && !syndications.isEmpty()) {
164  wc.addClause("left outer join contact.syndications syndication");
165  }
166  addCriteria(wc);
167  return wc;
168  }
Here is the call graph for this function:

◆ getEntitySkills()

SkillSet org.turro.contacts.content.DirectoryContentIterator.getEntitySkills ( Object  entity)

Definition at line 127 of file DirectoryContentIterator.java.

127  {
128  return SkillTags.getSkills(entity);
129  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.contacts.content.DirectoryContentIterator.getItemLink ( Contact  e)
protected

Definition at line 398 of file DirectoryContentIterator.java.

398  {
399  return doItemLink(e, e.getId(), true);
400  }
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.DirectoryContentIterator.getReadAllLink ( )
protected

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

Definition at line 403 of file DirectoryContentIterator.java.

403  {
404  String path = getContextPath();
405  if(Strings.isBlank(path)) {
406  path = ElephantContext.getEntityWebContext("/directory");
407  }
408  if(Strings.isBlank(path)) {
409  return getRestrictedLink();
410  }
411  return path;
412  }
Here is the call graph for this function:

◆ getRestrictedLink()

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

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

Definition at line 415 of file DirectoryContentIterator.java.

415  {
416  return "/user/profile";
417  }
Here is the caller graph for this function:

◆ getTemplateRoot()

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

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

Definition at line 351 of file DirectoryContentIterator.java.

351  {
352  return isMail() ? "content/newsletter/sections/directory" : "directory";
353  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypes()

Set<DirectoryType> org.turro.contacts.content.DirectoryContentIterator.getTypes ( )

Definition at line 78 of file DirectoryContentIterator.java.

78  {
79  return types;
80  }

◆ getWhereClause()

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

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

Definition at line 132 of file DirectoryContentIterator.java.

132  {
133  WhereClause wc = new WhereClause();
134  wc.addClause("select distinct contact from Contact contact");
135  wc.addClause("left outer join contact.connectors connector on connector.description = :trade");
136  wc.addClause("left outer join contact.businessRelations relation");
137  wc.addClause("left outer join relation.business business");
138  wc.addClause("left outer join business.connectors bconnector on bconnector.description = :trade");
139  wc.addNamedValue("trade", IUser.CONNECTOR_TRADE);
140  if(syndications != null && !syndications.isEmpty()) {
141  wc.addClause("left outer join contact.syndications syndication");
142  }
143  return Statistics.load(constructor, "ContactRanking", "HomonymsMatching", wc)
144  .allowMatching(isAllowMatching())
145  .allowRanking(isAllowRanking())
146  .doMatching(isDoMatching())
147  .setContact(getContact())
148  .setEntityFields("contact", "id")
149  .setDefaultSorting("contact.name")
150  .onCriteria(w -> addCriteria(w))
151  .getClause();
152  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.contacts.content.DirectoryContentIterator.isValid ( Contact  e)
protected

Definition at line 318 of file DirectoryContentIterator.java.

318  {
319  return super.isValid(e);
320  }

◆ metas()

Collection<String> org.turro.contacts.content.DirectoryContentIterator.metas ( Contact  e)
protected

Definition at line 336 of file DirectoryContentIterator.java.

336  {
337  ArrayList<RepositoryFile> files = new ArrayList<>();
338  String path = getItemLink(e);
339  if(!SocialImageMap.hasImage(path)) {
340  FileAttach fa = new FileAttach(ContactsPU.getObjectPath(e));
341  Repository repository = fa.getPublishableRepository(constructor);
342  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
343  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
344  }
345  SocialNet sn;
346  sn = new SocialNet(path, e.getName(), e.getName(), files);
347  return sn.getMetas();
348  }
Here is the call graph for this function:

◆ renderItem()

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

Definition at line 180 of file DirectoryContentIterator.java.

180  {
181  marker.put("contact", e);
182  prepareValues(e, page);
184  }
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Here is the call graph for this function:

◆ renderSummary()

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

Definition at line 171 of file DirectoryContentIterator.java.

171  {
172  if(e != null) {
173  marker.put("contact", e);
174  prepareValues(e, page);
175  }
177  }
Here is the call graph for this function:

◆ setContactIds()

void org.turro.contacts.content.DirectoryContentIterator.setContactIds ( List< String >  contactIds)

Definition at line 119 of file DirectoryContentIterator.java.

119  {
120  this.contactIds = contactIds;
121  }
Here is the caller graph for this function:

◆ setSyndications() [1/2]

void org.turro.contacts.content.DirectoryContentIterator.setSyndications ( List< String >  syndications)

Definition at line 109 of file DirectoryContentIterator.java.

109  {
110  this.syndications = new ExpressionSet(syndications);
111  }
Here is the caller graph for this function:

◆ setSyndications() [2/2]

void org.turro.contacts.content.DirectoryContentIterator.setSyndications ( String  syndications)

Definition at line 113 of file DirectoryContentIterator.java.

113  {
114  if(!Strings.isBlank(syndications)) {
115  this.syndications = new ExpressionSet(Strings.csvToList(syndications));
116  }
117  }

◆ setTypes() [1/2]

void org.turro.contacts.content.DirectoryContentIterator.setTypes ( Set< DirectoryType types)

Definition at line 82 of file DirectoryContentIterator.java.

82  {
83  this.types = types;
84  }
Here is the caller graph for this function:

◆ setTypes() [2/2]

void org.turro.contacts.content.DirectoryContentIterator.setTypes ( String  types)

Definition at line 86 of file DirectoryContentIterator.java.

86  {
87  String type[] = types.split("\\s*,\\s*");
88  Set<DirectoryType> set = new HashSet<>();
89  for(int i = 0; i < type.length; i++) {
90  if("typed".equals(type[i])) {
91  set.addAll(EnumSet.complementOf(EnumSet.of(DirectoryType.DIRECTORY_SINGLETONS)));
92  } else if("companies".equals(type[i])) {
93  set.add(DirectoryType.DIRECTORY_COMPANIES);
94  } else if("centers".equals(type[i])) {
95  set.add(DirectoryType.DIRECTORY_CENTERS);
96  } else if("professionals".equals(type[i])) {
97  set.add(DirectoryType.DIRECTORY_PROFESSIONALS);
98  } else if("educators".equals(type[i])) {
99  set.add(DirectoryType.DIRECTORY_EDUCATORS);
100  } else if("students".equals(type[i])) {
101  set.add(DirectoryType.DIRECTORY_STUDENTS);
102  } else if("singletons".equals(type[i])) {
103  set.add(DirectoryType.DIRECTORY_SINGLETONS);
104  }
105  }
106  setTypes(set);
107  }
Here is the call graph for this function:

◆ title()

String org.turro.contacts.content.DirectoryContentIterator.title ( Contact  e)
protected

Definition at line 328 of file DirectoryContentIterator.java.

328  {
329  if(!Strings.isBlank(e.getName())) {
330  return e.getName();
331  }
332  return null;
333  }
Here is the call graph for this function:

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