BrightSide Workbench Full Report + Source Code
org.turro.www.groupit.GroupsTree Class Reference
Inheritance diagram for org.turro.www.groupit.GroupsTree:
Collaboration diagram for org.turro.www.groupit.GroupsTree:

Public Member Functions

 GroupsTree (IConstructor constructor, String context, String category)
 
String getImageSrc (Item item)
 
String getFolderImageSrc ()
 
String getCssClass (Item item)
 
- Public Member Functions inherited from org.turro.jpa.iterator.DaoHtmlTree< E, ID >
 DaoHtmlTree (Dao dao, ElephantMarker marker)
 
String getTreeTemplate ()
 
void setTreeTemplate (String treeTemplate)
 
String getFullTemplate ()
 
void setFullTemplate (String fullTemplate)
 
void render ()
 
String parse ()
 
VisualElements getVisuals ()
 
void renderSelected ()
 
String parseSelected ()
 
- Public Member Functions inherited from org.turro.jpa.iterator.DaoTree< E, ID >
 DaoTree (Dao dao)
 
Dao getDao ()
 
void fillTree (String path)
 
void fillRoot (Item item)
 

Protected Member Functions

Object getEntity (Object value)
 
void renderTree (ElephantMarker marker, List< Item< Object, Object >> items)
 
void renderItem (ElephantMarker marker, Object item)
 
String parseTree (ElephantMarker marker, List< Item< Object, Object >> items)
 
String parseItem (ElephantMarker marker, Object item)
 
WhereClause getChildrenClause (String currPath)
 
WhereClause getLeafClause (String currPath)
 
Object getId (Object item)
 
Object getParentId (Object entity)
 
- Protected Member Functions inherited from org.turro.jpa.iterator.DaoHtmlTree< E, ID >
VisualElements loadVisuals ()
 
abstract void renderTree (ElephantMarker marker, List< Item< E, ID >> items)
 
abstract void renderItem (ElephantMarker marker, E item)
 
abstract String parseTree (ElephantMarker marker, List< Item< E, ID >> items)
 
abstract String parseItem (ElephantMarker marker, E item)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.jpa.iterator.DaoHtmlTree< E, ID >
IConstructor constructor
 
ElephantMarker marker
 
- Protected Attributes inherited from org.turro.jpa.iterator.DaoTree< E, ID >
Dao dao
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 39 of file GroupsTree.java.

Constructor & Destructor Documentation

◆ GroupsTree()

org.turro.www.groupit.GroupsTree.GroupsTree ( IConstructor  constructor,
String  context,
String  category 
)

Definition at line 43 of file GroupsTree.java.

43  {
44  super(new ContactsPU(), new ElephantMarker(constructor));
45  this.category = category;
46  this.context = context;
47  processParameters();
48  }

Member Function Documentation

◆ getChildrenClause()

WhereClause org.turro.www.groupit.GroupsTree.getChildrenClause ( String  currPath)
protected

Reimplemented from org.turro.jpa.iterator.DaoTree< E, ID >.

Definition at line 96 of file GroupsTree.java.

96  {
97  WhereClause wc = new WhereClause();
98  wc.addClause("select g from GroupIt g");
99  wc.addClause("where g.category = :category");
100  wc.addNamedValue("category", category);
101  wc.addClause("and g.publishable = TRUE");
102  if(Strings.isBlank(currPath)) {
103  wc.addClause("and g.parent is null");
104  } else {
105  wc.addClause("and g.parent.pathName = :pathName");
106  wc.addNamedValue("pathName", currPath);
107  }
108  wc.addClause("order by g.name");
109  return wc;
110  }
Here is the call graph for this function:

◆ getCssClass()

String org.turro.www.groupit.GroupsTree.getCssClass ( Item  item)

Definition at line 139 of file GroupsTree.java.

139  {
140  GroupIt gi = (GroupIt) item.getValue();
141  String selected = GroupItUtil.getSelectedGroup(constructor, context);
142  String path = gi.getPathName();
143  if(path == null || selected == null) {
144  return "";
145  } else if(path.equals(selected)) {
146  return "active";
147  } else if(selected.startsWith(path)) {
148  return "inpath";
149  } else {
150  return "";
151  }
152  }
Here is the call graph for this function:

