Search in sources :

Example 6 with ReportSpec

use of org.pentaho.jfreereport.castormodel.reportspec.ReportSpec in project pentaho-platform by pentaho.

the class JFreeReportGenerateDefinitionComponent method getReportSpec.

public ReportSpec getReportSpec() throws FileNotFoundException {
    ReportSpec reportSpec = null;
    if (isDefinedResource(AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTSPECINPUT)) {
        IActionSequenceResource resource = getResource(AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTSPECINPUT);
        reportSpec = loadFromZip(resource);
        if (reportSpec == null) {
            InputStream reportSpecInputStream = resource.getInputStream(RepositoryFilePermission.READ, LocaleHelper.getLocale());
            reportSpec = (ReportSpec) CastorUtility.getInstance().readCastorObject(reportSpecInputStream, ReportSpec.class);
        }
    }
    return reportSpec;
}
Also used : ReportSpec(org.pentaho.jfreereport.castormodel.reportspec.ReportSpec) ZipInputStream(java.util.zip.ZipInputStream) InputStream(java.io.InputStream) IActionSequenceResource(org.pentaho.platform.api.engine.IActionSequenceResource)

Aggregations

ReportSpec (org.pentaho.jfreereport.castormodel.reportspec.ReportSpec)6 IOException (java.io.IOException)3 ZipInputStream (java.util.zip.ZipInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 FileNotFoundException (java.io.FileNotFoundException)2 InputStream (java.io.InputStream)2 ZipEntry (java.util.zip.ZipEntry)2 BigDecimal (java.math.BigDecimal)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 DataSource (javax.activation.DataSource)1 JFreeReportAction (org.pentaho.actionsequence.dom.actions.JFreeReportAction)1 ActivationHelper (org.pentaho.commons.connection.ActivationHelper)1 Field (org.pentaho.jfreereport.castormodel.reportspec.Field)1 ReportSpecChoice (org.pentaho.jfreereport.castormodel.reportspec.ReportSpecChoice)1 IActionSequenceResource (org.pentaho.platform.api.engine.IActionSequenceResource)1