use of org.pentaho.agilebi.modeler.util.TableModelerSource in project data-access by pentaho.
the class ModelerService method generateCSVDomain.
public Domain generateCSVDomain(ModelInfo modelInfo) throws Exception {
initKettle();
try {
DatabaseMeta database = getDatabaseMeta();
final String tableName = modelInfo.getStageTableName();
final String datasourceName = modelInfo.getDatasourceName();
Column[] columns = toColumns(modelInfo.getColumns());
PhysicalTableImporter.ImportStrategy importStrategy = new CsvDatasourceImportStrategy(columns);
TableModelerSource source = createTableModelerSource(database, tableName, null, datasourceName);
return source.generateDomain(importStrategy);
} catch (Exception e) {
logger.error(e);
throw new Exception(e.getLocalizedMessage());
}
}
Aggregations