public static ModelerWorkspace populateModelFromSource( ModelerWorkspace model, IModelerSource source ) throws ModelerException { Domain d = source.generateDomain(); model.setModelSource( source ); model.setModelName( source.getTableName() ); model.setDomain( d ); return model; }
public String getDatabaseName() { return source.getDatabaseName(); }
public void refresh( ModelerMode mode ) throws ModelerException { if ( source == null ) { return; } Domain newDomain = source.generateDomain( mode == ModelerMode.ANALYSIS_AND_REPORTING ); refresh( newDomain ); }
if ( property != null ) { IModelerSource theSource = ModelerSourceFactory.generateSource( property.toString() ); theSource.initialize( domain ); aModel.setModelSource( theSource );
model.getModelSource().serializeIntoDomain( domain );
/** * 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() ); } }
@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() ); } }