Search in sources :

Example 1 with IModelerSource

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());
    }
}
Also used : TableModelerSource(org.pentaho.agilebi.modeler.util.TableModelerSource) InlineSqlModelerSource(org.pentaho.platform.dataaccess.datasource.wizard.service.impl.utils.InlineSqlModelerSource) IModelerSource(org.pentaho.agilebi.modeler.IModelerSource) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleException(org.pentaho.di.core.exception.KettleException)

Example 2 with IModelerSource

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());
    }
}
Also used : TableModelerSource(org.pentaho.agilebi.modeler.util.TableModelerSource) IModelerSource(org.pentaho.agilebi.modeler.IModelerSource) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

IModelerSource (org.pentaho.agilebi.modeler.IModelerSource)2 TableModelerSource (org.pentaho.agilebi.modeler.util.TableModelerSource)2 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)2 KettleException (org.pentaho.di.core.exception.KettleException)2 InlineSqlModelerSource (org.pentaho.platform.dataaccess.datasource.wizard.service.impl.utils.InlineSqlModelerSource)1