org.ibisph.dao.chart.xml
Class QueryModuleResult

java.lang.Object
  extended by org.ibisph.dao.chart.AbstractDAO
      extended by org.ibisph.dao.chart.xml.QueryModuleResult
All Implemented Interfaces:
DAO

public class QueryModuleResult
extends AbstractDAO

Reads the query module result XML and loads into Chart Data object.

Author:
Garth Braithwaite, STG

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ibisph.dao.chart.AbstractDAO
AbstractDAO.DataValueParser
 
Field Summary
 
Fields inherited from class org.ibisph.dao.chart.AbstractDAO
valueFormatPattern
 
Constructor Summary
QueryModuleResult()
           
 
Method Summary
protected  int addTitleAndValueIndex(org.dom4j.Document document, java.util.Vector<java.lang.String> titles, java.util.Vector<java.lang.String> valueIndexes, java.lang.String dimensionName, java.lang.String dimensionValue)
          Manipulates the titles and value indexes vectors passed in based on the dimension name and dimension value.
protected static java.lang.String getDimensionTitle(org.dom4j.Document document, java.lang.String dimensionName)
          Get's the record's actual dimension title associated with the dimension name.
 void load(java.lang.Object object, ChartData chartData)
          Reads Query Result XML data and puts into the chart data object.
 
Methods inherited from class org.ibisph.dao.chart.AbstractDAO
setNumberFormatPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryModuleResult

public QueryModuleResult()
Method Detail

load

public void load(java.lang.Object object,
                 ChartData chartData)
          throws java.lang.Exception
Reads Query Result XML data and puts into the chart data object. This load differs from the ind profile chart data load in that it loops the query XML data and loads into vectors which are then looped/indexed to retrieve the real data that is then loaded into arrays. This was done because the dimension data could contain holes which if the stream were processed as it came in then we'd have a problem with series and categories.

Parameters:
object - Source Query Result XML document.
chartData - Destination object for the XML document to loaded into.
Throws:
java.lang.Exception

addTitleAndValueIndex

protected int addTitleAndValueIndex(org.dom4j.Document document,
                                    java.util.Vector<java.lang.String> titles,
                                    java.util.Vector<java.lang.String> valueIndexes,
                                    java.lang.String dimensionName,
                                    java.lang.String dimensionValue)
Manipulates the titles and value indexes vectors passed in based on the dimension name and dimension value.

Parameters:
document - Source XML document.
titles - Vector which contains titles to be manipulated.
valueIndexes - Vector which contains an index to the value.
dimensionName - Name of the dimension to be looked up.
dimensionValue - Value of the dimension to be looked up.
Returns:
Index to the title and value added.

getDimensionTitle

protected static java.lang.String getDimensionTitle(org.dom4j.Document document,
                                                    java.lang.String dimensionName)
Get's the record's actual dimension title associated with the dimension name.

Parameters:
document - Source XML data to be used.
dimensionName - Name of the dimension to be looked up.
Returns:
Dimnsion's title. If not found then a empty string is returned.