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

Public Member Functions

 CategoriesTree (IConstructor constructor, String context, IContact contact, String categories, String types[], String status[])
 
String getImageSrc (Item item)
 
String getFolderImageSrc ()
 
String getCssClass (Item item)
 
- Public Member Functions inherited from org.turro.jpa.content.TreeDaoContentIterator< E, ID >
 TreeDaoContentIterator (Dao dao, ElephantMarker marker, String contextPath, IContact contact)
 
boolean isRestricted ()
 
void setRestricted (boolean restricted)
 
boolean isAllowInterest ()
 
void setAllowInterest (boolean allowInterest)
 
boolean isAllowComments ()
 
void setAllowComments (boolean allowComments)
 
boolean isAllowVotes ()
 
void setAllowVotes (boolean allowVotes)
 
boolean isAllowDescriptions ()
 
void setAllowDescriptions (boolean allowDescriptions)
 
boolean isAllowAttachments ()
 
void setAllowAttachments (boolean allowAttachments)
 
boolean isAllowFiles ()
 
void setAllowFiles (boolean allowFiles)
 
boolean isAllowPolls ()
 
void setAllowPolls (boolean allowPolls)
 
boolean isAllowForum ()
 
void setAllowForum (boolean allowForum)
 
String getContextPath ()
 
IContact getContact ()
 
String getCssClass (String path)
 
String getSelectedItem ()
 
void renderSelected ()
 
String parseSelected ()
 
Object getVotesCtrl (E e)
 
Object getInterestCtrl (E e)
 
Object getCommentsCtrl (E e)
 
Object getAttachmentsCtrl (E e)
 
Object getFilesCtrl (E e)
 
Object getDescriptionsCtrl (E e)
 
Object getPollsCtrl (E e)
 
Object getForumCtrl (E e)
 
- 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 ()
 
- 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

WhereClause getItemClause (String currPath)
 
Object getEntity (Object value)
 
WhereClause getChildrenClause (String currPath)
 
WhereClause getLeafClause (String currPath)
 
Object getId (Object item)
 
Object getParentId (Object item)
 
void prepareTree (ElephantMarker marker, List< Item< Object, Object >> items)
 
void prepareItem (ElephantMarker marker, Object item)
 
String getTemplateRoot ()
 
Object doVotesCtrl (Object e)
 
Object doInterestCtrl (Object e)
 
Object doCommentsCtrl (Object e)
 
Object doAttachmentsCtrl (Object e)
 
Object doFilesCtrl (Object e)
 
Object doDescriptionsCtrl (Object e)
 
Object doPollsCtrl (Object e)
 
VisualElements loadVisuals ()
 
- Protected Member Functions inherited from org.turro.jpa.content.TreeDaoContentIterator< E, ID >
void setSelectedItem (String value)
 
abstract void prepareTree (ElephantMarker marker, List< Item< E, ID >> items)
 
abstract void prepareItem (ElephantMarker marker, E item)
 
abstract Object doVotesCtrl (E e)
 
abstract Object doInterestCtrl (E e)
 
abstract Object doCommentsCtrl (E e)
 
abstract Object doAttachmentsCtrl (E e)
 
abstract Object doFilesCtrl (E e)
 
abstract Object doDescriptionsCtrl (E e)
 
abstract Object doPollsCtrl (E e)
 
void renderTree (ElephantMarker marker, List< Item< E, ID >> items)
 
void renderItem (ElephantMarker marker, E item)
 
String parseTree (ElephantMarker marker, List< Item< E, ID >> items)
 
String parseItem (ElephantMarker marker, E item)
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.jpa.content.TreeDaoContentIterator< E, ID >
static String getSelectionLink (String path)
 
static String getSelectedItem (IConstructor constructor, String pathOrigin)
 
- 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

Constructor & Destructor Documentation

◆ CategoriesTree()

org.turro.dossier.www.CategoriesTree.CategoriesTree ( IConstructor  constructor,
String  context,
IContact  contact,
String  categories,
String  types[],
String  status[] 
)

