Search in sources :

Example 1 with JobGenerator

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);
    }
}
Also used : RepositoryDirectory(org.pentaho.di.repository.RepositoryDirectory) Spoon(org.pentaho.di.ui.spoon.Spoon) TransMeta(org.pentaho.di.trans.TransMeta) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) JobGenerator(org.pentaho.di.starmodeler.generator.JobGenerator) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) XulException(org.pentaho.ui.xul.XulException) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) KettleException(org.pentaho.di.core.exception.KettleException) MetaStoreElementExistException(org.pentaho.metastore.api.exceptions.MetaStoreElementExistException)

Example 2 with JobGenerator

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);
    }
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) RepositoryDirectory(org.pentaho.di.repository.RepositoryDirectory) Spoon(org.pentaho.di.ui.spoon.Spoon) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) JobGenerator(org.pentaho.di.starmodeler.generator.JobGenerator) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) XulException(org.pentaho.ui.xul.XulException) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) KettleException(org.pentaho.di.core.exception.KettleException) MetaStoreElementExistException(org.pentaho.metastore.api.exceptions.MetaStoreElementExistException)

Aggregations

DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)2 KettleException (org.pentaho.di.core.exception.KettleException)2 RepositoryDirectory (org.pentaho.di.repository.RepositoryDirectory)2 JobGenerator (org.pentaho.di.starmodeler.generator.JobGenerator)2 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)2 Spoon (org.pentaho.di.ui.spoon.Spoon)2 MetaStoreElementExistException (org.pentaho.metastore.api.exceptions.MetaStoreElementExistException)2 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)2 XulException (org.pentaho.ui.xul.XulException)2 JobMeta (org.pentaho.di.job.JobMeta)1 TransMeta (org.pentaho.di.trans.TransMeta)1