19 package org.turro.www.groupit;
21 import java.util.List;
22 import org.turro.string.Strings;
23 import org.turro.collections.Item;
24 import org.turro.contacts.GroupIt;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.elephant.context.ElephantContext;
27 import org.turro.elephant.context.IConstructor;
28 import org.turro.elephant.db.WhereClause;
29 import org.turro.elephant.util.Images;
30 import org.turro.groupit.GroupItUtil;
31 import org.turro.jpa.iterator.DaoHtmlTree;
32 import org.turro.marker.ElephantMarker;
33 import org.turro.path.Path;
41 private final String category, context;
45 this.category = category;
46 this.context = context;
52 return value instanceof String ?
getDao().find(
GroupIt.class, (String) value) : value;
58 if(Strings.isBlank(selPath) && !items.isEmpty()) {
59 selPath = ((
GroupIt) ((Item) items.iterator().next()).getValue()).getPathName();
78 if(Strings.isBlank(selPath) && !items.isEmpty()) {
79 selPath = ((
GroupIt) ((Item) items.iterator().next()).getValue()).getPathName();
99 wc.
addClause(
"where g.category = :category");
101 wc.
addClause(
"and g.publishable = TRUE");
102 if(Strings.isBlank(currPath)) {
105 wc.
addClause(
"and g.parent.pathName = :pathName");
122 protected Object
getId(Object item) {
143 if(path ==
null || selected ==
null) {
145 }
else if(path.equals(selected)) {
147 }
else if(selected.startsWith(path)) {
154 private void processParameters() {
static String getRootWebPath()
void addClause(String clause)
void addNamedValue(String name, Object value)
static String getImage(String image)
static void setSelectedGroup(IConstructor constructor, String pathOrigin, String value)
static void setCategory(IConstructor constructor, String pathOrigin, String value)
static String getSelectedGroup(IConstructor constructor, String pathOrigin)
void process(String rootTmpl, String tmpl)
String parse(String rootTmpl, String tmpl)
Object put(Object key, Object value)
void renderTree(ElephantMarker marker, List< Item< Object, Object >> items)
String parseTree(ElephantMarker marker, List< Item< Object, Object >> items)
String getImageSrc(Item item)
WhereClause getLeafClause(String currPath)
String getCssClass(Item item)
WhereClause getChildrenClause(String currPath)
void renderItem(ElephantMarker marker, Object item)
Object getEntity(Object value)
GroupsTree(IConstructor constructor, String context, String category)
String getFolderImageSrc()
String parseItem(ElephantMarker marker, Object item)
Object getParentId(Object entity)
Object getId(Object item)
String getParameter(String param)