Class PentahoTableDataFactory
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.AbstractDataFactory
-
- org.pentaho.platform.plugin.action.jfreereport.helper.PentahoTableDataFactory
-
- All Implemented Interfaces:
Serializable
,Cloneable
,org.pentaho.reporting.engine.classic.core.DataFactory
,org.pentaho.reporting.engine.classic.core.DataFactoryDesignTimeSupport
,org.pentaho.reporting.engine.classic.core.DataFactoryMetaProvider
public class PentahoTableDataFactory extends org.pentaho.reporting.engine.classic.core.AbstractDataFactory
The PentahoTableDataFactory class implements JFreeReport's data factory and manages the TableModels provided to JFreeReport. The primary difference between this class and JFreeReport's standard TableDataFactory is the "getTableIterator" method, which allows the Platform to clean up and table model resources after their use. Also, we support Pentaho's IPreparedComponent interface which allows a prepared component to generate a result set when requested.- Author:
- Will Gorman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PentahoTableDataFactory()
default constructorPentahoTableDataFactory(String name, TableModel tableModel)
constructor with one time call to addTable for convenience.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPreparedComponent(String name, org.pentaho.platform.api.data.IPreparedComponent component)
add a prepared component to the mapvoid
addTable(String name, TableModel tableModel)
add a table to the mapvoid
cancelRunningQuery()
PentahoTableDataFactory
clone()
void
close()
void
closeTables()
PentahoTableDataFactory
derive()
Derives a freshly initialized report data factory, which is independend of the original data factory.String[]
getQueryNames()
boolean
isQueryExecutable(String query, org.pentaho.reporting.engine.classic.core.DataRow parameters)
TableModel
queryData(String query, org.pentaho.reporting.engine.classic.core.DataRow parameters)
Queries a datasource.void
removeTable(String name)
remove a table from the map-
Methods inherited from class org.pentaho.reporting.engine.classic.core.AbstractDataFactory
calculateQueryLimit, calculateQueryTimeOut, getConfiguration, getContextKey, getDataFactoryContext, getDisplayConnectionName, getLocale, getMetaData, getQueryHash, getReferencedFields, getResourceBundleFactory, getResourceManager, initialize, queryDesignTimeStructure
-
-
-
-
Constructor Detail
-
PentahoTableDataFactory
public PentahoTableDataFactory()
default constructor
-
PentahoTableDataFactory
public PentahoTableDataFactory(String name, TableModel tableModel)
constructor with one time call to addTable for convenience.- Parameters:
name
- table nametableModel
- instance of table model
-
-
Method Detail
-
addTable
public void addTable(String name, TableModel tableModel)
add a table to the map- Parameters:
name
- table nametableModel
- instance of table model
-
addPreparedComponent
public void addPreparedComponent(String name, org.pentaho.platform.api.data.IPreparedComponent component)
add a prepared component to the map- Parameters:
name
- prepared component namecomponent
- instance of prepared component
-
removeTable
public void removeTable(String name)
remove a table from the map- Parameters:
name
- table name
-
queryData
public TableModel queryData(String query, org.pentaho.reporting.engine.classic.core.DataRow parameters)
Queries a datasource. The string 'query' defines the name of the query. The Parameterset given here may contain more data than actually needed. The dataset may change between two calls, do not assume anything!- Parameters:
query
- the name of the table.parameters
- are ignored for this factory.- Returns:
- the report data or null.
-
close
public void close()
-
closeTables
public void closeTables()
-
derive
public PentahoTableDataFactory derive()
Derives a freshly initialized report data factory, which is independend of the original data factory. Opening or Closing one data factory must not affect the other factories.- Specified by:
derive
in interfaceorg.pentaho.reporting.engine.classic.core.DataFactory
- Overrides:
derive
in classorg.pentaho.reporting.engine.classic.core.AbstractDataFactory
- Returns:
-
clone
public PentahoTableDataFactory clone()
- Specified by:
clone
in interfaceorg.pentaho.reporting.engine.classic.core.DataFactory
- Overrides:
clone
in classorg.pentaho.reporting.engine.classic.core.AbstractDataFactory
-
getQueryNames
public String[] getQueryNames()
-
isQueryExecutable
public boolean isQueryExecutable(String query, org.pentaho.reporting.engine.classic.core.DataRow parameters)
-
cancelRunningQuery
public void cancelRunningQuery()
- Specified by:
cancelRunningQuery
in interfaceorg.pentaho.reporting.engine.classic.core.DataFactory
- Overrides:
cancelRunningQuery
in classorg.pentaho.reporting.engine.classic.core.AbstractDataFactory
-
-