|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
net.ontopia.topicmaps.nav2.taglibs.tolog.ForEachTag
public class ForEachTag
INTERNAL: Tolog Tag for executing a query, iterating over each object in a result collection and creating new content for each iteration. The column names in the query result are accessible as variables in the body of the tag, and are bound to the query result row of that iteration. The groupBy attribute can be used to indicate that only some of the column names should be bound (yet), and that only lines which differ in those columns should produce new output. To access those columns, one can use another ForEachTag nested within this one, which has no query attribute, but uses the result set produced here. The nested ForEachTag can group by columns not yet grouped. This can format a tree-result like the following (using a single query): Asia China Beijing Shanghai India Delhi Europe Sweden Gothenburg
Field Summary | |
---|---|
protected static Collection |
FALSE
|
protected String |
groupBy
|
protected boolean[] |
groupColumns
|
protected ForEachTag |
groupingAncestor
|
protected Set |
groupNames
|
protected boolean |
hasValidated
|
protected boolean |
neverEvaluatedBody
|
protected List |
orderBy
|
protected String |
query
|
protected QueryWrapper |
queryWrapper
|
protected String |
separator
|
protected static String |
SEQUENCE_FIRST
|
protected static String |
SEQUENCE_LAST
|
protected static String |
SEQUENCE_NUMBER
|
protected int |
sequenceNumber
|
protected static Collection |
TRUE
|
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
ForEachTag()
Default constructor. |
Method Summary | |
---|---|
int |
doAfterBody()
Actions after some body has been evaluated. |
int |
doEndTag()
Process the end tag. |
int |
doStartTag()
Process the start tag for this instance. |
protected List |
getOrderBy()
Get the names to order by in this tag (to be used by nested tags for ordering |
protected QueryWrapper |
getQueryWrapper()
|
boolean |
needsCurrentRow()
Checks if this ForEachTag needs the current row of the query result. |
protected void |
processGroupBy()
Finds out which columns to group by based on a space separated string. |
void |
release()
Resets the state of the Tag. |
void |
setGroupBy(String groupBy)
|
void |
setQuery(String query)
|
void |
setSeparator(String separator)
|
protected void |
validateGroupByOrderBy()
Validate the groupNames against the names in orderBy. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setPageContext, setParent |
Field Detail |
---|
protected ForEachTag groupingAncestor
protected QueryWrapper queryWrapper
protected boolean[] groupColumns
protected Set groupNames
protected List orderBy
protected boolean hasValidated
protected int sequenceNumber
protected boolean neverEvaluatedBody
protected static final String SEQUENCE_FIRST
protected static final String SEQUENCE_NUMBER
protected static final String SEQUENCE_LAST
protected static final Collection FALSE
protected static final Collection TRUE
protected String query
protected String groupBy
protected String separator
Constructor Detail |
---|
public ForEachTag()
Method Detail |
---|
public int doStartTag() throws javax.servlet.jsp.JspTagException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspTagException
protected List getOrderBy()
public boolean needsCurrentRow()
protected void processGroupBy() throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
protected void validateGroupByOrderBy() throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
public int doAfterBody() throws javax.servlet.jsp.JspTagException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspTagException
protected QueryWrapper getQueryWrapper()
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public void setSeparator(String separator)
public void setGroupBy(String groupBy)
public void setQuery(String query)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |