19 package org.turro.jpa.content;
21 import java.io.Writer;
22 import java.nio.file.Paths;
23 import java.util.Optional;
24 import org.turro.string.Strings;
25 import org.turro.action.IEntityCtrl;
26 import org.turro.action.Plugins;
27 import org.turro.elephant.context.IConstructor;
28 import org.turro.entities.EmptyController;
29 import org.turro.entities.Entities;
30 import org.turro.entities.IElephantEntity;
31 import org.turro.jpa.Dao;
32 import org.turro.jpa.entity.EntityWebUrls;
33 import org.turro.jpa.iterator.DaoHtmlIterator;
34 import org.turro.marker.ElephantMarker;
35 import org.turro.marker.MarkerHelper;
36 import org.turro.parser.processor.MacroProcessorContext;
37 import org.turro.participation.ParticipationReason;
38 import org.turro.plugin.contacts.IContact;
46 private final String contextPath;
48 private final boolean mail;
52 Writer writer,
IContact contact,
boolean mail, String contextPath) {
54 this.contextPath = Optional.ofNullable(contextPath)
57 .map(cons -> cons.getCurrentContext())
58 .map(ctx -> ctx.getFullPath())
59 .filter(path -> !path.endsWith(
"/user"))
62 this.contact = contact;
67 this.seenStatus = seenStatus;
75 int hash = Paths.get(contextPath).hashCode();
76 return "UID_" + (hash < 0 ? -hash : hash);
158 if(name.contains(
"summary")) {
206 if(!Strings.isBlank(iee.
getPath())) {
234 protected String
doItemLink(E entity, ID
id,
boolean obfuscated) {
static< T > T loadImplementation(Class< T > jclass)
static IElephantEntity getController(String path)
abstract String getRestrictedLink()
Object getCommentsCtrl(E e)
abstract Object doPollsCtrl(E e)
abstract Object doDescriptionsCtrl(E e)
Object getDescriptionsCtrl(E e)
void assignDefaultsByMacro(MacroProcessorContext context)
void setSeenStatus(SeenStatusCheck seenStatus)
void prepareControls(E entity, int page)
abstract Object doVotesCtrl(E e)
abstract String getItemLink(E e)
Object getInterestCtrl(E e)
SeenStatusCheck getSeenStatus()
Object getCtrlByLabel(String ctrl, E e, IContact contact)
abstract Object doAttachmentsCtrl(E e)
abstract String getTemplateRoot()
abstract Object doInterestCtrl(E e)
void assignDefaultsByName(String name)
abstract String getReadAllLink()
Object getParticipationCtrl(E e, ParticipationReason reason)
abstract Object doCommentsCtrl(E e)
EntityDaoContentIterator(Dao dao, IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
abstract Object doFilesCtrl(E e)
String doItemLink(E entity, ID id, boolean obfuscated)
Object getAttachmentsCtrl(E e)
Object getFollowCtrl(E e)
static String getUrlFromEntity(Object entity)
boolean isAllowAttachments()
void setRestricted(boolean restricted)
void setNavigatorBottom(boolean navigatorBottom)
void setAllowMatching(boolean allowMatching)
void setSummaryTemplate(String summaryTemplate)
String stringId(ID value)
void setNavigatorTop(boolean navigatorTop)
void setAllowRanking(boolean allowRanking)
boolean isAllowInterest()
boolean isAllowDescriptions()
boolean isAllowComments()
boolean contains(Object key)
Object put(Object key, Object value)
static String setObfuscatedPars(String parameters)
void setEntityPath(String entityPath)
void setConstructor(IConstructor constructor)
void setTemplate(String template)
Object getParticipationControl(IConstructor constructor, ParticipationReason reason)
Object configureCtrl(Object ctrl, IContact contact)