Class JFreeReportComponent
- java.lang.Object
-
- org.pentaho.platform.engine.core.system.PentahoBase
-
- org.pentaho.platform.engine.services.PentahoMessenger
-
- org.pentaho.platform.engine.services.solution.ComponentBase
-
- org.pentaho.platform.plugin.action.jfreereport.AbstractJFreeReportComponent
-
- org.pentaho.platform.plugin.action.jfreereport.JFreeReportComponent
-
- All Implemented Interfaces:
Serializable
,org.pentaho.platform.api.engine.IAuditable
,org.pentaho.platform.api.engine.IComponent
,org.pentaho.platform.api.engine.ILogger
,org.pentaho.platform.api.engine.IParameterResolver
- Direct Known Subclasses:
ReportWizardSpecComponent
public class JFreeReportComponent extends AbstractJFreeReportComponent
The JFreeReportComponent provides a simple-to-use frontend for the reporting process. This component will execute JFreeReport reports in one of two different modes:sqlMode = true
This means that the JFreeReport component is expected to execute an SQL query, wrap the resulting SQL Resultset in a TableModel, and use that to execute a report whose definition is in the file system. In this mode, the action-sequence definition must contain the following elements: In the resource-definition section, there must be a resource called "report-definition" which defines the location of the jfreereport xml document. In the component-definition sction, there must be the following entries:- A "query" parameter which contains an SQL query.
- Either for connecting to the SQL datasource:
- A "jndi" parameter (with the jndi name of the datasource)
- or The database parameters "driver", "user-id", "password" and "connection" so that a database connection can be established for running the afore-mentioned "query".
sqlMode = false
This means that the JFreeReport component is expected to execute a report that exists in a .jar file (like the reporting demo reports) along with the TableModel class that provides the data for the report. In this mode, the action-sequence definition must contain the following elements: In the resource-definition section, there must be a resource called "report-jar" that points to the .jar file that contains the report .xml file, and the TableModel implementation. In the component-definition section, there must be two entries:- "report-location" - This is the location of the report .xml document (e.g. org/jfree/report/demo/report1.xml)
- "class-location" - This is the package-qualified class that implements TableModel (e.g. org.jfree.report.demo.SampleData1).
- Author:
- mbatchel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
logger
-
Fields inherited from class org.pentaho.platform.plugin.action.jfreereport.AbstractJFreeReportComponent
DATACOMPONENT_CLASSLOCINPUT, DATACOMPONENT_DATAINPUT, DATACOMPONENT_DEFAULTINPUT, DATACOMPONENT_JARINPUT, DATACOMPONENT_MDXCLASS, DATACOMPONENT_MDXSOURCE, DATACOMPONENT_REPORTTEMP_DATAINPUT, DATACOMPONENT_REPORTTEMP_OBJINPUT, DATACOMPONENT_SOURCE, DATACOMPONENT_SQLCLASS, DATACOMPONENT_SQLSOURCE, REPORTALLCONTENT_OUTPUTTYPE, REPORTALLCONTENT_OUTPUTTYPE_CSV, REPORTALLCONTENT_OUTPUTTYPE_HTML, REPORTALLCONTENT_OUTPUTTYPE_PDF, REPORTALLCONTENT_OUTPUTTYPE_RTF, REPORTALLCONTENT_OUTPUTTYPE_SWING, REPORTALLCONTENT_OUTPUTTYPE_XLS, REPORTALLCONTENT_OUTPUTTYPE_XML, REPORTDIRECTORYHTML_DATADIR, REPORTDIRECTORYHTML_TARGETFILE, REPORTGENERATE_PRIORITYINPUT, REPORTGENERATE_PRIORITYLOWER, REPORTGENERATE_PRIORITYLOWEST, REPORTGENERATE_PRIORITYNORMAL, REPORTGENERATE_YIELDRATE, REPORTGENERATEDEFN_REPORTDEFN, REPORTGENERATEDEFN_REPORTSPECINPUT, REPORTGENERATEDEFN_REPORTTEMP_PERFQRY, REPORTGENERATESTREAM_REPORT_OUTPUT, REPORTHTML_CONTENTHANDLER, REPORTLOAD_REPORTLOC, REPORTLOAD_RESOURCENAME, REPORTLOAD_RESURL, REPORTPARAMCOMPONENT_PRIVATEREPORT_OUTPUT, REPORTSWING_MODAL, REPORTSWING_PARENTDIALOG, REPORTSWING_PROGRESSBAR, REPORTSWING_PROGRESSDIALOG, REPORTSWING_REPORTCONTROLLER, WORKBOOK_PARAM
-
Fields inherited from class org.pentaho.platform.engine.services.solution.ComponentBase
COMPONENT_EXECUTE_FAIL, debug, MISSING_SESSION, UNKNOWN_COMPONENT_ID
-
-
Constructor Summary
Constructors Constructor Description JFreeReportComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.pentaho.reporting.engine.classic.core.MasterReport
createReport(String reportDefinition)
void
done()
boolean
executeAction()
This method gets called from the outside.protected boolean
executeReportAction()
protected org.pentaho.platform.api.repository.IContentItem
getContentItem(String mimeType, String extension)
protected PentahoTableDataFactory
getDataFactory()
org.apache.commons.logging.Log
getLogger()
org.pentaho.reporting.engine.classic.core.MasterReport
getReport()
boolean
init()
protected boolean
initAndValidate(org.pentaho.platform.api.engine.IComponent component)
boolean
print(org.pentaho.reporting.engine.classic.core.MasterReport report, String jobName, String printerName)
boolean
validateAction()
We cannot validate the parameters of all components, as the required parameters might not have been created.boolean
validateSystemSettings()
protected boolean
writeCsv(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
boolean
writeHtml(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate, String htmlContentHandlerUrlPattern)
protected boolean
writePdf(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
protected boolean
writeRtf(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
protected boolean
writeSwingPreview(org.pentaho.reporting.engine.classic.core.MasterReport report)
protected boolean
writeXls(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
protected boolean
writeXml(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream)
-
Methods inherited from class org.pentaho.platform.engine.services.solution.ComponentBase
addTempParameter, addTempParameterObject, applyInputsToFormat, audit, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createNewInstance, execute, feedbackAllowed, getActionDefinition, getActionName, getActionTitle, getComponentDefinition, getComponentDefinition, getContentOutputItem, getDefaultOutputStream, getFeedbackOutputStream, getId, getInitFailMessage, getInitOk, getInputBooleanValue, getInputLongValue, getInputNames, getInputParameter, getInputStream, getInputStringValue, getInputStringValue, getInputValue, getInstanceId, getLogId, getObjectName, getOutputContentItem, getOutputContentItem, getOutputItem, getOutputItem, getOutputNames, getOutputPreference, getProcessId, getResource, getResourceAsString, getResourceDataSource, getResourceInputStream, getResourceNames, getRuntimeContext, getSession, getSetting, getSolutionName, getSolutionPath, getStringSetting, inputMissingError, isDefinedInput, isDefinedOutput, isDefinedResource, isPromptPending, outputMissingError, promptNeeded, promptNow, resolveParameter, resourceComponentSettingError, resourceMissingError, saveSetting, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setFeedbackMimeType, setInstanceId, setOutputMimeType, setOutputMimeType, setOutputValue, setProcessId, setRuntimeContext, setSession, validate
-
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
-
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, setLoggingLevel, setLogId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
init
public boolean init()
- Specified by:
init
in interfaceorg.pentaho.platform.api.engine.IComponent
- Specified by:
init
in classorg.pentaho.platform.engine.services.solution.ComponentBase
-
done
public void done()
- Specified by:
done
in interfaceorg.pentaho.platform.api.engine.IComponent
- Specified by:
done
in classorg.pentaho.platform.engine.services.solution.ComponentBase
-
validateSystemSettings
public boolean validateSystemSettings()
- Specified by:
validateSystemSettings
in classorg.pentaho.platform.engine.services.solution.ComponentBase
-
getLogger
public org.apache.commons.logging.Log getLogger()
- Specified by:
getLogger
in classorg.pentaho.platform.engine.core.system.PentahoBase
-
initAndValidate
protected boolean initAndValidate(org.pentaho.platform.api.engine.IComponent component)
-
validateAction
public boolean validateAction()
We cannot validate the parameters of all components, as the required parameters might not have been created.- Specified by:
validateAction
in classorg.pentaho.platform.engine.services.solution.ComponentBase
- Returns:
-
executeAction
public boolean executeAction()
This method gets called from the outside. Based upon our mode call the correct function.- Specified by:
executeAction
in classorg.pentaho.platform.engine.services.solution.ComponentBase
-
executeReportAction
protected boolean executeReportAction()
-
getDataFactory
protected PentahoTableDataFactory getDataFactory() throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception
-
getReport
public org.pentaho.reporting.engine.classic.core.MasterReport getReport() throws Exception
- Throws:
Exception
-
createReport
protected org.pentaho.reporting.engine.classic.core.MasterReport createReport(String reportDefinition) throws org.pentaho.reporting.libraries.resourceloader.ResourceException, IOException
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceException
IOException
-
getContentItem
protected org.pentaho.platform.api.repository.IContentItem getContentItem(String mimeType, String extension)
-
writeHtml
public boolean writeHtml(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate, String htmlContentHandlerUrlPattern)
-
writeXls
protected boolean writeXls(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
-
writePdf
protected boolean writePdf(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
-
print
public boolean print(org.pentaho.reporting.engine.classic.core.MasterReport report, String jobName, String printerName)
-
writeCsv
protected boolean writeCsv(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
-
writeRtf
protected boolean writeRtf(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream, int yieldRate)
-
writeXml
protected boolean writeXml(org.pentaho.reporting.engine.classic.core.MasterReport report, OutputStream outputStream)
-
writeSwingPreview
protected boolean writeSwingPreview(org.pentaho.reporting.engine.classic.core.MasterReport report)
-
-