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

Public Member Functions

 PublicationIterator (IConstructor constructor, String pubPath, String uniqueId)
 
void setContactId (String contactId)
 
void setGroupId (long groupId)
 
void setCategoryId (long categoryId)
 
void setLang (String lang)
 
CategoryFilter getCategoryFilter ()
 
void setCategoryFilter (CategoryFilter categoryFilter)
 
boolean isBlogger ()
 
void setBlogger (boolean blogger)
 
Collection< DefaultNavigatorItempubCategories ()
 
void renderCategories ()
 
String getActualParameters ()
 
boolean isAnyBlogger ()
 
- 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

String title (Publication e)
 
Collection< String > metas (Publication e)
 
WhereClause getWhereClause ()
 
WhereClause getCountClause ()
 
void renderSummary (ElephantMarker marker, Publication e, int page)
 
void renderItem (ElephantMarker marker, Publication e, int page)
 
String entityRoot ()
 
Publication entity (Long value)
 
Long getIdentifier ()
 
- 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)
 
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 54 of file PublicationIterator.java.

Constructor & Destructor Documentation

◆ PublicationIterator()

org.turro.publication.www.PublicationIterator.PublicationIterator ( IConstructor  constructor,
String  pubPath,
String  uniqueId 
)

Definition at line 61 of file PublicationIterator.java.

61  {
62  super(new PublicationPU(), new ElephantMarker(constructor));
63  this.pubPath = pubPath;
64  this.uniqueId = uniqueId;
65  }

Member Function Documentation

◆ entity()

Publication org.turro.publication.www.PublicationIterator.entity ( Long  value)
protected

Definition at line 185 of file PublicationIterator.java.

185  {
186  return dao.find(Publication.class, value);
187  }

◆ entityRoot()

String org.turro.publication.www.PublicationIterator.entityRoot ( )
protected

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

Definition at line 180 of file PublicationIterator.java.

180  {
181  return "publication";
182  }

◆ getActualParameters()

String org.turro.publication.www.PublicationIterator.getActualParameters ( )

Definition at line 149 of file PublicationIterator.java.

149  {
150  return Strings.isBlank(actualParameters) ? "?a=b" : actualParameters;
151  }
Here is the caller graph for this function:

◆ getCategoryFilter()

CategoryFilter org.turro.publication.www.PublicationIterator.getCategoryFilter ( )

Definition at line 83 of file PublicationIterator.java.

83  {
84  return categoryFilter;
85  }

◆ getCountClause()

WhereClause org.turro.publication.www.PublicationIterator.getCountClause ( )
protected

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

Definition at line 142 of file PublicationIterator.java.

142  {
143  WhereClause wc = new WhereClause();
144  wc.addClause("select count(p) from Publication as p");
145  addCriteria(wc);
146  return wc;
147  }
Here is the call graph for this function:

◆ getIdentifier()

Long org.turro.publication.www.PublicationIterator.getIdentifier ( )
protected

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

Definition at line 190 of file PublicationIterator.java.

190  {
191  Long identifier = getIDFromURL("/publication");
192  if(identifier == null) {
193  identifier = super.getIdentifier();
194  }
195  return identifier;
196  }
Here is the call graph for this function:

◆ getWhereClause()

WhereClause org.turro.publication.www.PublicationIterator.getWhereClause ( )
protected

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

Definition at line 133 of file PublicationIterator.java.

133  {
134  WhereClause wc = new WhereClause();
135  wc.addClause("select distinct p from Publication as p");
136  addCriteria(wc);
137  wc.addClause("order by p.date desc");
138  return wc;
139  }
Here is the call graph for this function:

◆ isAnyBlogger()

boolean org.turro.publication.www.PublicationIterator.isAnyBlogger ( )

Definition at line 153 of file PublicationIterator.java.

153  {
154  return PublicationCategory.isAnyBlogger(Authentication.getIContact());
155  }
Here is the call graph for this function:

◆ isBlogger()

boolean org.turro.publication.www.PublicationIterator.isBlogger ( )

Definition at line 91 of file PublicationIterator.java.

91  {
92  return blogger;
93  }

◆ metas()

Collection<String> org.turro.publication.www.PublicationIterator.metas ( Publication  e)
protected

Definition at line 118 of file PublicationIterator.java.

