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

Public Member Functions

 Search ()
 
ISearchable[] getElements ()
 
FoundList getResults ()
 
FoundList search (String value, boolean ignoreCase)
 
void startConstruction () throws ServletException, IOException
 
String getStart ()
 
String getEnd ()
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractElement
 AbstractElement ()
 
String getId ()
 
String getType ()
 
String getTitle ()
 
void setTitle (String title)
 
Collection< String > getMetas ()
 
void setMetas (Collection< String > metas)
 
ElContext getContext ()
 
IConstructor getConstructor ()
 
void loadData () throws ServletException, IOException
 
void setConfiguration (IConstructor constructor, ElContext context)
 
String getStartTitle ()
 
String getEndTitle ()
 
String getStartBody ()
 
String getEndBody ()
 
String getStartFooter ()
 
String getEndFooter ()
 
String getStartOption ()
 
String getEndOption ()
 
boolean canDisplay ()
 
boolean isSelectable ()
 
boolean isInRole ()
 
boolean canPrint ()
 
String getElementFolder ()
 
boolean isOriginalContext ()
 
void setRootCategories (ElContext root)
 
String getTypeName ()
 
AttributeSupport getAttributes ()
 
void applyChanges ()
 
void populateFromParent ()
 
void setDefaultMetas ()
 
void setConfiguration (Element conf, Element factory)
 

Protected Attributes

Localizer localizer
 
FoundList results = null
 
- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractElement
IConstructor constructor
 
ElContext context
 
AttributeSupport attrSupport
 
Element conf = null
 
String[] types
 
String title
 
Collection< String > metas
 

Detailed Description

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

Definition at line 37 of file Search.java.

Constructor & Destructor Documentation

◆ Search()

org.turro.elephant.search.Search.Search ( )

Creates a new instance of Search

Definition at line 43 of file Search.java.

43  {
44  }

Member Function Documentation

◆ getElements()

ISearchable [] org.turro.elephant.search.Search.getElements ( )

Definition at line 46 of file Search.java.

46  {
47  HashSet els = new HashSet();
48  IElement sel;
49  for(ElContext ctx : ElContextMap.getInstance().values()) {
50  if(ctx.isSelectable() && ctx.isInRole() && !ctx.getWebContext().isDynamic()) {
51  if(ctx instanceof ISearchable) {
52  els.add(ctx);
53  }
54  sel = ctx.getElement();
55  if(sel instanceof ISearchable) {
56  els.add(sel);
57  }
58  }
59  }
60  return (ISearchable[])els.toArray(new ISearchable[0]);
61  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnd()

String org.turro.elephant.search.Search.getEnd ( )

Reimplemented from org.turro.elephant.impl.abstracts.AbstractElement.

Definition at line 104 of file Search.java.

104  {
105  return "</div>";
106  }
Here is the caller graph for this function:

◆ getResults()

FoundList org.turro.elephant.search.Search.getResults ( )

Definition at line 63 of file Search.java.

63  {
64  return search(
65  getConstructor().getParameter("query"),
66  getConstructor().getParameter("ic") != null);
67  }
FoundList search(String value, boolean ignoreCase)
Definition: Search.java:70
Here is the call graph for this function:

◆ getStart()

String org.turro.elephant.search.Search.getStart ( )

Reimplemented from org.turro.elephant.impl.abstracts.AbstractElement.

Definition at line 99 of file Search.java.

99  {
100  return "<div class='search'>";
101  }
Here is the caller graph for this function:

◆ search()

FoundList org.turro.elephant.search.Search.search ( String  value,
boolean  ignoreCase 
)

Definition at line 70 of file Search.java.

70  {
71  if(results == null) {
72  results = new FoundList();
73  if(value != null && value.length() > 0) {
74  ISearchable[] els = getElements();
75  for(int i = 0; i < els.length; i++) {
76  results.addResults((els[i]).search(value, ignoreCase));
77  }
78  }
79  }
80  return results;
81  }
void addResults(FoundList newList)
Definition: FoundList.java:60
ISearchable[] getElements()
Definition: Search.java:46
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startConstruction()

void org.turro.elephant.search.Search.startConstruction ( ) throws ServletException, IOException

This method start element's construction. It gets called within IConstructor.startConstruction().

Exceptions
javax.servlet.ServletException
java.io.IOException

Implements org.turro.elephant.context.IElement.

Definition at line 84 of file Search.java.

84  {
85  getConstructor().addCSS("/_internal/css/search.css");
87  PrintWriter out = getConstructor().getOut();
88  out.print(getStart());
89  out.print(getStartBody());
90  getConstructor().setRequestAttribute("_search", this);
92  "/WEB-INF/elephant/elements/search.jsp"
93  );
94  out.print(getEndBody());
95  out.print(getEnd());
96  }
void setRequestAttribute(String key, Object value)
Here is the call graph for this function:

Member Data Documentation

◆ localizer

Localizer org.turro.elephant.search.Search.localizer
protected

Definition at line 39 of file Search.java.

◆ results

FoundList org.turro.elephant.search.Search.results = null
protected

Definition at line 40 of file Search.java.


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