19 package org.turro.contacts.content;
21 import java.io.Writer;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.Collection;
25 import org.turro.string.Strings;
26 import org.turro.attach.www.AttachCtrl;
27 import org.turro.contacts.Contact;
28 import org.turro.contacts.db.ContactsPU;
29 import org.turro.elephant.context.ElephantContext;
30 import org.turro.elephant.context.IConstructor;
31 import org.turro.elephant.db.WhereClause;
32 import org.turro.elephant.impl.repository.Repository;
33 import org.turro.elephant.impl.repository.RepositoryFile;
34 import org.turro.elephant.web.SocialImageMap;
35 import org.turro.elephant.web.SocialNet;
36 import org.turro.entities.Entities;
37 import org.turro.file.util.FileAttach;
38 import org.turro.jpa.content.EntityDaoContentIterator;
39 import org.turro.jpa.search.DaoHtmlSearch;
40 import org.turro.jpa.search.DaoSearchKey;
41 import org.turro.marker.ElephantMarker;
42 import org.turro.plugin.contacts.IContact;
43 import org.turro.polls.PollsCtrl;
44 import org.turro.www.commentit.CommentItCtrl;
45 import org.turro.www.describeit.DescribeItCtrl;
46 import org.turro.www.starit.StarItCtrl;
47 import org.turro.www.voteit.VoteItCtrl;
62 wc.
addClause(
"select distinct contact from Contact as contact");
63 wc.
addClause(
"left outer join contact.syndications syndication");
64 wc.
addClause(
"left outer join contact.connectors connector with connector.description like '%Directory%'");
73 wc.
addClause(
"select count(distinct contact) from Contact as contact");
74 wc.
addClause(
"left outer join contact.syndications syndication");
75 wc.
addClause(
"left outer join contact.connectors connector with connector.description like '%Directory%'");
84 prepareValues(e, page);
92 prepareValues(e, page);
104 wc.
addClause(
"select distinct contact from Contact as contact");
105 wc.
addClause(
"left outer join contact.syndications syndication");
106 wc.
addClause(
"left outer join contact.connectors connector with connector.description like '%Directory%'");
120 dsk.
applyToQuery(wc, Arrays.asList(
new String[] {
"contact.name",
"connector.value" }),
false);
130 wc.
addClause(
"and syndication.name = 'directory'");
131 if(!
getContact().getPermissions().isInRole(
"directory:show")) {
139 return super.isValid(e);
142 private void prepareValues(
final Contact e,
int page) {
148 if(!Strings.isBlank(e.
getName())) {
156 ArrayList<RepositoryFile> files =
new ArrayList<>();
171 return isMail() ?
"content/newsletter/sections/directory" :
"directory";
224 if(Strings.isBlank(path)) {
227 if(Strings.isBlank(path)) {
235 return "/user/directory";
void renderItem(ElephantMarker marker, Contact e, int page)
Collection< String > metas(Contact e)
Object doDescriptionsCtrl(Contact e)
WhereClause getCountClause()
Object doPollsCtrl(Contact e)
Object doAttachmentsCtrl(Contact e)
Object doCommentsCtrl(Contact e)
String getItemLink(Contact e)
void renderSummary(ElephantMarker marker, Contact e, int page)
String getRestrictedLink()
Object doVotesCtrl(Contact e)
WhereClause getWhereClause()
Object doInterestCtrl(Contact e)
boolean isValid(Contact e)
Object doFilesCtrl(Contact e)
Contact entity(String value)
OldDirectoryContentIterator(IConstructor constructor, Writer writer, IContact contact, boolean mail, String contextPath)
static String getContextVariable(IConstructor constructor)
static String getEntityWebContext(String path)
void addClause(String clause)
void addNamedValue(String name, Object value)
Set< RepositoryFile > getRepositoryFiles(String pattern)
static boolean hasImage(String url)
List< String > getMetas()
static IElephantEntity getController(String path)
Repository getPublishableRepository(IConstructor constructor)
Object getSingleResultOrNull(SqlClause sc)
void prepareControls(E entity, int page)
String doItemLink(E entity, ID id, boolean obfuscated)
String getSummaryTemplate()
static DaoHtmlSearch getInstance(IConstructor constructor, String context)
boolean applyToQuery(WhereClause wc, List< String > fields, boolean withSynonyms)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Object configureCtrl(Object ctrl, IContact contact)