19 package org.turro.content;
21 import java.io.Writer;
22 import java.util.ArrayList;
23 import java.util.Collection;
24 import org.turro.string.Strings;
25 import org.turro.attach.www.AttachCtrl;
26 import org.turro.auth.Authentication;
27 import org.turro.elephant.context.IConstructor;
28 import org.turro.elephant.db.ElephantPU;
29 import org.turro.elephant.entities.db.Poll;
30 import org.turro.elephant.entities.db.PollOption;
31 import org.turro.elephant.impl.repository.Repository;
32 import org.turro.elephant.impl.repository.RepositoryFile;
33 import org.turro.elephant.web.SocialImageMap;
34 import org.turro.elephant.web.SocialNet;
35 import org.turro.file.util.FileAttach;
36 import org.turro.jpa.content.EntityItemContentIterator;
37 import org.turro.marker.ElephantMarker;
38 import org.turro.plugin.contacts.IContact;
39 import org.turro.polls.PollAction;
40 import org.turro.polls.PollsUtil;
48 private boolean restricted, publicOnly, activeOnly;
63 this.publicOnly = publicOnly;
87 return "quadrantOption";
89 return "doodleOption";
98 prepareValues(e, page);
106 prepareValues(e, page);
117 if(restricted && e !=
null) {
120 return super.isValid(e);
124 private void prepareValues(
Poll poll,
int page) {
138 ArrayList<RepositoryFile> files =
new ArrayList<>();
152 return isMail() ?
"content/newsletter/sections/polls" :
"poll";
157 throw new UnsupportedOperationException(
"Not supported yet.");
162 throw new UnsupportedOperationException(
"Not supported yet.");
167 throw new UnsupportedOperationException(
"Not supported yet.");
185 throw new UnsupportedOperationException(
"Not supported yet.");
190 throw new UnsupportedOperationException(
"Not supported yet.");
208 return "/user/mypolls";
void setPublicOnly(boolean publicOnly)
void setEntityPath(String entityPath)
static IContact getIContact()
String getSummaryTemplate()
Object doVotesCtrl(Poll e)
String getVoteURL(PollOption option, int vote)
Object doInterestCtrl(Poll e)
void renderItem(ElephantMarker marker, Poll e, int page)
Object doDescriptionsCtrl(Poll e)
Object doPollsCtrl(Poll e)
Collection< String > metas(Poll e)
PollContentIterator(IConstructor constructor, Writer writer, IContact contact, boolean active, boolean restricted, int page, boolean mail, String pubPath)
String getRestrictedLink()
static String getOptionTemplate(Poll poll)
Object doAttachmentsCtrl(Poll e)
String getItemLink(Poll e)
void renderSummary(ElephantMarker marker, Poll e, int page)
Object doCommentsCtrl(Poll e)
void setPublicOnly(boolean publicOnly)
Object doFilesCtrl(Poll e)
static String getObjectPath(Object object)
boolean isAllowNegatives()
boolean isShowParticipants()
Set< RepositoryFile > getRepositoryFiles(String pattern)
static boolean hasImage(String url)
List< String > getMetas()
Repository getPublishableRepository(IConstructor constructor)
void prepareControls(E entity, int page)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
static String createURL(PollOption option, IContact contact, int vote)
static List< Poll > getPolls(String entityPath)