com.ibm.commerce.tools.reporting.reports
Class ReportDataBean

java.lang.Object
  |
  +--com.ibm.commerce.beans.InputDataBeanImpl
        |
        +--com.ibm.commerce.beans.SmartDataBeanImpl
              |
              +--com.ibm.commerce.tools.reporting.reports.ReportDataBean
All Implemented Interfaces:
DataBean, InputDataBean, java.io.Serializable, SmartDataBean

public class ReportDataBean
extends SmartDataBeanImpl

The ReportDataBean class extends the SmartDataBeanImpl class to create a report. ReportDataBean is used on the JSP displaying the report data. ReportDataBean will be populated by the use of DataBeanManager.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector _columnTitles
          Vector containing the keys for the Hashtable representing the rows of the report.
protected  java.util.Vector _columnTitlesName
          Vector containing the colum names.
protected  java.util.Hashtable _env
          Variable for the hashtable containing the input parameters to construct the SQL query to generate the report.
protected  int _errorCode
          Numeric value indicating if the report ran successfully or not.
protected  java.util.Locale _locale
          Variable for the locale used.
protected  java.lang.String _messageValue
          Variable for the key of _messageValue.
protected  int _numberOfColumns
          Variable for the number of columns in the report.
protected  int _numberOfRows
          Variable for the number of rows in the report.
protected  TypedProperty _queryParameters
          Not used.
protected  java.util.Vector _reportData
          Vector containing the data generated by the report.
protected  java.lang.String _sqlId
          Parameter for the SQL id used for this report.
protected  java.lang.String _title
          Variable used for the title of the report.
protected  java.lang.Object _userDefinedParameters
          Variable for the user defined parameters from the XML file defining the report.
protected  java.util.Hashtable _xml
          Not used.
static java.lang.String COPYRIGHT
          Copyright
 
Fields inherited from class com.ibm.commerce.beans.SmartDataBeanImpl
commandContext
 
Fields inherited from class com.ibm.commerce.beans.InputDataBeanImpl
requestProperties
 
Fields inherited from interface com.ibm.commerce.beans.DataBean
emptyString
 
Constructor Summary
ReportDataBean()
          Constructs a ReportDataBean object.
 
Method Summary
protected  java.util.Hashtable constructEnv()
          Method used to construct the hashtable used to generate the report.
 java.lang.String getColumnTitles(int i)
          Getter for an element of the Vector _columnTitles.
 java.util.Vector getColumnTitlesName()
          Getter for _columnTitlesName.
 java.lang.String getColumnTitlesName(int i)
          Getter for a specific element of the Vector _columnTitlesName.
 java.util.Hashtable getEnv()
          Getter for _env.
 int getErrorCode()
          Getter for _errorCode.
 java.lang.String getMessageValue()
          Getter for _messageValue.
 int getNumberOfColumns()
          Getter for _numberOfColumns.
 int getNumberOfRows()
          Getter for _numberOfRows.
 java.util.Vector getReportData()
          Getter for _reportData.
 java.util.Hashtable getRow(int i)
          Getter for a specific element (row of the report) of the Vector _reportData.
 java.lang.String getSqlId()
          Getter for _sqlId.
 java.lang.String getTitleName()
          Getter for _title.
 java.lang.Object getUserDefinedParameters()
          Getter for _userDefinedParameters.
 java.lang.String getValue(int i, int j)
          Getter for a value from _reportData.
 java.lang.String getValue(int i, java.lang.String key)
          Getter for a value from _reportData.
protected  void initialize()
          Used to initialize the following variables: _numberOfColumns, _numberOfRows and _reportData.
protected  java.util.Vector keyListToVector(java.lang.String keyList)
          This method will transform a string into a vector of keys.
 void populate()
          Method used to populate the ReportDataBean.
 void setEnv(java.util.Hashtable env)
          Setter for _env.
 void setLocale(java.util.Locale locale)
          Setter for _locale.
 void setParameters(TypedProperty queryParameters)
          Setter for _queryParameters.
 void setSqlId(java.lang.String sqlId)
          Setter for _sqlId.
 void setXML(java.util.Hashtable xml)
          Setter for _xml.
 
Methods inherited from class com.ibm.commerce.beans.SmartDataBeanImpl
fulfills, getCommandContext, getResources, setCommandContext
 
Methods inherited from class com.ibm.commerce.beans.InputDataBeanImpl
getRequestProperties, setRequestProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.beans.InputDataBean
getRequestProperties, setRequestProperties
 

Field Detail

_columnTitles

protected java.util.Vector _columnTitles
Vector containing the keys for the Hashtable representing the rows of the report.

_columnTitlesName

protected java.util.Vector _columnTitlesName
Vector containing the colum names.

_env

protected java.util.Hashtable _env
Variable for the hashtable containing the input parameters to construct the SQL query to generate the report.

_errorCode

protected int _errorCode
Numeric value indicating if the report ran successfully or not.

_locale

protected java.util.Locale _locale
Variable for the locale used.

_messageValue

