|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.windward.datasource.dom4j.Dom4jDataSource
This supplies a data source to Windward Reports using dom4j. Dom4j is an xml DOM wrapper. This class is the reference
implementation for net.windward.datasource.
To reference a data element from a <wr:forEach ... var="item" > or <wr:query ... var="item" > tag inside
another tag, use the following construct: '${item}/xpath' where xpath is an xpath reference from the node defined by
item and the reference will return a single element.
When inside a forEach where step='N' where N > 1, you can also use ${item[1]}/xpath ... ${item[N-1]}/xpath to
reference data for the N rows in each step. ${item[0]}/xpath is legal but redundent. You can also use <wr:if
test='$item[1]}'> which will return true if the row[1] exists. Keep in mind that [1], [2], ... is not an absolute
count but an offset from the base row presently on in the loop. And you cannot index past the set of rows that are
the row presently on and the rows that will be skipped by step.
| Constructor Summary | |
Dom4jDataSource(org.w3c.dom.Document document)
Create a DataSourceProvider that uses dom4j to traverse an xml stream. |
|
Dom4jDataSource(org.dom4j.Element node)
Create a DataSourceProvider that uses dom4j to traverse an xml stream. |
|
Dom4jDataSource(java.io.InputStream xmlData)
Create a DataSourceProvider that uses an xml stream as the data and dom4j to traverse it. |
|
Dom4jDataSource(java.lang.String xmlData)
Create a DataSourceProvider that uses an xml stream as the data and dom4j to traverse it. |
|
| Method Summary | |
void |
close()
Called when processing is complete. |
java.lang.String |
dump()
Display the entire dataset. |
DataSourceNode |
getRootNode()
Returns the root node for this data set. |
TagAttributes[] |
getTagAttributes()
Returns the allowed attributes for all tags. |
void |
log()
Log all info about this datasource to debug. |
void |
setMap(java.util.Map map)
Adds a map that is used for ${variable} substitution. |
void |
validateTag(BaseTag xmlTag)
Verifys that a tag has all required attributes and no unknown attributes. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Dom4jDataSource(java.io.InputStream xmlData)
throws DataSourceException
xmlData - A well formed xml data file.DataSourceException - thrown if anything goes wrong.
public Dom4jDataSource(java.lang.String xmlData)
throws DataSourceException
xmlData - A well formed xml data file.DataSourceException - thrown if anything goes wrong.public Dom4jDataSource(org.dom4j.Element node)
node - a Node created in dom4j pointing to all or part of a xml tree.public Dom4jDataSource(org.w3c.dom.Document document)
document - a w3c Document.| Method Detail |
public TagAttributes[] getTagAttributes()
getTagAttributes in interface DataSourceProvider
public void validateTag(BaseTag xmlTag)
throws TagException
validateTag in interface DataSourceProviderxmlTag - The tag to checkTagException - thrown if illegal parameters passed in.public void setMap(java.util.Map map)
setMap in interface DataSourceProvidermap - The map of string pairs.public DataSourceNode getRootNode()
getRootNode in interface DataSourceProviderpublic void close()
close in interface DataSourceProvidernet.windward.datasource.DataSourceProviderDataSourceException - Could not retrieve the data. Generally wraps a SqlException or XpathException.public void log()
log in interface DataSourceProvider
public java.lang.String dump()
throws DataSourceException
dump in interface DataSourceProviderDataSourceException - thrown if has any problems reading the dataset.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||