com.arsdigita.search.ui
Class BaseQueryComponent
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.SimpleContainer
com.arsdigita.search.ui.QueryComponent
com.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);
Fields inherited from class com.arsdigita.bebop.BlockStylable |
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP |
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.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
Methods inherited from interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
BaseQueryComponent
public BaseQueryComponent()
- Creates a new query component
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 requestparent
- 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