Definition at line 60 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

60  {
61  super(new DossierPU(), new ElephantMarker(constructor), context, contact);
62  this.categories = categories;
63  this.types = types;
64  this.status = status;
65  }

Member Function Documentation

◆ doAttachmentsCtrl()

Object org.turro.dossier.www.CategoriesTree.doAttachmentsCtrl ( Object  e)
protected

Definition at line 187 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

187  {
188  return Entities.getController(e).configureCtrl(
189  new AttachCtrl(constructor), getContact());
190  }
Here is the call graph for this function:

◆ doCommentsCtrl()

Object org.turro.dossier.www.CategoriesTree.doCommentsCtrl ( Object  e)
protected

Definition at line 181 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

181  {
182  return Entities.getController(e).configureCtrl(
183  new CommentItCtrl(constructor), getContact());
184  }
Here is the call graph for this function:

◆ doDescriptionsCtrl()

Object org.turro.dossier.www.CategoriesTree.doDescriptionsCtrl ( Object  e)
protected

Definition at line 199 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

199  {
200  return Entities.getController(e).configureCtrl(
201  new DescribeItCtrl(constructor), getContact());
202  }
Here is the call graph for this function:

◆ doFilesCtrl()

Object org.turro.dossier.www.CategoriesTree.doFilesCtrl ( Object  e)
protected

Definition at line 193 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

193  {
194  return Entities.getController(e).configureCtrl(
195  new FileAttach(DossierPU.getObjectPath(e)), getContact());
196  }
Here is the call graph for this function:

◆ doInterestCtrl()

Object org.turro.dossier.www.CategoriesTree.doInterestCtrl ( Object  e)
protected

Definition at line 175 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

175  {
176  return Entities.getController(e).configureCtrl(
177  new StarItCtrl(constructor), getContact());
178  }
Here is the call graph for this function:

◆ doPollsCtrl()

Object org.turro.dossier.www.CategoriesTree.doPollsCtrl ( Object  e)
protected

Definition at line 205 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

205  {
206  return Entities.getController(e).configureCtrl(
207  new PollsCtrl(constructor), getContact());
208  }
Here is the call graph for this function:

◆ doVotesCtrl()

Object org.turro.dossier.www.CategoriesTree.doVotesCtrl ( Object  e)
protected

Definition at line 169 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

169  {
170  return Entities.getController(e).configureCtrl(
171  new VoteItCtrl(constructor), getContact());
172  }
Here is the call graph for this function:

◆ getChildrenClause()

WhereClause org.turro.dossier.www.CategoriesTree.getChildrenClause ( String  currPath)
protected

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

Definition at line 87 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

87  {
88  WhereClause wc = new WhereClause();
89  wc.addClause("select g from Category g");
90  wc.addClause("where 1=1");
91  if(Strings.isBlank(currPath)) {
92  if("all".equals(categories)) {
93  wc.addClause("and g.parent is null");
94  } else {
95  wc.addClause("and g.id in (" + categories + ")");
96  }
97  } else {
98  wc.addClause("and g.parent.fullDescription = :pathName");
99  wc.addNamedValue("pathName", Category.getPathToFullDescription(currPath));
100  }
101  if(isRestricted() && !Application.getApplication().isInRole("dossier:all")) {
102  CategoryResults.addParticipantCategoryAffiliance(wc, "and", Authentication.getIContact().getId(), "g");
103  }
104  addFilters(wc);
105  wc.addClause("order by g.description");
106  return wc;
107  }
Here is the call graph for this function:

◆ getCssClass()

String org.turro.dossier.www.CategoriesTree.getCssClass ( Item  item)

Definition at line 132 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

132  {
133  Category cat = (Category) item.getValue();
134  String selected = getSelectedItem();
135  String path = cat.getPath();
136  if(path == null || selected == null) {
137  return "";
138  } else if(path.equals(selected)) {
139  return "active";
140  } else if(selected.startsWith(path)) {
141  return "inpath";
142  } else {
143  return "";
144  }
145  }
Here is the call graph for this function:

