|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.SQLValueProvider
com.inet.report.FieldValueProvider
com.inet.report.CascadingValueProvider
public class CascadingValueProvider
Creates a CascadingValueProvider which provides default values for a prompt based on a value of a parent prompt field.
The parent prompt field itself must have a FieldValueProvider so that the possible default values can be filtered with a "WHERE" condition in the query.
For example, a PromptField with a FieldValueProvider pointing to a database field representing countries could be set as a parent for a CascadingValueProvider pointing to a database field representing cities. When the default values are fetched, the value for the country is placed in the "WHERE" condition, thereby only providing the cities in the given country.
| Field Summary |
|---|
| Fields inherited from class com.inet.report.SQLValueProvider |
|---|
MAX_RECORDS |
| Constructor Summary | |
|---|---|
CascadingValueProvider(PromptField parent,
CascadingSource parentSource,
DatabaseField values,
DatabaseField descriptions,
int sortType)
Initializes a CascadingValueProvider with the given parent, value field and (optionally) description field, as well as the desired sort type. |
|
| Method Summary | |
|---|---|
DefaultValue[] |
getDefaultValues()
Returns an array of DefaultValue objects for a prompt field. |
PromptField |
getParent()
Returns the set parent prompt field |
CascadingSource |
getParentSource()
Returns the parent source which provides the reference name for the parent prompt when referencing it in the generated SQL query. |
java.lang.String |
getSQL()
Returns the query which is to be used for fetching the values and optionally descriptions dynamically. |
NodeParser |
parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
Internal method for reading report XML Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. |
void |
setParent(PromptField parent)
Sets the parent prompt field which is to be used for filtering the default values. |
void |
setParentSource(CascadingSource parentSource)
Sets the parent source for this cascading prompt that will provide the reference name of the parent to use in the generated SQL query. |
| Methods inherited from class com.inet.report.FieldValueProvider |
|---|
getDatasource, getDescriptions, getFieldRefName, getSQL, getSortType, getValues, setDatasource, setDescriptions, setSortType, setValues |
| Methods inherited from interface com.inet.report.parser.NodeParser |
|---|
isDOMParser, parseDOM, parseEndElement, parseText |
| Constructor Detail |
|---|
public CascadingValueProvider(PromptField parent,
CascadingSource parentSource,
DatabaseField values,
DatabaseField descriptions,
int sortType)
parent - Parent prompt field, may not be nullparentSource - Provider of the SQL reference name for the parentvalues - Default values' value fielddescriptions - Default values' descriptions fieldsortType - Desired sort type
java.lang.IllegalArgumentException - if the parent prompt field is null or does not have a FieldValueProvider, or if the values field is null or if the sort type is invalidSortField.ORIGINAL_ORDER,
SortField.ASCENDING_ORDER,
SortField.DESCENDING_ORDER,
CascadingSource,
FieldValueProvider| Method Detail |
|---|
public PromptField getParent()
public void setParent(PromptField parent)
parent - Parent prompt field, may not be null and must have a FieldValueProvider
java.lang.IllegalArgumentException - if the parent prompt field is null or does not have a FieldValueProvider,public DefaultValue[] getDefaultValues()
getDefaultValues in interface DynamicValueProvidergetDefaultValues in class SQLValueProviderpublic java.lang.String getSQL()
getSQL in class FieldValueProviderpublic void setParentSource(CascadingSource parentSource)
parentSource - parent source which provides the reference name of the parent to use in the query, may not be null
java.lang.IllegalArgumentException - if the parent source given is nullpublic CascadingSource getParentSource()
public NodeParser parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
throws FatalParserException
Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
parseElement in interface NodeParserparseElement in class FieldValueProvidergroup - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group
of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag - The XMLTag to be parsedatts - The set of attributes in the current XMLTagparserMap - The map of current Parser.
FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the
reading of the report.
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||