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

Public Member Functions

 PollContentIterator (IConstructor constructor, Writer writer, IContact contact, boolean active, boolean restricted, int page, boolean mail, String pubPath)
 
boolean isPublicOnly ()
 
void setPublicOnly (boolean publicOnly)
 
boolean isActiveOnly ()
 
boolean isRestricted ()
 
String getVoteURL (PollOption option, int vote) throws Exception
 
- Public Member Functions inherited from org.turro.jpa.content.EntityItemContentIterator< E, ID >
 EntityItemContentIterator (List collection, IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
 
String getContextPath ()
 
IContact getContact ()
 
boolean isAllowInterest ()
 
void setAllowInterest (boolean allowInterest)
 
boolean isAllowComments ()
 
void setAllowComments (boolean allowComments)
 
boolean isAllowVotes ()
 
void setAllowVotes (boolean allowVotes)
 
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 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)
 
- Public Member Functions inherited from org.turro.collections.CollectionHtmlIterator< E, ID >
 CollectionHtmlIterator (List collection, ElephantMarker marker)
 
 CollectionHtmlIterator (List collection, ElephantMarker marker, Writer writer)
 
void setSummaryTemplate (String summaryTemplate)
 
String getSummaryTemplate ()
 
void setFullTemplate (String fullTemplate)
 
String getFullTemplate ()
 
boolean isNavigatorTop ()
 
void setNavigatorTop (boolean navigatorTop)
 
boolean isNavigatorBottom ()
 
void setNavigatorBottom (boolean navigatorBottom)
 
boolean isSearchOption ()
 
void setSearchOption (boolean searchOption)
 
boolean isForceSummary ()
 
void setForceSummary (boolean forceSummary)
 
boolean wantItem ()
 
boolean isItem ()
 
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 ()
 
boolean isEmpty ()
 
- Public Member Functions inherited from org.turro.collections.CollectionIterator< E, ID >
 CollectionIterator (List< E > collection)
 
int getPage ()
 
void setPage (int page)
 
void initClauses ()
 
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 ()
 

Static Public Member Functions

static String getOptionTemplate (Poll poll)
 

Protected Member Functions

void renderSummary (ElephantMarker marker, Poll e, int page)
 
void renderItem (ElephantMarker marker, Poll e, int page)
 
Poll entity (Long value)
 
boolean isValid (Poll e)
 
String title (Poll e)
 
Collection< String > metas (Poll e)
 
String getTemplateRoot ()
 
Object doVotesCtrl (Poll e)
 
Object doInterestCtrl (Poll e)
 
Object doCommentsCtrl (Poll e)
 
Object doAttachmentsCtrl (Poll e)
 
Object doFilesCtrl (Poll e)
 
Object doDescriptionsCtrl (Poll e)
 
Object doPollsCtrl (Poll e)
 
String getItemLink (Poll e)
 
String getReadAllLink ()
 
String getRestrictedLink ()
 
- Protected Member Functions inherited from org.turro.jpa.content.EntityItemContentIterator< E, ID >
void prepareControls (E entity, int page)
 
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.collections.CollectionHtmlIterator< E, ID >
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)
 
ID getIdentifier ()
 
void onRenderItem (E e)
 
boolean isValid (E e)
 
ID parseId (String value)
 
String stringId (ID value)
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.action.content.IContentIterator
static String PRELOAD_TMPL = "#preload"
 
- Protected Attributes inherited from org.turro.collections.CollectionHtmlIterator< E, ID >
HTMLHelper html
 
IConstructor constructor
 
ElephantMarker marker
 
- Protected Attributes inherited from org.turro.collections.CollectionIterator< E, ID >
List< E > items
 
int _total = -1
 

Detailed Description

Author
Lluis Turró Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 46 of file PollContentIterator.java.

Constructor & Destructor Documentation

◆ PollContentIterator()

org.turro.content.PollContentIterator.PollContentIterator ( IConstructor  constructor,
Writer  writer,
IContact  contact,
boolean  active,
boolean  restricted,
int  page,
boolean  mail,
String  pubPath 
)

Definition at line 51 of file PollContentIterator.java.

51  {
52  super(new ArrayList(PollsUtil.getPolls(contact, active, restricted, page)), constructor, writer, contact, mail, pubPath);
53  setPage(page);
54  activeOnly = active;
55  pollsUtil = new PollsUtil(contact);
56  }
Here is the call graph for this function:

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.content.PollContentIterator.doAttachmentsCtrl ( Poll  e)
protected

Definition at line 171 of file PollContentIterator.java.

171  {
172  AttachCtrl ac = new AttachCtrl(constructor);
173  ac.setEntityPath(ElephantPU.getObjectPath(e));
174  ac.setPublicOnly(publicOnly);
175  return ac;
176  }
Here is the call graph for this function:

◆ doCommentsCtrl()

Object org.turro.content.PollContentIterator.doCommentsCtrl ( Poll  e)
protected

Definition at line 166 of file PollContentIterator.java.

166  {
167  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
168  }

◆ doDescriptionsCtrl()

Object org.turro.content.PollContentIterator.doDescriptionsCtrl ( Poll  e)
protected

Definition at line 184 of file PollContentIterator.java.

184  {
185  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
186  }

◆ doFilesCtrl()

Object org.turro.content.PollContentIterator.doFilesCtrl ( Poll  e)
protected

Definition at line 179 of file PollContentIterator.java.

