String dataDirectory = getInputStringValue( AbstractJFreeReportComponent.REPORTDIRECTORYHTML_DATADIR );
if ( dataDirectory == null ) {
dataDirectory = "data"; //$NON-NLS-1$
}
final ZipRepository zipRepository = new ZipRepository();
final ContentLocation root = zipRepository.getRoot();
final ContentLocation data =
RepositoryUtilities.createLocation( zipRepository, RepositoryUtilities.split( dataDirectory, "/" ) ); //$NON-NLS-1$
final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor();
final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
printer.setContentWriter( root, new DefaultNameGenerator( root, "report.html" ) ); //$NON-NLS-1$
printer.setDataWriter( data, new DefaultNameGenerator( data, "content" ) ); //$NON-NLS-1$
printer.setUrlRewriter( new SingleRepositoryURLRewriter() );
outputProcessor.setPrinter( printer );
final FlowReportProcessor sp = new FlowReportProcessor( report, outputProcessor );
final int yieldRate = getYieldRate();
if ( yieldRate > 0 ) {
sp.addReportProgressListener( new YieldReportListener( yieldRate ) );
}
sp.processReport();
zipRepository.write( outputStream );
close();
return true;
} catch ( ReportProcessingException e ) {
error( Messages.getInstance().getString( "JFreeReportZipHtmlComponent.ERROR_0046_FAILED_TO_PROCESS_REPORT" ), e ); //$NON-NLS-1$
return false;