19 package org.turro.jpa.content;
21 import java.io.Writer;
22 import java.util.List;
23 import java.util.Optional;
24 import org.turro.collections.CollectionHtmlIterator;
25 import org.turro.elephant.context.IConstructor;
26 import org.turro.entities.EmptyController;
27 import org.turro.entities.Entities;
28 import org.turro.entities.IElephantEntity;
29 import org.turro.marker.ElephantMarker;
30 import org.turro.plugin.contacts.IContact;
38 private final String contextPath;
40 private final boolean mail;
41 private boolean allowInterest, allowComments, allowVotes,
42 allowDescriptions, allowAttachments, allowFiles, allowPolls;
45 Writer writer,
IContact contact,
boolean mail, String contextPath) {
47 this.contextPath = Optional.ofNullable(contextPath)
50 .map(cons -> cons.getCurrentContext())
51 .map(ctx -> ctx.getFullPath())
52 .filter(path -> !path.endsWith(
"/user"))
55 this.contact = contact;
72 this.allowInterest = allowInterest;
80 this.allowComments = allowComments;
88 this.allowVotes = allowVotes;
92 return allowDescriptions;
96 this.allowDescriptions = allowDescriptions;
100 return allowAttachments;
104 this.allowAttachments = allowAttachments;
112 this.allowFiles = allowFiles;
120 this.allowPolls = allowPolls;
149 if(allowAttachments) {
163 if(allowDescriptions) {
static IElephantEntity getController(String path)
Object getDescriptionsCtrl(E e)
void setAllowAttachments(boolean allowAttachments)
void setAllowPolls(boolean allowPolls)
void setAllowVotes(boolean allowVotes)
Object getCommentsCtrl(E e)
abstract Object doCommentsCtrl(E e)
abstract Object doVotesCtrl(E e)
EntityItemContentIterator(List collection, IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
abstract Object doDescriptionsCtrl(E e)
abstract Object doPollsCtrl(E e)
void setAllowFiles(boolean allowFiles)
boolean isAllowAttachments()
void setAllowInterest(boolean allowInterest)
abstract Object doInterestCtrl(E e)
abstract Object doAttachmentsCtrl(E e)
abstract String getItemLink(E e)
Object getInterestCtrl(E e)
boolean isAllowComments()
void setAllowComments(boolean allowComments)
boolean isAllowInterest()
void prepareControls(E entity, int page)
void setAllowDescriptions(boolean allowDescriptions)
boolean isAllowDescriptions()
abstract String getTemplateRoot()
abstract String getRestrictedLink()
abstract String getReadAllLink()
Object getAttachmentsCtrl(E e)
abstract Object doFilesCtrl(E e)
boolean contains(Object key)
Object put(Object key, Object value)