com.intersys.jsp
Class PushViewTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
com.intersys.jsp.TableSupportTag
com.intersys.jsp.PushViewTag
- All Implemented Interfaces:
- IterationTag, Serializable, Tag
- public class PushViewTag
- extends TableSupportTag
Creates a new SQL view based on user selections.
The goal of PushViewTag is to create a new view from a current one,
so that only elements satisfying given set of conditions from the
current view are included in the new. Those conditions are taken from
HTTP request parameters.
PushViewTag analizes request to find successful search
elements. Successful elements are elements for which something was
selected in there SELECT list. Because each SELECT element can also
be followed be a number of additional hidden elements which are
always successful in HTTP sense, the successful search elements are
identified by its name. Name for search element can be constructed in
2 ways. It is either:
- Name of the column for the current view (normally a name of the
column in base table).
- Name of the column for the current view followed by ".XName."
and additional name.
For example if the view has column Services, then name for a search
element can be either of the following: "Services",
"Services.XName.Included" or "Services.XName.Optional". Thus one
search options page can contain 2 or more different search elements
refferring to the same table column but having different additional
conditions (see below).
Additional hidden elements should have form of
<SearchElementName>.<addInfo>. In case of "XName" elements, "XName"
itself is ommited. Thus the additional element, defining condition
for search element named "Services.XName.Included" will be like
"Services.Included.condition=\"Provider.Services.Value='INCLUDED'\"".
PushViewTag constructs SQL request in the following way:
- Table-reference-list for FROM includes:
- The current view.
- All tables specified as child tables for this request (see
definition of child tables for request below).
- Tables, specified as extra tables for this request. The are
identified by "extratables" additional element. These tables are
added only if there is at least one successful base search element
with the same name. In this way hidden controls which are always
successful in HTTP terms do not affect SQL statement if there were no
user selections in visible elements.
- Search condition for WHERE includes:
- Conditions, derived from user selections. See below for more
detailed description.
- Additional conditions, defined by "condition" additional
element.
Search elements, based on properties projected to SQL not as
columns for base tables but as child tables processed in a
special way. First, such elements are identified in request by their
names (plane or with ".XName."). Corresponding tables are added to
FROM table list (see above). Then the column in child table which is
used in search is identified by additional element "key". For example
if search element named "Services.XName.Included" is determined to
correspond to a child table, the additional parameter with name
"Services.Included.key" is identified and its value used as the
column name. This functionality is actively used by childlist tag
(implemented by ChildListTag class).
Normally, the main search condition derived from user selections
is that designated column of the table is equal to selected
value. Designated column is either column of the base table
corresponding to the named search element or column of the child
table defined as above. However, instead of simple equality one can
use a more complex expression. It is defined by "expression"
additioanl element. If it is desireable to use IN form instead of
equality than one should use "expressionin" additioanl element. If
both "expression" and "expressionin" are specified than the former is
used in case of single request parameter and the latter in case of
multiple parameters.
- See Also:
- Serialized Form
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
PushViewTag
public PushViewTag()
doStartTag
public int doStartTag()
throws JspException
- Throws:
JspException
doEndTag
public int doEndTag()
throws JspException
- Throws:
JspException
getContext
public String getContext()
setContext
public void setContext(String newContext)