BrightSide Workbench Full Report + Source Code
org.turro.jpa.search.DaoHtmlSearch Class Reference
Inheritance diagram for org.turro.jpa.search.DaoHtmlSearch:
Collaboration diagram for org.turro.jpa.search.DaoHtmlSearch:

Public Member Functions

IContentIterator getIterator ()
 
void setIterator (IContentIterator iterator)
 
boolean isSingleInput ()
 
boolean isTagCloud ()
 
void setTagCloudString (String tagCloudString)
 
String getTagCloudString ()
 
void setTagsString (String tagsString)
 
String getTagsString ()
 
void setTagRoot (String tagRoot)
 
String render (IConstructor constructor)
 
String render (IConstructor constructor, DaoItemRender renderer)
 
boolean hasAttribute (IConstructor constructor, String attribute)
 
Object getAttribute (IConstructor constructor, String attribute)
 
void setAttribute (IConstructor constructor, String attribute, Object value)
 
- Public Member Functions inherited from org.turro.jpa.search.DaoSearch
 DaoSearch (String name)
 
String getSclass ()
 
String getRoot ()
 
String getTemplate ()
 
void clearValues ()
 

Static Public Member Functions

static void renderInstance (IConstructor constructor)
 
static DaoHtmlSearch getInstance (IConstructor constructor, String context)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.jpa.search.DaoSearch
String sclass
 

Detailed Description

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

Definition at line 41 of file DaoHtmlSearch.java.

Member Function Documentation

◆ getAttribute()

Object org.turro.jpa.search.DaoHtmlSearch.getAttribute ( IConstructor  constructor,
String  attribute 
)

Definition at line 244 of file DaoHtmlSearch.java.

244  {
245  checkAttributtes(constructor);
246  return attributes.get(attribute);
247  }

◆ getInstance()

static DaoHtmlSearch org.turro.jpa.search.DaoHtmlSearch.getInstance ( IConstructor  constructor,
String  context 
)
static

Definition at line 59 of file DaoHtmlSearch.java.

