use of org.pentaho.agilebi.modeler.IModelerSource in project data-access by pentaho.
the class ModelerService method generateDomain.
// TODO: remove this method in favor so specific calls
@Deprecated
public Domain generateDomain(String connectionName, String tableName, String dbType, String query, String datasourceName) throws Exception {
initKettle();
try {
DatabaseMeta database = AgileHelper.getDatabaseMeta();
IModelerSource source;
if (tableName != null) {
source = new TableModelerSource(database, tableName, null, datasourceName);
} else {
source = new InlineSqlModelerSource(connectionName, dbType, query, datasourceName);
}
return source.generateDomain();
} catch (Exception e) {
logger.error(e);
throw new Exception(e.getLocalizedMessage());
}
}
use of org.pentaho.agilebi.modeler.IModelerSource in project data-access by pentaho.
the class ModelerService method generateCSVDomain.
/**
* Use {@link ModelerService#generateCSVDomain(ModelInfo)} instead,
* as ModelInfo object contains information about csv column names,
* provided by user, that are not always the same as the names of columns,
* stored in database. (see BISERVER-13026 for more info)
*/
@Deprecated
public Domain generateCSVDomain(String tableName, String datasourceName) throws Exception {
initKettle();
try {
DatabaseMeta database = AgileHelper.getDatabaseMeta();
IModelerSource source = new TableModelerSource(database, tableName, null, datasourceName);
return source.generateDomain();
} catch (Exception e) {
logger.error(e);
throw new Exception(e.getLocalizedMessage());
}
}
Aggregations