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

Public Member Functions

 PollIterator (IConstructor constructor, String pubPath)
 
boolean isPublicOnly ()
 
void setPublicOnly (boolean publicOnly)
 
boolean isActiveOnly ()
 
void setActiveOnly (boolean activeOnly)
 
boolean isRestricted ()
 
void setRestricted (boolean restricted)
 
int count ()
 
Collection< Pollitems ()
 
String getActualParameters ()
 
String getVoteURL (PollOption option, int vote) throws Exception
 
- 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)
 
- 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 >
int _total = -1
 

Detailed Description

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

Definition at line 43 of file PollIterator.java.

Constructor & Destructor Documentation

◆ PollIterator()

org.turro.polls.PollIterator.PollIterator ( IConstructor  constructor,
String  pubPath 
)

Definition at line 49 of file PollIterator.java.

49  {
50  super(new ArrayList(PollsUtil.getMyPolls(Authentication.getIContact())), new ElephantMarker(constructor));
51  this.pubPath = pubPath;
52  pollsUtil = new PollsUtil(Authentication.getIContact());
53  }
Here is the call graph for this function:

Member Function Documentation

◆ count()

int org.turro.polls.PollIterator.count ( )

Definition at line 79 of file PollIterator.java.

79  {
80  return getTotalCount();
81  }
Here is the call graph for this function:

◆ entity()

Poll org.turro.polls.PollIterator.entity ( Long  value)
protected

Definition at line 130 of file PollIterator.java.

130  {
131  return new ElephantPU().find(Poll.class, value);
132  }

◆ getActualParameters()

String org.turro.polls.PollIterator.getActualParameters ( )

Definition at line 87 of file PollIterator.java.

87  {
88  return Strings.isBlank(actualParameters) ? "?a=b" : actualParameters;
89  }

◆ getOptionTemplate()

static String org.turro.polls.PollIterator.getOptionTemplate ( Poll  poll)
static

Definition at line 95 of file PollIterator.java.

95  {
96  if(!poll.isShowParticipants()) {
97  if(poll.isAllowNegatives()) {
98  return "voteOption";
99  } else {
100  return "likeOption";
101  }
102  } else {
103  if(poll.isAllowNegatives()) {
104  return "quadrantOption";
105  } else {
106  return "doodleOption";
107  }
108  }
109  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVoteURL()

String org.turro.polls.PollIterator.getVoteURL ( PollOption  option,
int  vote 
) throws Exception

Definition at line 91 of file PollIterator.java.

91  {
92  return PollAction.createURL(option, Authentication.getIContact(), vote);
93  }
Here is the call graph for this function:

◆ isActiveOnly()

boolean org.turro.polls.PollIterator.isActiveOnly ( )

Definition at line 63 of file PollIterator.java.

63  {
64  return activeOnly;
65  }

◆ isPublicOnly()

boolean org.turro.polls.PollIterator.isPublicOnly ( )

Definition at line 55 of file PollIterator.java.

55  {
56  return publicOnly;
57  }

◆ isRestricted()

boolean org.turro.polls.PollIterator.isRestricted ( )

Definition at line 71 of file PollIterator.java.

71  {
72  return restricted;
73  }

◆ isValid()

boolean org.turro.polls.PollIterator.isValid ( Poll  e)
protected

Definition at line 135 of file PollIterator.java.

135  {
136  if(restricted && e != null) {
137  return e.isParticipant();
138  } else {
139  return super.isValid(e);
140  }
141  }
Here is the call graph for this function:

◆ items()

Collection<Poll> org.turro.polls.PollIterator.items ( )

Reimplemented from org.turro.collections.CollectionIterator< E, ID >.

Definition at line 83 of file PollIterator.java.

83  {
84  return getTotalItems();
85  }
Here is the call graph for this function:

◆ metas()

Collection<String> org.turro.polls.PollIterator.metas ( Poll  e)
protected

Definition at line 183 of file PollIterator.java.

183  {
184  ArrayList<RepositoryFile> files = new ArrayList<>();
185  String path = getItemLink(e, 0);
186  if(!SocialImageMap.hasImage(path)) {
187  FileAttach fa = new FileAttach(ElephantPU.getObjectPath(e));
188  Repository repository = fa.getPublishableRepository(constructor);
189  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
190  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
191  }
192  SocialNet sn = new SocialNet(path, e.getTitle(), e.getText(), files);
193  return sn.getMetas();
194  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.polls.PollIterator.renderItem ( ElephantMarker  marker,
Poll  e,
int  page 
)
protected

Definition at line 122 of file PollIterator.java.

122  {
123  marker.put("poll", e);
124  prepareValues(e, page, false);
125  marker.process("poll", getFullTemplate());
126  actualParameters = getPageLink(page);
127  }
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Here is the call graph for this function:

◆ renderSummary()

void org.turro.polls.PollIterator.renderSummary ( ElephantMarker  marker,
Poll  e,
int  page 
)
protected

Definition at line 112 of file PollIterator.java.

112  {
113  if(e != null) {
114  marker.put("poll", e);
115  prepareValues(e, page, false);
116  }
117  marker.process("poll", getSummaryTemplate());
118  actualParameters = getPageLink(page);
119  }
Here is the call graph for this function:

◆ setActiveOnly()

void org.turro.polls.PollIterator.setActiveOnly ( boolean  activeOnly)

Definition at line 67 of file PollIterator.java.

67  {
68  this.activeOnly = activeOnly;
69  }

◆ setPublicOnly()

void org.turro.polls.PollIterator.setPublicOnly ( boolean  publicOnly)

Definition at line 59 of file PollIterator.java.

59  {
60  this.publicOnly = publicOnly;
61  }
Here is the caller graph for this function:

◆ setRestricted()

void org.turro.polls.PollIterator.setRestricted ( boolean  restricted)

Definition at line 75 of file PollIterator.java.

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

◆ title()

String org.turro.polls.PollIterator.title ( Poll  e)
protected

Definition at line 178 of file PollIterator.java.

178  {
179  return e.getTitle();
180  }
Here is the call graph for this function:

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