Search in sources :

Example 1 with DatabaseLookupMeta

use of org.pentaho.di.trans.steps.databaselookup.DatabaseLookupMeta in project pentaho-kettle by pentaho.

the class TransDialog method get.

// Get the dependencies
private void get() {
    Table table = wFields.table;
    for (int i = 0; i < transMeta.nrSteps(); i++) {
        StepMeta stepMeta = transMeta.getStep(i);
        String con = null;
        String tab = null;
        TableItem item = null;
        StepMetaInterface sii = stepMeta.getStepMetaInterface();
        if (sii instanceof TableInputMeta) {
            TableInputMeta tii = (TableInputMeta) stepMeta.getStepMetaInterface();
            if (tii.getDatabaseMeta() == null) {
                MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
                mb.setMessage(BaseMessages.getString(PKG, "TransDialog.DatabaseMetaNotSet.Text"));
                mb.open();
                return;
            }
            con = tii.getDatabaseMeta().getName();
            tab = getTableFromSQL(tii.getSQL());
            if (tab == null) {
                tab = stepMeta.getName();
            }
        }
        if (sii instanceof DatabaseLookupMeta) {
            DatabaseLookupMeta dvli = (DatabaseLookupMeta) stepMeta.getStepMetaInterface();
            con = dvli.getDatabaseMeta().getName();
            tab = dvli.getTablename();
            if (tab == null) {
                tab = stepMeta.getName();
            }
            break;
        }
        if (tab != null || con != null) {
            item = new TableItem(table, SWT.NONE);
            if (con != null) {
                item.setText(1, con);
            }
            if (tab != null) {
                item.setText(2, tab);
            }
        }
    }
    wFields.setRowNums();
}
Also used : DatabaseLookupMeta(org.pentaho.di.trans.steps.databaselookup.DatabaseLookupMeta) PerformanceLogTable(org.pentaho.di.core.logging.PerformanceLogTable) ChannelLogTable(org.pentaho.di.core.logging.ChannelLogTable) StepLogTable(org.pentaho.di.core.logging.StepLogTable) MetricsLogTable(org.pentaho.di.core.logging.MetricsLogTable) Table(org.eclipse.swt.widgets.Table) TransLogTable(org.pentaho.di.core.logging.TransLogTable) TableItem(org.eclipse.swt.widgets.TableItem) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) StepMeta(org.pentaho.di.trans.step.StepMeta) TableInputMeta(org.pentaho.di.trans.steps.tableinput.TableInputMeta) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

MessageBox (org.eclipse.swt.widgets.MessageBox)1 Table (org.eclipse.swt.widgets.Table)1 TableItem (org.eclipse.swt.widgets.TableItem)1 ChannelLogTable (org.pentaho.di.core.logging.ChannelLogTable)1 MetricsLogTable (org.pentaho.di.core.logging.MetricsLogTable)1 PerformanceLogTable (org.pentaho.di.core.logging.PerformanceLogTable)1 StepLogTable (org.pentaho.di.core.logging.StepLogTable)1 TransLogTable (org.pentaho.di.core.logging.TransLogTable)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)1 DatabaseLookupMeta (org.pentaho.di.trans.steps.databaselookup.DatabaseLookupMeta)1 TableInputMeta (org.pentaho.di.trans.steps.tableinput.TableInputMeta)1