179  {
180  return new FileAttach(ElephantPU.getObjectPath(e));
181  }
Here is the call graph for this function:

◆ doInterestCtrl()

Object org.turro.content.PollContentIterator.doInterestCtrl ( Poll  e)
protected

Definition at line 161 of file PollContentIterator.java.

161  {
162  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
163  }

◆ doPollsCtrl()

Object org.turro.content.PollContentIterator.doPollsCtrl ( Poll  e)
protected

Definition at line 189 of file PollContentIterator.java.

189  {
190  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
191  }

◆ doVotesCtrl()

Object org.turro.content.PollContentIterator.doVotesCtrl ( Poll  e)
protected

Definition at line 156 of file PollContentIterator.java.

156  {
157  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
158  }

◆ entity()

Poll org.turro.content.PollContentIterator.entity ( Long  value)
protected

Definition at line 111 of file PollContentIterator.java.

111  {
112  return new ElephantPU().find(Poll.class, value);
113  }

◆ getItemLink()

String org.turro.content.PollContentIterator.getItemLink ( Poll  e)
protected

Definition at line 194 of file PollContentIterator.java.

194  {
195  return getReadAllLink() + "?item=" + e.getId();
196  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOptionTemplate()

static String org.turro.content.PollContentIterator.getOptionTemplate ( Poll  poll)
static

Definition at line 78 of file PollContentIterator.java.

78  {
79  if(!poll.isShowParticipants()) {
80  if(poll.isAllowNegatives()) {
81  return "voteOption";
82  } else {
83  return "likeOption";
84  }
85  } else {
86  if(poll.isAllowNegatives()) {
87  return "quadrantOption";
88  } else {
89  return "doodleOption";
90  }
91  }
92  }
Here is the call graph for this function:

◆ getReadAllLink()

String org.turro.content.PollContentIterator.getReadAllLink ( )
protected

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

Definition at line 199 of file PollContentIterator.java.

199  {
200  if(Strings.isBlank(getContextPath())) {
201  return getRestrictedLink();
202  }
203  return getContextPath();
204  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRestrictedLink()

String org.turro.content.PollContentIterator.getRestrictedLink ( )
protected

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

Definition at line 207 of file PollContentIterator.java.

207  {
208  return "/user/mypolls";
209  }
Here is the caller graph for this function:

◆ getTemplateRoot()

String org.turro.content.PollContentIterator.getTemplateRoot ( )
protected

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

Definition at line 151 of file PollContentIterator.java.

151  {
152  return isMail() ? "content/newsletter/sections/polls" : "poll";
153  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVoteURL()

String org.turro.content.PollContentIterator.getVoteURL ( PollOption  option,
int  vote 
) throws Exception

Definition at line 74 of file PollContentIterator.java.

74  {
75  return PollAction.createURL(option, Authentication.getIContact(), vote);
76  }
Here is the call graph for this function:

◆ isActiveOnly()

boolean org.turro.content.PollContentIterator.isActiveOnly ( )

Definition at line 66 of file PollContentIterator.java.

66  {
67  return activeOnly;
68  }

◆ isPublicOnly()

boolean org.turro.content.PollContentIterator.isPublicOnly ( )

Definition at line 58 of file PollContentIterator.java.

58  {
59  return publicOnly;
60  }

◆ isRestricted()

boolean org.turro.content.PollContentIterator.isRestricted ( )

Definition at line 70 of file PollContentIterator.java.

70  {
71  return restricted;
72  }

◆ isValid()

boolean org.turro.content.PollContentIterator.isValid ( Poll  e)
protected

Definition at line 116 of file PollContentIterator.java.

116  {
117  if(restricted && e != null) {
118  return e.isParticipant();
119  } else {
120  return super.isValid(e);
121  }
122  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.content.PollContentIterator.metas ( Poll  e)
protected

Definition at line 137 of file PollContentIterator.java.

137  {
138  ArrayList<RepositoryFile> files = new ArrayList<>();
139  String path = getItemLink(e);
140  if(!SocialImageMap.hasImage(path)) {
141  FileAttach fa = new FileAttach(ElephantPU.getObjectPath(e));
142  Repository repository = fa.getPublishableRepository(constructor);
143  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
144  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
145  }
146  SocialNet sn = new SocialNet(path, e.getTitle(), e.getText(), files);
147  return sn.getMetas();
148  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.content.PollContentIterator.renderItem ( ElephantMarker  marker,
Poll  e,
int  page 
)
protected

Definition at line 104 of file PollContentIterator.java.

Here is the call graph for this function:

◆ renderSummary()

void org.turro.content.PollContentIterator.renderSummary ( ElephantMarker  marker,
Poll  e,
int  page 
)
protected

Definition at line 95 of file PollContentIterator.java.

95  {
96  if(e != null) {
97  marker.put("poll", e);
98  prepareValues(e, page);
99  }
101  }
Here is the call graph for this function:

◆ setPublicOnly()

void org.turro.content.PollContentIterator.setPublicOnly ( boolean  publicOnly)

Definition at line 62 of file PollContentIterator.java.

62  {
63  this.publicOnly = publicOnly;
64  }
Here is the caller graph for this function:

◆ title()

String org.turro.content.PollContentIterator.title ( Poll  e)
protected

Definition at line 132 of file PollContentIterator.java.

132  {
133  return e.getTitle();
134  }
Here is the call graph for this function:

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