com.arsdigita.acs.html
Class DimensionalBar
java.lang.Object
|
+--com.arsdigita.acs.html.DimensionalBar
- public class DimensionalBar
- extends Object
Displays a table of links that can be used to
limit database query results.
Method Summary |
void |
addValue(String id,
String value,
String text,
String sqlClause)
Specifies an additional choice for one of the dimensions specified by addVariable. |
void |
addVariable(String id,
String title,
String defaultValue)
Specifies a dimension along which to choose. |
String |
getDimensionalSql()
Returns a SQL fragment for inclusion in the where clause of a query. |
void |
setUrl(String url)
Sets the target for the links that are generated. |
void |
setValues(AdSet selectedValues)
Specifies the values to be highlighted. |
String |
toString()
Returns an HTML fragment that displays all the choices that have been configured
with the addVariable and addValue methods. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DimensionalBar
public DimensionalBar(PageContext pc)
throws ACSException
addVariable
public void addVariable(String id,
String title,
String defaultValue)
- Specifies a dimension along which to choose.
- Parameters:
id
- the name of the URL variabletitle
- the title of this variable, for displaying as a column header
along the top of the DimensionalBardefaultValue
- the value to display as selected, if a particular
value has not already been chosen by the user
addValue
public void addValue(String id,
String value,
String text,
String sqlClause)
- Specifies an additional choice for one of the dimensions specified by addVariable.
- Parameters:
id
- the name of the URL variable which may contain this valuevalue
- the value to assign to the URL variable when the user chooses this valuetext
- the text to display for the valuesqlClause
- the restriction to apply to a SQL query involving this variable.
This is a SQL expression that can follow "where" in a query. The
word "where" should not be included. The empty string is an allowable
value if no restriction should be added for this value (for example, the value
represents "All")
toString
public String toString()
- Returns an HTML fragment that displays all the choices that have been configured
with the addVariable and addValue methods.
- Overrides:
toString
in class Object
getDimensionalSql
public String getDimensionalSql()
- Returns a SQL fragment for inclusion in the where clause of a query. The fragment
is generated by choosing the sqlClause for the selected (or default) value for each dimension.
setUrl
public void setUrl(String url)
- Sets the target for the links that are generated.
This is an optional parameter; by default the url of
the current page is used, obtained from the PageContext.
setValues
public void setValues(AdSet selectedValues)
- Specifies the values to be highlighted. This is an optional
parameter; by default we use the form variables submitted
to the current page.