59  {
60  DaoHtmlSearch search = (DaoHtmlSearch) constructor.getSessionAttribute(context + "-search");
61  if(search == null) {
62  search = new DaoHtmlSearch(context);
63  if(!search.isEmpty()) {
64  constructor.setSessionAttribute(context + "-search", search);
65  } else {
66  search = null;
67  }
68  }
69  if(search != null) search.loadValues(constructor);
70  return search;
71  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIterator()

IContentIterator org.turro.jpa.search.DaoHtmlSearch.getIterator ( )

Definition at line 78 of file DaoHtmlSearch.java.

78  {
79  return iterator;
80  }

◆ getTagCloudString()

String org.turro.jpa.search.DaoHtmlSearch.getTagCloudString ( )

Definition at line 109 of file DaoHtmlSearch.java.

109  {
110  return tagCloudString;
111  }

◆ getTagsString()

String org.turro.jpa.search.DaoHtmlSearch.getTagsString ( )

Definition at line 117 of file DaoHtmlSearch.java.

117  {
118  return tagsString;
119  }

◆ hasAttribute()

boolean org.turro.jpa.search.DaoHtmlSearch.hasAttribute ( IConstructor  constructor,
String  attribute 
)

Definition at line 239 of file DaoHtmlSearch.java.

239  {
240  checkAttributtes(constructor);
241  return attributes.containsKey(attribute);
242  }
Here is the caller graph for this function:

◆ isSingleInput()

boolean org.turro.jpa.search.DaoHtmlSearch.isSingleInput ( )

Definition at line 86 of file DaoHtmlSearch.java.

86  {
87  int input = 0;
88  for(DaoSearchKey dsk : values()) {
89  if("input".equals(dsk.getTag())) {
90  input++;
91  }
92  }
93  return input == 1;
94  }

◆ isTagCloud()

boolean org.turro.jpa.search.DaoHtmlSearch.isTagCloud ( )

Definition at line 96 of file DaoHtmlSearch.java.

96  {
97  for(DaoSearchKey dsk : values()) {
98  if("tag-cloud".equals(dsk.getTag())) {
99  return true;
100  }
101  }
102  return false;
103  }

◆ render() [1/2]

String org.turro.jpa.search.DaoHtmlSearch.render ( IConstructor  constructor)

Definition at line 125 of file DaoHtmlSearch.java.

125  {
126  if(ElephantMarker.existsTemplate(constructor, false, "iterator", "search")) {
127  ElephantMarker em = new ElephantMarker(constructor);
128  em.put("iterator", iterator);
129  em.put("keys", this);
130  if(!Strings.isBlank(tagRoot)) {
131  em.put("tags", TagCloud.getTags(constructor, tagRoot));
132  }
133  return em.parse(Strings.isBlank(root, "iterator"), Strings.isBlank(template, "search"));
134  } else {
135  return render(constructor, null);
136  }
137  }
String render(IConstructor constructor)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render() [2/2]

String org.turro.jpa.search.DaoHtmlSearch.render ( IConstructor  constructor,
DaoItemRender  renderer 
)

Definition at line 139 of file DaoHtmlSearch.java.

139  {
140  HTMLGenerator hg = new HTMLGenerator();
141  hg.startTag("div", "class=\"" + getSclass() + "\"");
142  hg.startTag("form", "action='" + ElephantContext.getRootWebPath() + context + "' method='get' accept-charset='UTF-8'");
143 
144  hg.startTable("cellpadding='1' cellspacing='1' style='width:100%'")
145  .startTableCol("");
146 
147  for(String key : keySet()) {
148  DaoSearchKey dsk = get(key);
149  renderKey(constructor, hg, dsk, renderer);
150  }
151  hg.endAllTags();
152  return hg.toString();
153  }
Here is the call graph for this function:

◆ renderInstance()

static void org.turro.jpa.search.DaoHtmlSearch.renderInstance ( IConstructor  constructor)
static

Definition at line 48 of file DaoHtmlSearch.java.

48  {
49  DaoHtmlSearch dhs = DaoHtmlSearch.getInstance(constructor, ElephantContext.getContextVariable(constructor));
50  if(dhs != null) {
51  try {
52  constructor.getOut().print(dhs.render(constructor));
53  } catch (IOException ex) {
54  Logger.getLogger(DaoHtmlSearch.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
55  }
56  }
57  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAttribute()

void org.turro.jpa.search.DaoHtmlSearch.setAttribute ( IConstructor  constructor,
String  attribute,
Object  value 
)

Definition at line 249 of file DaoHtmlSearch.java.

249  {
250  checkAttributtes(constructor);
251  attributes.put(attribute, value);
252  }
Here is the caller graph for this function:

◆ setIterator()

void org.turro.jpa.search.DaoHtmlSearch.setIterator ( IContentIterator  iterator)

Definition at line 82 of file DaoHtmlSearch.java.

82  {
83  this.iterator = iterator;
84  }
Here is the caller graph for this function:

◆ setTagCloudString()

void org.turro.jpa.search.DaoHtmlSearch.setTagCloudString ( String  tagCloudString)

Definition at line 105 of file DaoHtmlSearch.java.

105  {
106  this.tagCloudString = tagCloudString;
107  }

◆ setTagRoot()

void org.turro.jpa.search.DaoHtmlSearch.setTagRoot ( String  tagRoot)

Definition at line 121 of file DaoHtmlSearch.java.

121  {
122  this.tagRoot = tagRoot;
123  }
Here is the caller graph for this function:

◆ setTagsString()

void org.turro.jpa.search.DaoHtmlSearch.setTagsString ( String  tagsString)

Definition at line 113 of file DaoHtmlSearch.java.

113  {
114  this.tagsString = tagsString;
115  }

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