this.imageService = imageService;
}
String produceOle(final String source,final List masterColumns,final List masterValues,final List detailColumns) {
InputRepository subInputRepository = null;
OutputRepository subOutputRepository = null;
String output = "";
try {
subInputRepository = inputRepository.openInputRepository(source);
output = nameGenerator.generateStorageName("Object", null);
subOutputRepository = outputRepository.openOutputRepository(output, PentahoReportEngineMetaData.OPENDOCUMENT_CHART);
try {
final PentahoReportEngine engine = new PentahoReportEngine();
final ReportJobDefinition definition = engine.createJobDefinition();
final JobProperties procParms = definition.getProcessingParameters();
procParms.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, subInputRepository);
procParms.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, subOutputRepository);
procParms.setProperty(ReportEngineParameterNames.INPUT_NAME, "content.xml");
procParms.setProperty(ReportEngineParameterNames.OUTPUT_NAME, "content.xml");
procParms.setProperty(ReportEngineParameterNames.CONTENT_TYPE, PentahoReportEngineMetaData.OPENDOCUMENT_CHART);
procParms.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory);
procParms.setProperty(ReportEngineParameterNames.INPUT_MASTER_COLUMNS, masterColumns);
procParms.setProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES, masterValues);
procParms.setProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, detailColumns);
procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, imageService);
engine.createJob(definition).execute();
} catch (ReportExecutionException ex) {
Log.error("ReportProcessing failed", ex);
} catch (IOException ex) {
Log.error("ReportProcessing failed", ex);
}
} catch (IOException ex) {
Log.error("ReportProcessing failed", ex);
} finally {
if (subInputRepository != null) {
subInputRepository.closeInputRepository();
}
if (subOutputRepository != null) {
subOutputRepository.closeOutputRepository();
}
}
return output;
}