protected java.lang.String _messageValue
Variable for the key of _messageValue.

_numberOfColumns

protected int _numberOfColumns
Variable for the number of columns in the report.

_numberOfRows

protected int _numberOfRows
Variable for the number of rows in the report.

_queryParameters

protected TypedProperty _queryParameters
Not used.

_reportData

protected java.util.Vector _reportData
Vector containing the data generated by the report. The elements of the vector are Hashtable. Each element of the vector represent a row of the report.

_sqlId

protected java.lang.String _sqlId
Parameter for the SQL id used for this report. The SQL id corresponds to a SQL statement used to generate the report.

_title

protected java.lang.String _title
Variable used for the title of the report. Defined in the XML file defining the report.

_userDefinedParameters

protected java.lang.Object _userDefinedParameters
Variable for the user defined parameters from the XML file defining the report.

_xml

protected java.util.Hashtable _xml
Not used.

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright
Constructor Detail

ReportDataBean

public ReportDataBean()
Constructs a ReportDataBean object. From that object, we will get the data to be displayed on the JSP.
Method Detail

constructEnv

protected java.util.Hashtable constructEnv()
Method used to construct the hashtable used to generate the report. The hashtable will be constructed from the requestProperties and the value of keyList.
Returns:
The hashtable used in the creation of the SQL query.
Throws:
ECSystemException -  
ParameterNotFoundException -  

getColumnTitles

public java.lang.String getColumnTitles(int i)
Getter for an element of the Vector _columnTitles.
Returns:
The key for the columns title.

getColumnTitlesName

public java.util.Vector getColumnTitlesName()
Getter for _columnTitlesName.
Returns:
The vector of column title names.

getColumnTitlesName

public java.lang.String getColumnTitlesName(int i)
Getter for a specific element of the Vector _columnTitlesName.
Returns:
The column title name at position i from the vector.

getEnv

public java.util.Hashtable getEnv()
Getter for _env.
Returns:
The hashtable used to substitute in the variables in the SQL query.

getErrorCode

public int getErrorCode()
Getter for _errorCode.
Returns:
The error code indicating success or failure in running the SQL query

getMessageValue

public java.lang.String getMessageValue()
Getter for _messageValue.
Returns:
The key for a descriptive message for the report.

getNumberOfColumns

public int getNumberOfColumns()
Getter for _numberOfColumns.
Returns:
The number of columns in the report.

getNumberOfRows

public int getNumberOfRows()
Getter for _numberOfRows.
Returns:
The number of rows in the report.

getReportData

public java.util.Vector getReportData()
Getter for _reportData.
Returns:
The report data. It is a vector composed of hashtables. Each hashtable describes a row of the report.

getRow

public java.util.Hashtable getRow(int i)
Getter for a specific element (row of the report) of the Vector _reportData.
Parameters:
i - The row (i+1) in the report.
Returns:
The hashtable representing a row of the report.

getSqlId

public java.lang.String getSqlId()
Getter for _sqlId.
Returns:
The SQL id for the SQL query to be used to generate the report.

getTitleName

public java.lang.String getTitleName()
Getter for _title.
Returns:
The key for the title of the report.

getUserDefinedParameters

public java.lang.Object getUserDefinedParameters()
Getter for _userDefinedParameters.
Returns:
The object corresponding to the element in the XML file.

getValue

public java.lang.String getValue(int i,
                                 int j)
Getter for a value from _reportData.
Parameters:
i - The row (i+1) of the report.
j - The position of the column key in the vector _columnTitles.
Returns:
A value in the report.

getValue

public java.lang.String getValue(int i,
                                 java.lang.String key)
Getter for a value from _reportData.
Parameters:
i - The row (i+1) of the report.
key - The column key in the vector _columnTitles.
Returns:
A value in the report.

initialize

protected void initialize()
Used to initialize the following variables: _numberOfColumns, _numberOfRows and _reportData.

keyListToVector

protected java.util.Vector keyListToVector(java.lang.String keyList)
This method will transform a string into a vector of keys.
Parameters:
keyList - The string of keys separated by comma to transform into a vector of keys.
Returns:
Vector of keys.

populate

public void populate()
              throws java.lang.Exception
Method used to populate the ReportDataBean. This method will be ran by the DataBeanManager. After running the DataBeanManager, the different getters must be used to display the data.
Overrides:
populate in class SmartDataBeanImpl

setEnv

public void setEnv(java.util.Hashtable env)
Setter for _env.
Parameters:
env - The hashtable for the parameters used to create the SQL query.

setLocale

public void setLocale(java.util.Locale locale)
Setter for _locale.
Parameters:
locale - The locale to be used for display.

setParameters

public void setParameters(TypedProperty queryParameters)
Setter for _queryParameters. Not used.

setSqlId

public void setSqlId(java.lang.String sqlId)
Setter for _sqlId.
Parameters:
sqlId - The SQL id used to identify which SQL query to be used.

setXML

public void setXML(java.util.Hashtable xml)
Setter for _xml. Not used.