java.lang.Object
org.jdaemon.era.xml.GenericTotal
- public class GenericTotal
- extends java.lang.Object
This is a helper class used for inserting totals after groups breaks. This class is used by XMLCube for totaling non numeric fields for
each report. The group breaks and columns which need to be totaled are passed in as an argument. The class accepts a Document object for XML
and arrays for group list and total columns. The first group should be the first element in the groupby arrray
|
Constructor Summary |
GenericTotal()
This is a no argument constructor for the class |
|
Method Summary |
org.w3c.dom.Document |
insertTotals(org.w3c.dom.Document doc,
java.lang.String[] groupby,
java.lang.String[] totalafter,
java.lang.String[] totalon,
java.util.Map attributeMetadataMap)
This method is called on the reuqest of client. |
private void |
insertTotalsRow(org.w3c.dom.Document doc,
org.w3c.dom.Node rootNode,
org.w3c.dom.Node refNode,
java.lang.String[] colname,
double[] data,
java.lang.String grouplevel,
java.lang.String groupbreak)
This method is private to this class. |
static void |
main(java.lang.String[] args)
This method can be used to test this class from command prompt. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.log4j.Logger log
- Logger
format
java.text.DecimalFormat format
- The format object used to convert the exponent value representation into a normal number.
totalonLevelDependent
java.util.Set[] totalonLevelDependent
GenericTotal
public GenericTotal()
- This is a no argument constructor for the class
main
public static void main(java.lang.String[] args)
- This method can be used to test this class from command prompt. The XML file needs to be argument passed to this class. The
groupby and total columns are hardcoded.
insertTotals
public org.w3c.dom.Document insertTotals(org.w3c.dom.Document doc,
java.lang.String[] groupby,
java.lang.String[] totalafter,
java.lang.String[] totalon,
java.util.Map attributeMetadataMap)
- This method is called on the reuqest of client. This method accepts the request from client and calls
different methods and processes the request. This method delegates the request to handleRequest,
which internally delegates it to the corresponding handler as per the Source value. The referece of
handler class is obtained from the Action mapping class. After getting the processing done from
hander class. The request is dispatched to the corresponding url for action value (display type).
The url is obtained from the Action Mapping class
insertTotalsRow
private void insertTotalsRow(org.w3c.dom.Document doc,
org.w3c.dom.Node rootNode,
org.w3c.dom.Node refNode,
java.lang.String[] colname,
double[] data,
java.lang.String grouplevel,
java.lang.String groupbreak)
- This method is private to this class. It is internally used to append the totals row inside the XML Document. All the
data required to create the DataRow is passed as an argument.
param Document doc -- The XML document which is being processed
param Node rootNode -- The root node of the document which is getting processed
param Node refNode -- The Element before which the totals row needs to be inserted
param String[] colname -- The column names for which the total is begin added
param String[] data -- The total data
param String grouplevel -- The grouping level for which the total is inserted.