if (mondrianCubeDefinition == null)
{
throw new ParseException("Required property 'mondrianCubeDefinitionFile' is missing");
}
final LegacyBandedMDXDataFactory dataFactory = new LegacyBandedMDXDataFactory();
// legacy report usecase
final CubeFileProvider cubeFileProvider = ClassicEngineBoot.getInstance().getObjectFactory().get(CubeFileProvider.class);
cubeFileProvider.setDesignTimeFile(mondrianCubeDefinition);
dataFactory.setCubeFileProvider(cubeFileProvider);
dataFactory.setJdbcUser(selectedJNDIDataSourceReadHandler.getUsername());
dataFactory.setJdbcPassword(selectedJNDIDataSourceReadHandler.getPassword());
dataFactory.setDesignTimeName(selectedJNDIDataSourceReadHandler.getJndiName());
final DriverDataSourceProvider driverDataSourceProvider = new DriverDataSourceProvider();
driverDataSourceProvider.setDriver(selectedJNDIDataSourceReadHandler.getDriverClass());
driverDataSourceProvider.setUrl(selectedJNDIDataSourceReadHandler.getConnectionString());
dataFactory.setDataSourceProvider(driverDataSourceProvider);
for (int i = 0; i < queries.size(); i++)
{
final QueryReadHandler handler = (QueryReadHandler) queries.get(i);
dataFactory.setQuery(handler.getQueryName(), handler.getQuery(), null, null);
}
final String queryNameProperty = result.getProperty("queryString");
if (queryNameProperty != null)
{
dataFactory.setQuery("default", queryNameProperty, null, null);
}
this.dataFactory = dataFactory;
}
else
{
final DriverConnectionProvider drc = new DriverConnectionProvider();
drc.setUrl(selectedJNDIDataSourceReadHandler.getConnectionString());
drc.setDriver(selectedJNDIDataSourceReadHandler.getDriverClass());
drc.setProperty("user", selectedJNDIDataSourceReadHandler.getUsername());
drc.setProperty("password", selectedJNDIDataSourceReadHandler.getPassword());
drc.setProperty("::pentaho-reporting::name", selectedJNDIDataSourceReadHandler.getJndiName());
final SQLReportDataFactory dataFactory = new SQLReportDataFactory(drc);
for (int i = 0; i < queries.size(); i++)
{
final QueryReadHandler handler = (QueryReadHandler) queries.get(i);
dataFactory.setQuery(handler.getQueryName(), handler.getQuery(), null, null);
}
final String queryNameProperty = result.getProperty("queryString");
if (queryNameProperty != null)
{
dataFactory.setQuery("default", queryNameProperty, null, null);
}
this.dataFactory = dataFactory;
}
}
else