ro.nextreports.engine.chart
Class ChartRunner

Package class diagram package ChartRunner
java.lang.Object
  extended by ro.nextreports.engine.chart.ChartRunner
All Implemented Interfaces:
Runner

public class ChartRunner
extends java.lang.Object
implements Runner


Field Summary
static java.lang.String GRAPHIC_FORMAT
           
static java.lang.String IMAGE_FORMAT
           
static java.lang.String TABLE_FORMAT
           
 
Constructor Summary
ChartRunner()
           
 
Method Summary
 ro.nextreports.engine.exporter.util.AlarmData getAlarmData()
          Get alarm data ALARM exporter
 Chart getChart()
          Get next chart object
 java.lang.String getChartImageAbsolutePath()
          Get chart image asbolute path after export with IMAGE_FORMAT
 java.lang.String getChartImageName()
          Get chart image name after export with IMAGE_FORMAT
 java.sql.Connection getConnection()
          Get database connection
 java.lang.String getFormat()
          Get output format
 ro.nextreports.engine.exporter.util.IndicatorData getIndicatorData()
          Get indicator data INDICATOR exporter
 java.util.Map<java.lang.String,java.lang.Object> getParameterValues()
          Get parameters values
 int getQueryTimeout()
          Get query execution timeout
 ro.nextreports.engine.exporter.util.TableData getTableData()
          Get table data TABLE exporter
 boolean run()
          Export the current chart to table
 boolean run(java.io.OutputStream stream)
          Export the current chart to the specified output format For IMAGE_FORMAT use withImagePath method.
 void setChart(Chart chart)
          Set next chart object
 void setConnection(java.sql.Connection connection)
          Set database connection
 void setConnection(java.sql.Connection connection, boolean csv)
          Set database connection
 void setDrillFunction(java.lang.String drillFunction)
          Set a drill function for onclick action
 void setFormat(java.lang.String format)
          Set output format
 void setImageHeight(int imageHeight)
          Set image height : has meaning just for IMAGE_FORMAT type if not set, default value is 300
 void setImageName(java.lang.String imageName)
          Set image name : has meaning just for IMAGE_FORMAT type
 void setImagePath(java.lang.String imagePath)
          Set image path : has meaning just for IMAGE_FORMAT type
 void setImageWidth(int imageWidth)
          Set image width : has meaning just for IMAGE_FORMAT type if not set, default value is 500
 void setParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
          Set parameters values parameterValues is a map of parameters values where the key is the parameter name and the value is the parameter value(s) Such parameter value can be a simple java object if the parameter has SINGLE SELECTION, or in case of MULTIPLE SELECTION value is an array Object[] of java objects.
 void setQueryTimeout(int queryTimeout)
          Set query execution timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAPHIC_FORMAT

public static final java.lang.String GRAPHIC_FORMAT
See Also:
Constant Field Values

TABLE_FORMAT

public static final java.lang.String TABLE_FORMAT
See Also:
Constant Field Values

IMAGE_FORMAT

public static final java.lang.String IMAGE_FORMAT
See Also:
Constant Field Values
Constructor Detail

ChartRunner

public ChartRunner()
Method Detail

getConnection

public java.sql.Connection getConnection()
Get database connection

Returns:
database connection

setConnection

public void setConnection(java.sql.Connection connection)
Set database connection

Parameters:
connection - database connection

setConnection

public void setConnection(java.sql.Connection connection,
                          boolean csv)
Set database connection

Parameters:
connection - database connection
csv - true for a csv file connection

getChart

public Chart getChart()
Get next chart object

Returns:
next chart object

setChart

public void setChart(Chart chart)
Set next chart object

Parameters:
chart - next chart object

getFormat

public java.lang.String getFormat()
Get output format

Returns:
output format

setFormat

public void setFormat(java.lang.String format)
Set output format

Parameters:
format - output format

getParameterValues

public java.util.Map<java.lang.String,java.lang.Object> getParameterValues()
Get parameters values

Returns:
parameters values

setParameterValues

public void setParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
Set parameters values parameterValues is a map of parameters values where the key is the parameter name and the value is the parameter value(s) Such parameter value can be a simple java object if the parameter has SINGLE SELECTION, or in case of MULTIPLE SELECTION value is an array Object[] of java objects. For an empty list of values , the value must be : new Object[]{ParameterUtil.NULL} If we programatically add value(s) in parameterValues for a hidden parameter, the default values for that hidden parameter will be ignored and the engine will use those from the map.

Parameters:
parameterValues - parameters values

getQueryTimeout

public int getQueryTimeout()
Get query execution timeout

Returns:
query execution timeout in seconds

setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Set query execution timeout

Parameters:
queryTimeout - query execution timeout in seconds

setDrillFunction

public void setDrillFunction(java.lang.String drillFunction)
Set a drill function for onclick action

Parameters:
drillFunction - drill function text

run

public boolean run()
            throws ReportRunnerException,
                   ro.nextreports.engine.exporter.exception.NoDataFoundException,
                   java.lang.InterruptedException
Export the current chart to table

Specified by:
run in interface Runner
Returns:
true if export process finished, or false if export process crashed
Throws:
ReportRunnerException - if ChartRunner object is not correctly configured
ro.nextreports.engine.exporter.exception.NoDataFoundException - if chart has no data
java.lang.InterruptedException - if process was interrupted

run

public boolean run(java.io.OutputStream stream)
            throws ReportRunnerException,
                   ro.nextreports.engine.exporter.exception.NoDataFoundException,
                   java.lang.InterruptedException
Export the current chart to the specified output format For IMAGE_FORMAT use withImagePath method.

Specified by:
run in interface Runner
Parameters:
stream - output stream to write the exported chart
Returns:
true if export process finished, or false if export process crashed
Throws:
ReportRunnerException - if ChartRunner object is not correctly configured
ro.nextreports.engine.exporter.exception.NoDataFoundException - if chart has no data
java.lang.InterruptedException - if process was interrupted

getTableData

public ro.nextreports.engine.exporter.util.TableData getTableData()
Get table data TABLE exporter

Specified by:
getTableData in interface Runner
Returns:
table data for TABLE exporter

getAlarmData

public ro.nextreports.engine.exporter.util.AlarmData getAlarmData()
Get alarm data ALARM exporter

Specified by:
getAlarmData in interface Runner
Returns:
alarm data for ALARM exporter

getIndicatorData

public ro.nextreports.engine.exporter.util.IndicatorData getIndicatorData()
Get indicator data INDICATOR exporter

Specified by:
getIndicatorData in interface Runner
Returns:
indicator data for INDICATOR exporter

setImagePath

public void setImagePath(java.lang.String imagePath)
Set image path : has meaning just for IMAGE_FORMAT type

Parameters:
imagePath - image path

setImageName

public void setImageName(java.lang.String imageName)
Set image name : has meaning just for IMAGE_FORMAT type

Parameters:
imageName - image name

setImageWidth

public void setImageWidth(int imageWidth)
Set image width : has meaning just for IMAGE_FORMAT type if not set, default value is 500

Parameters:
imageWidth - image width

setImageHeight

public void setImageHeight(int imageHeight)
Set image height : has meaning just for IMAGE_FORMAT type if not set, default value is 300

Parameters:
imageHeight - image height

getChartImageName

public java.lang.String getChartImageName()
Get chart image name after export with IMAGE_FORMAT

Returns:
chart image name after export

getChartImageAbsolutePath

public java.lang.String getChartImageAbsolutePath()
Get chart image asbolute path after export with IMAGE_FORMAT

Returns:
chart image absolute path after export