19 package org.turro.documentation.model;
21 import java.io.Writer;
22 import java.util.ArrayList;
23 import java.util.Collection;
24 import java.util.Collections;
25 import java.util.List;
26 import org.turro.string.Strings;
27 import org.turro.attach.db.AttachPU;
28 import org.turro.attach.entity.EntityDocumentation;
29 import org.turro.attach.entity.EntityDocumentationPK;
30 import org.turro.attach.entity.EntityDocumentationStatus;
31 import org.turro.elephant.context.IConstructor;
32 import org.turro.jpa.content.EntityItemContentIterator;
33 import org.turro.marker.ElephantMarker;
34 import org.turro.plugin.contacts.IContact;
35 import org.turro.sql.SqlClause;
44 super(getPending(contact),
constructor, writer, contact, mail, pubPath);
50 prepareValues(e, page);
57 prepareValues(e, page);
86 return Collections.EMPTY_LIST;
91 return isMail() ?
"content/newsletter/sections/attachments" :
"attachment";
144 return "/user/documentation";
147 private static List<EntityDocumentation> getPending(
IContact contact) {
148 String orderBy =
"ed.documentation";
149 List<String> contactIds =
new ArrayList<>();
150 contactIds.add(contact.
getId());
152 List<EntityDocumentation> model = SqlClause.select(
"ed")
153 .from(
"EntityDocumentation ed")
156 .and().in(
"ed.contactId", contactIds)
157 .or().equal(
"ed.requesterId", contact.
getId())
158 .or().member(
"ed.assistantIds", contact.
getId())
164 model.forEach(ed -> ed.reviewStatus());
void setDocumentation(String documentation)
boolean equals(Object obj)
void setContactId(String contactId)
void setEntityPath(String entityPath)
IElephantEntity getEntity()
String getSummaryTemplate()
Object doPollsCtrl(EntityDocumentation e)
Collection< String > metas(EntityDocumentation e)
Object doDescriptionsCtrl(EntityDocumentation e)
Object doCommentsCtrl(EntityDocumentation e)
void renderSummary(ElephantMarker marker, EntityDocumentation e, int page)
Object doVotesCtrl(EntityDocumentation e)
EntityDocumentation entity(EntityDocumentationPK value)
Object doAttachmentsCtrl(EntityDocumentation e)
String title(EntityDocumentation e)
void renderItem(ElephantMarker marker, EntityDocumentation e, int page)
String getRestrictedLink()
Object doFilesCtrl(EntityDocumentation e)
Object doInterestCtrl(EntityDocumentation e)
String getItemLink(EntityDocumentation e)
DocumentationContentIterator(IConstructor constructor, Writer writer, IContact contact, boolean mail, String pubPath)
void saveCollection(Collection objs)
void prepareControls(E entity, int page)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)