118  {
119  ArrayList<RepositoryFile> files = new ArrayList<>();
120  String path = getItemLink(e, 0);
121  if(!SocialImageMap.hasImage(path)) {
122  FileAttach fa = new FileAttach(PublicationPU.getObjectPath(e));
123  files.addAll(fa.getPublishableRepository(constructor).getRepositoryFiles("/topmost", "*.png,*.jpg"));
124  files.addAll(fa.getPublishableRepository(constructor).getRepositoryFiles("/priorized", "*.png,*.jpg"));
125  files.addAll(fa.getPublishableRepository(constructor).getRepositoryFiles("/included", "*.png,*.jpg"));
126  files.addAll(fa.getPublishableRepository(constructor).getRepositoryFiles("/", "*.png,*.jpg"));
127  }
128  SocialNet sn = new SocialNet(path, e.getTitle(), e.getSummary(), files);
129  return sn.getMetas();
130  }
Here is the call graph for this function:

◆ pubCategories()

Collection<DefaultNavigatorItem> org.turro.publication.www.PublicationIterator.pubCategories ( )

Definition at line 99 of file PublicationIterator.java.

99  {
100  if(categoryFilter != null) {
101  return categoryFilter.pubCategories(getActualParameters(), groupId);
102  }
103  return null;
104  }
Collection< DefaultNavigatorItem > pubCategories(String parameters, long groupId)
Here is the call graph for this function:

◆ renderCategories()

void org.turro.publication.www.PublicationIterator.renderCategories ( )

Definition at line 106 of file PublicationIterator.java.

106  {
107  if(categoryFilter != null) {
108  categoryFilter.renderCategories(getActualParameters(), groupId);
109  }
110  }
void renderCategories(String parameters, long groupId)
Here is the call graph for this function:

◆ renderItem()

void org.turro.publication.www.PublicationIterator.renderItem ( ElephantMarker  marker,
Publication  e,
int  page 
)
protected

Definition at line 167 of file PublicationIterator.java.

167  {
168 // if(!Strings.isBlank(e.getTitle())) {
169 // constructor.addOnLoadedJavaScript(
170 // "jQuery('title').html('" + e.getTitle().replace("'", "\\'") + "');"
171 // );
172 // }
173  prepareValues(e, page, false);
174  marker.process("publication", getFullTemplate());
175  e.updateReadings(dao);
176  actualParameters = getPageLink(page);
177  }
void process(String rootTmpl, String tmpl)
Here is the call graph for this function:

◆ renderSummary()

void org.turro.publication.www.PublicationIterator.renderSummary ( ElephantMarker  marker,
Publication  e,
int  page 
)
protected

Definition at line 158 of file PublicationIterator.java.

158  {
159  if(e != null) {
160  prepareValues(e, page, false);
161  }
162  marker.process("publication", getSummaryTemplate());
163  actualParameters = getPageLink(page);
164  }
Here is the call graph for this function:

◆ setBlogger()

void org.turro.publication.www.PublicationIterator.setBlogger ( boolean  blogger)

Definition at line 95 of file PublicationIterator.java.

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

◆ setCategoryFilter()

void org.turro.publication.www.PublicationIterator.setCategoryFilter ( CategoryFilter  categoryFilter)

Definition at line 87 of file PublicationIterator.java.

87  {
88  this.categoryFilter = categoryFilter;
89  }
Here is the caller graph for this function:

◆ setCategoryId()

void org.turro.publication.www.PublicationIterator.setCategoryId ( long  categoryId)

Definition at line 75 of file PublicationIterator.java.

75  {
76  this.categoryId = categoryId;
77  }
Here is the caller graph for this function:

◆ setContactId()

void org.turro.publication.www.PublicationIterator.setContactId ( String  contactId)

Definition at line 67 of file PublicationIterator.java.

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

◆ setGroupId()

void org.turro.publication.www.PublicationIterator.setGroupId ( long  groupId)

Definition at line 71 of file PublicationIterator.java.

71  {
72  this.groupId = groupId;
73  }
Here is the caller graph for this function:

◆ setLang()

void org.turro.publication.www.PublicationIterator.setLang ( String  lang)

Definition at line 79 of file PublicationIterator.java.

79  {
80  this.lang = lang;
81  }
Here is the caller graph for this function:

◆ title()

String org.turro.publication.www.PublicationIterator.title ( Publication  e)
protected

Definition at line 113 of file PublicationIterator.java.

113  {
114  return e.getTitle();
115  }
Here is the call graph for this function:

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