com.arsdigita.search.ui
Class BaseQueryComponent

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.SimpleContainer
                      extended bycom.arsdigita.search.ui.QueryComponent
                          extended bycom.arsdigita.search.ui.BaseQueryComponent
All Implemented Interfaces:
Cloneable, Component, Container, Lockable, QueryGenerator

public class BaseQueryComponent
extends QueryComponent

This is a simple extension of the QueryComponent that provides management of the 'terms' parameter and uses FilterGenerators to populate a query specification

Typical use would be as follows:

 Form f = new Form("search");
 BaseQueryComponent q = new BaseQueryComponent();
 q.add(new ObjectTypeFilterComponent("com.arsdigita.kernel.User");
 q.add(new PermissionGenerator(PrivilegeDescriptor.READ));
 q.add(new Submit("Go"));
 f.add(q);


Field Summary
 
Fields inherited from class com.arsdigita.bebop.SimpleContainer
versionId
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
BaseQueryComponent()
          Creates a new query component
 
Method Summary
protected  void findFilters(Set filters)
           
protected  void generateErrorXML(PageState state, Element parent)
           
 void generateXML(PageState state, Element parent)
          Generates the XML for this container.
protected  FilterSpecification[] getFilters(PageState state)
          Returns the current filter specifications
protected  String getTerms(PageState state)
          Gets the current search terms
 void register(Form form, FormModel model)
          Registers form parameters with the form model for this form.
 void register(Page p)
          Registers state parameters for the page with its model.
 
Methods inherited from class com.arsdigita.search.ui.QueryComponent
getQuerySpecification, hasQuery
 
Methods inherited from class com.arsdigita.bebop.SimpleContainer
add, add, children, contains, generateChildrenXML, generateParent, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Constructor Detail

BaseQueryComponent

public BaseQueryComponent()
Creates a new query component

Method Detail

register

public void register(Page p)
Description copied from interface: Component
Registers state parameters for the page with its model. A simple component with a state parameter param would do the following in the body of this method:
   p.addComponent(this);
   p.addComponentStateParam(this, param);
 
You should override this method to set the default visibility of your component:
 public void register(Page p) {
     super.register(p);
     p.setVisibleDefault(childNotInitiallyShown,false);
     p.setVisibleDefault(anotherChild, false);
 }
 
Always call super.register when you override register. Otherwise your component may malfunction and produce errors like "Widget ... isn't associated with any Form"

Specified by:
register in interface Component
Overrides:
register in class SimpleComponent

register

public void register(Form form,
                     FormModel model)
Description copied from interface: Component
Registers form parameters with the form model for this form. This method is only important for form sections and widgets (components that have a connection to an HTML form). Other components can implement it as a no-op.

Specified by:
register in interface Component
Overrides:
register in class SimpleComponent

getTerms

protected String getTerms(PageState state)
Gets the current search terms

Specified by:
getTerms in class QueryComponent
Returns:
the query terms, or null

getFilters

protected FilterSpecification[] getFilters(PageState state)
Description copied from class: QueryComponent
Returns the current filter specifications

Specified by:
getFilters in class QueryComponent
Returns:
the list of filter specs

generateXML

public void generateXML(PageState state,
                        Element parent)
Description copied from class: SimpleContainer
Generates the XML for this container. If the tag property is nonempty, wraps the children in the specified XML tag.

Specified by:
generateXML in interface Component
Overrides:
generateXML in class SimpleContainer
Parameters:
state - represents the current request
parent - the parent XML element
See Also:
SimpleContainer.setTag(String), SimpleContainer.setNamespace(String)

generateErrorXML

protected void generateErrorXML(PageState state,
                                Element parent)

findFilters

protected void findFilters(Set filters)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC