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

Public Member Functions

 ContactIterator (IConstructor constructor, String pubPath, String uniqueId)
 
void setSyndicationId (String syndicationId)
 
void setConnector (String connector, String values)
 
void setGroupings (List groupings)
 
void load ()
 
String getActualParameters ()
 
void prepareValues (Contact contact, int page, boolean asMail)
 
String getItemLink (Contact contact, int page)
 
String getPageLink (int page)
 
- 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 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)
 
String title (Contact e)
 
Collection< String > metas (Contact 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 50 of file ContactIterator.java.

Constructor & Destructor Documentation

◆ ContactIterator()

org.turro.contacts.www.ContactIterator.ContactIterator ( IConstructor  constructor,
String  pubPath,
String  uniqueId 
)

Definition at line 56 of file ContactIterator.java.

56  {
57  super(new ContactsPU(), new ElephantMarker(constructor));
58  this.pubPath = pubPath;
59  this.uniqueId = uniqueId;
60  connectors = new HashMap<>();
61  groupings = new ArrayList<>();
62  }

Member Function Documentation

◆ entity()

Contact org.turro.contacts.www.ContactIterator.entity ( String  value)
protected

Definition at line 138 of file ContactIterator.java.

138  {
139  return dao.find(Contact.class, value);
140  }

◆ entityRoot()

String org.turro.contacts.www.ContactIterator.entityRoot ( )
protected

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

Definition at line 133 of file ContactIterator.java.

133  {
134  return "contact";
135  }

◆ getActualParameters()

String org.turro.contacts.www.ContactIterator.getActualParameters ( )

Definition at line 105 of file ContactIterator.java.

105  {
106  return Strings.isBlank(actualParameters) ? "?a=b" : actualParameters;
107  }

◆ getCountClause()

WhereClause org.turro.contacts.www.ContactIterator.getCountClause ( )
protected

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

Definition at line 95 of file ContactIterator.java.

95  {
96  WhereClause wc = new WhereClause();
97  wc.addClause("select count(distinct c) from Contact as c");
98  wc.addClause("left join c.syndications as s");
99  wc.addClause("left join c.connectors as o");
100  wc.addClause("left outer join c.comments as m with m.comment like '#cv%'");
101  addCriteria(wc);
102  return wc;
103  }
Here is the call graph for this function:

◆ getItemLink()

String org.turro.contacts.www.ContactIterator.getItemLink ( Contact  contact,
int  page 
)

Definition at line 214 of file ContactIterator.java.

214  {
215  return pubPath + "?item=" + contact.getId() + "&page=" + page;
216  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPageLink()

String org.turro.contacts.www.ContactIterator.getPageLink ( int  page)

Definition at line 218 of file ContactIterator.java.

218  {
219  return pubPath + "?page=" + page;
220  }
Here is the caller graph for this function:

◆ getWhereClause()

WhereClause org.turro.contacts.www.ContactIterator.getWhereClause ( )
protected

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

Definition at line 83 of file ContactIterator.java.

83  {
84  WhereClause wc = new WhereClause();
85  wc.addClause("select distinct c from Contact as c");
86  wc.addClause("left join c.syndications as s");
87  wc.addClause("left join c.connectors as o");
88  wc.addClause("left outer join c.comments as m with m.comment like '#cv%'");
89  addCriteria(wc);
90  wc.addClause("order by c.name");
91  return wc;
92  }
Here is the call graph for this function:

◆ load()

void org.turro.contacts.www.ContactIterator.load ( )

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

Definition at line 77 of file ContactIterator.java.

77  {
78  super.load();
79  TagCloud.toggleTags(constructor, "contact");
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ metas()

Collection<String> org.turro.contacts.www.ContactIterator.metas ( Contact  e)
protected

Definition at line 228 of file ContactIterator.java.

228  {
229  ArrayList<RepositoryFile> files = new ArrayList<>();
230  String path = getItemLink(e, 0);
231  if(!SocialImageMap.hasImage(path)) {
232  FileAttach fa = new FileAttach(ContactsPU.getObjectPath(e));
233  Repository repository = fa.getPublishableRepository(constructor);
234  files.addAll(repository.getRepositoryFiles("/profile", "*.png,*.jpg"));
235  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
236  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
237  }
238  SocialNet sn = new SocialNet(path, e.getName(), e.getComment(constructor, "#cv"), files);
239  return sn.getMetas();
240  }
String getItemLink(Contact contact, int page)
Here is the call graph for this function:

◆ prepareValues()

void org.turro.contacts.www.ContactIterator.prepareValues ( Contact  contact,
int  page,
boolean  asMail 
)

Definition at line 182 of file ContactIterator.java.

182  {
183 
184  ContactWrapper cw = new ContactWrapper(contact);
185 
186  marker.put("contact", contact);
187 
188  if(asMail && pubPath != null) {
189  marker.put("name", MailContact.createLink(contact.getName(), getItemLink(contact, page), false));
190  } else {
191  if(pubPath != null) {
192  marker.put("path", getItemLink(contact, page));
193  marker.put("all", getPageLink(page));
194  }
195  marker.put("name", contact.getName());
196  }
197 
198  marker.put("face", ElephantContext.getRootWebPath() + cw.getPublishable() + "/profile/face.png");
199  marker.put("cv", contact.getComment(marker.getConstructor(), "#cv"));
200 
201  Connector conn = contact.getConnectorMap().get("Web");
202  if(conn != null) {
203  marker.put("web", conn.getValue());
204  }
205 
206  if(!Strings.isBlank(pubPath)) {
207  marker.put("readall", getItemLink(contact, page));
208  }
209 
210  marker.put("files", new FileAttach(ContactsPU.getObjectPath(contact)));
211 
212  }
Object put(Object key, Object value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderItem()

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

Definition at line 120 of file ContactIterator.java.

120  {
121  if(!Strings.isBlank(e.getName())) {
123  "jQuery('title').html('" + e.getName().replace("'", "\\'") + "');"
124  );
125  }
126  prepareValues(e, page, false);
127  marker.put("tags", TagCloud.getTags(constructor, "contact"));
128  marker.process("contact", getFullTemplate());
129  actualParameters = getPageLink(page);
130  }
void prepareValues(Contact contact, int page, boolean asMail)
void process(String rootTmpl, String tmpl)
void addOnLoadedJavaScript(String script)
Here is the call graph for this function:

◆ renderSummary()

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

Definition at line 110 of file ContactIterator.java.

110  {
111  if(e != null) {
112  prepareValues(e, page, false);
113  }
114  marker.put("tags", TagCloud.getTags(constructor, "contact"));
115  marker.process("contact", getSummaryTemplate());
116  actualParameters = getPageLink(page);
117  }
Here is the call graph for this function:

◆ setConnector()

void org.turro.contacts.www.ContactIterator.setConnector ( String  connector,
String  values 
)

Definition at line 68 of file ContactIterator.java.

68  {
69  connectors.put(connector, values);
70  }

◆ setGroupings()

void org.turro.contacts.www.ContactIterator.setGroupings ( List  groupings)

Definition at line 72 of file ContactIterator.java.

72  {
73  this.groupings.addAll(groupings);
74  }

◆ setSyndicationId()

void org.turro.contacts.www.ContactIterator.setSyndicationId ( String  syndicationId)

Definition at line 64 of file ContactIterator.java.

64  {
65  this.syndicationId = syndicationId;
66  }
Here is the caller graph for this function:

◆ title()

String org.turro.contacts.www.ContactIterator.title ( Contact  e)
protected

Definition at line 223 of file ContactIterator.java.

223  {
224  return e.getName();
225  }
Here is the call graph for this function:

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