◆ getEntity()

Object org.turro.www.groupit.GroupsTree.getEntity ( Object  value)
protected

Definition at line 51 of file GroupsTree.java.

51  {
52  return value instanceof String ? getDao().find(GroupIt.class, (String) value) : value;
53  }
Here is the call graph for this function:

◆ getFolderImageSrc()

String org.turro.www.groupit.GroupsTree.getFolderImageSrc ( )

Definition at line 135 of file GroupsTree.java.

135  {
136  return ElephantContext.getRootWebPath() + Images.getImage("group");
137  }
Here is the call graph for this function:

◆ getId()

Object org.turro.www.groupit.GroupsTree.getId ( Object  item)
protected

Definition at line 122 of file GroupsTree.java.

122  {
123  return item instanceof GroupIt ? ((GroupIt) item).getName() : new Path((String) item).getLastNode();
124  }
Here is the call graph for this function:

◆ getImageSrc()

String org.turro.www.groupit.GroupsTree.getImageSrc ( Item  item)

Definition at line 131 of file GroupsTree.java.

131  {
132  return ElephantContext.getRootWebPath() + Images.getImage("group");
133  }
Here is the call graph for this function:

◆ getLeafClause()

WhereClause org.turro.www.groupit.GroupsTree.getLeafClause ( String  currPath)
protected

Reimplemented from org.turro.jpa.iterator.DaoTree< E, ID >.

Definition at line 113 of file GroupsTree.java.

113  {
114  WhereClause wc = new WhereClause();
115  wc.addClause("select g from GroupIt g");
116  wc.addClause("where 1 = 2");
117  wc.addClause("order by g.name");
118  return wc;
119  }
Here is the call graph for this function:

◆ getParentId()

Object org.turro.www.groupit.GroupsTree.getParentId ( Object  entity)
protected

Definition at line 127 of file GroupsTree.java.

127  {
128  return null;
129  }

◆ parseItem()

String org.turro.www.groupit.GroupsTree.parseItem ( ElephantMarker  marker,
Object  item 
)
protected

Definition at line 90 of file GroupsTree.java.

90  {
91  marker.put("item", item);
92  return marker.parse("groups", getFullTemplate());
93  }
String parse(String rootTmpl, String tmpl)
Object put(Object key, Object value)
Here is the call graph for this function:

◆ parseTree()

String org.turro.www.groupit.GroupsTree.parseTree ( ElephantMarker  marker,
List< Item< Object, Object >>  items 
)
protected

Definition at line 76 of file GroupsTree.java.

76  {
77  String selPath = GroupItUtil.getSelectedGroup(constructor, context);
78  if(Strings.isBlank(selPath) && !items.isEmpty()) {
79  selPath = ((GroupIt) ((Item) items.iterator().next()).getValue()).getPathName();
80  GroupItUtil.setSelectedGroup(constructor, context, selPath);
81  }
82  marker.put("context", context);
83  marker.put("items", items);
84  marker.put("selpath", selPath);
85  marker.put("tree", this);
86  return marker.parse("groups", getTreeTemplate());
87  }
Here is the call graph for this function:

◆ renderItem()

void org.turro.www.groupit.GroupsTree.renderItem ( ElephantMarker  marker,
Object  item 
)
protected

Definition at line 70 of file GroupsTree.java.

70  {
71  marker.put("item", item);
72  marker.process("groups", getFullTemplate());
73  }
void process(String rootTmpl, String tmpl)
Here is the call graph for this function:

◆ renderTree()

void org.turro.www.groupit.GroupsTree.renderTree ( ElephantMarker  marker,
List< Item< Object, Object >>  items 
)
protected

Definition at line 56 of file GroupsTree.java.

56  {
57  String selPath = GroupItUtil.getSelectedGroup(constructor, context);
58  if(Strings.isBlank(selPath) && !items.isEmpty()) {
59  selPath = ((GroupIt) ((Item) items.iterator().next()).getValue()).getPathName();
60  GroupItUtil.setSelectedGroup(constructor, context, selPath);
61  }
62  marker.put("context", context);
63  marker.put("items", items);
64  marker.put("selpath", selPath);
65  marker.put("tree", this);
66  marker.process("groups", getTreeTemplate());
67  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: