use of org.pentaho.di.starmodeler.generator.JobGenerator in project pentaho-kettle by pentaho.
the class StarModelerPerspective method generateDomainJobButton.
protected void generateDomainJobButton(StarDomain starDomain) {
final Spoon spoon = Spoon.getInstance();
List<DatabaseMeta> sharedDatabases = SharedDatabaseUtil.loadSharedDatabases();
JobGenerator jobGenerator = new JobGenerator(starDomain, spoon.rep, new RepositoryDirectory(), sharedDatabases, defaultLocale);
try {
List<TransMeta> transMetas = jobGenerator.generateDimensionTransformations();
for (TransMeta transMeta : transMetas) {
spoon.addTransGraph(transMeta);
}
SpoonPerspectiveManager.getInstance().activatePerspective(MainSpoonPerspective.class);
} catch (Exception e) {
new ErrorDialog(spoon.getShell(), BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Title"), BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Message"), e);
}
}
use of org.pentaho.di.starmodeler.generator.JobGenerator in project pentaho-kettle by pentaho.
the class StarModelerPerspective method generateSqlJobButton.
protected void generateSqlJobButton(StarDomain starDomain) {
final Spoon spoon = Spoon.getInstance();
List<DatabaseMeta> sharedDatabases = SharedDatabaseUtil.loadSharedDatabases();
// TODO: validate presence of repository, repository directory
//
JobGenerator jobGenerator = new JobGenerator(starDomain, spoon.rep, new RepositoryDirectory(), sharedDatabases, defaultLocale);
try {
JobMeta jobMeta = jobGenerator.generateSqlJob();
spoon.addJobGraph(jobMeta);
SpoonPerspectiveManager.getInstance().activatePerspective(MainSpoonPerspective.class);
} catch (Exception e) {
new ErrorDialog(spoon.getShell(), BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Title"), BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Message"), e);
}
}
Aggregations