◆ getEntity()

Object org.turro.dossier.www.CategoriesTree.getEntity ( Object  value)
protected

Definition at line 82 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

82  {
83  return value instanceof String ? getDao().find(Category.class, Long.valueOf((String) value)) : value;
84  }
Here is the call graph for this function:

◆ getFolderImageSrc()

String org.turro.dossier.www.CategoriesTree.getFolderImageSrc ( )

Definition at line 128 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

128  {
129  return ElephantContext.getRootWebPath() + Images.getImage("group");
130  }
Here is the call graph for this function:

◆ getId()

Object org.turro.dossier.www.CategoriesTree.getId ( Object  item)
protected

Definition at line 115 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

115  {
116  return item instanceof Category ? ((Category) item).getDescription() : new Path((String) item).getLastNode();
117  }
Here is the call graph for this function:

◆ getImageSrc()

String org.turro.dossier.www.CategoriesTree.getImageSrc ( Item  item)

Definition at line 124 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

124  {
125  return ElephantContext.getRootWebPath() + Images.getImage("group");
126  }
Here is the call graph for this function:

◆ getItemClause()

WhereClause org.turro.dossier.www.CategoriesTree.getItemClause ( String  currPath)
protected

Reimplemented from org.turro.jpa.content.TreeDaoContentIterator< E, ID >.

Definition at line 68 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

68  {
69  WhereClause wc = new WhereClause();
70  wc.addClause("select g from Category g");
71  wc.addClause("where 1=1");
72  if(Strings.isBlank(currPath)) {
73  wc.addClause("and 1=2");
74  } else {
75  wc.addClause("and g.fullDescription = :pathName");
76  wc.addNamedValue("pathName", Category.getPathToFullDescription(currPath));
77  }
78  return wc;
79  }
Here is the call graph for this function:

◆ getLeafClause()

WhereClause org.turro.dossier.www.CategoriesTree.getLeafClause ( String  currPath)
protected

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

Definition at line 110 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

110  {
111  return null;
112  }

◆ getParentId()

Object org.turro.dossier.www.CategoriesTree.getParentId ( Object  item)
protected

Definition at line 120 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

120  {
121  return item instanceof Category ? ((Category) item).getParent().getDescription() : new Path((String) item).getLastNode();
122  }
Here is the call graph for this function:

◆ getTemplateRoot()

String org.turro.dossier.www.CategoriesTree.getTemplateRoot ( )
protected

Reimplemented from org.turro.jpa.content.TreeDaoContentIterator< E, ID >.

Definition at line 164 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

164  {
165  return "categories";
166  }

◆ loadVisuals()

VisualElements org.turro.dossier.www.CategoriesTree.loadVisuals ( )
protected

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

Definition at line 211 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

211  {
212  return CategoryVisualElements.load();
213  }
Here is the call graph for this function:

◆ prepareItem()

void org.turro.dossier.www.CategoriesTree.prepareItem ( ElephantMarker  marker,
Object  item 
)
protected

Definition at line 159 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

159  {
160  // do nothing
161  }

◆ prepareTree()

void org.turro.dossier.www.CategoriesTree.prepareTree ( ElephantMarker  marker,
List< Item< Object, Object >>  items 
)
protected

Definition at line 148 of file BrightSide/elephant-dossier/src/main/java/org/turro/dossier/www/CategoriesTree.java.

148  {
149  String selPath = getSelectedItem();
150  if(Strings.isBlank(selPath) && !items.isEmpty()) {
151  selPath = ((Category) ((Item) items.iterator().next()).getValue()).getPath();
152  setSelectedItem(selPath);
153  }
154  marker.put("selpath", selPath);
155  marker.put("dossierCounter", new DossierCounter(categories, types, status, isRestricted()));
156  }
Object put(Object key, Object value)
Here is the call graph for this function:

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