Search in sources :

Example 11 with TransPreviewProgressDialog

use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.

the class RssInputDialog method preview.

// Preview the data
private void preview() {
    try {
        // Create the XML input step
        RssInputMeta oneMeta = new RssInputMeta();
        getInfo(oneMeta);
        // check if the path is given
        // if (!checkLoopXPath(oneMeta)) return;
        TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
        EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "getXMLDataDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG, "getXMLDataDialog.NumberRows.DialogMessage"));
        int previewSize = numberDialog.open();
        if (previewSize > 0) {
            TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
            progressDialog.open();
            if (!progressDialog.isCancelled()) {
                Trans trans = progressDialog.getTrans();
                String loggingText = progressDialog.getLoggingText();
                if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
                    EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
                    etd.setReadOnly();
                    etd.open();
                }
                PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
                prd.open();
            }
        }
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "RssInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "RssInputDialog.ErrorPreviewingData.DialogMessage"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) RssInputMeta(org.pentaho.di.trans.steps.rssinput.RssInputMeta) TransPreviewProgressDialog(org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog) TransMeta(org.pentaho.di.trans.TransMeta) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) PreviewRowsDialog(org.pentaho.di.ui.core.dialog.PreviewRowsDialog) EnterNumberDialog(org.pentaho.di.ui.core.dialog.EnterNumberDialog) Trans(org.pentaho.di.trans.Trans)

Example 12 with TransPreviewProgressDialog

use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.

the class GetTableNamesDialog method preview.

// Preview the data
private void preview() {
    GetTableNamesMeta oneMeta = new GetTableNamesMeta();
    getInfo(oneMeta);
    if (oneMeta.getDatabase() == null) {
        MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
        mb.setMessage(BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogMessage"));
        mb.setText(BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogTitle"));
        mb.open();
        return;
    }
    if (!checkUserInput(oneMeta)) {
        return;
    }
    TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
    EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogMessage"));
    int previewSize = numberDialog.open();
    if (previewSize > 0) {
        TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
        progressDialog.open();
        if (!progressDialog.isCancelled()) {
            Trans trans = progressDialog.getTrans();
            String loggingText = progressDialog.getLoggingText();
            if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
                EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "GetTableNamesDialog.ErrorInPreview.DialogMessage"), loggingText, true);
                etd.setReadOnly();
                etd.open();
            }
            PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
            prd.open();
        }
    }
}
Also used : TransPreviewProgressDialog(org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog) TransMeta(org.pentaho.di.trans.TransMeta) GetTableNamesMeta(org.pentaho.di.trans.steps.gettablenames.GetTableNamesMeta) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) PreviewRowsDialog(org.pentaho.di.ui.core.dialog.PreviewRowsDialog) EnterNumberDialog(org.pentaho.di.ui.core.dialog.EnterNumberDialog) Trans(org.pentaho.di.trans.Trans) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 13 with TransPreviewProgressDialog

use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.

the class GetVariableDialog method preview.

// Preview the data
private void preview() {
    try {
        // Create the Access input step
        GetVariableMeta oneMeta = new GetVariableMeta();
        getInfo(oneMeta);
        TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
        // EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(),
        // BaseMessages.getString(PKG, "GetVariableDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG,
        // "GetVariableDialog.NumberRows.DialogMessage"));
        // numberDialog.open();
        int previewSize = 1;
        if (previewSize > 0) {
            TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
            progressDialog.open();
            if (!progressDialog.isCancelled()) {
                Trans trans = progressDialog.getTrans();
                String loggingText = progressDialog.getLoggingText();
                if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
                    EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
                    etd.setReadOnly();
                    etd.open();
                }
                PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
                prd.open();
            }
        }
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "GetVariableDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "GetVariableDialog.ErrorPreviewingData.DialogMessage"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TransPreviewProgressDialog(org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog) TransMeta(org.pentaho.di.trans.TransMeta) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) PreviewRowsDialog(org.pentaho.di.ui.core.dialog.PreviewRowsDialog) Trans(org.pentaho.di.trans.Trans) GetVariableMeta(org.pentaho.di.trans.steps.getvariable.GetVariableMeta)

Example 14 with TransPreviewProgressDialog

use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.

the class LDAPInputDialog method preview.

// Preview the data
private void preview() {
    try {
        // Create the XML input step
        LDAPInputMeta oneMeta = new LDAPInputMeta();
        getInfo(oneMeta);
        TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
        EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "LDAPInputDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG, "LDAPInputDialog.NumberRows.DialogMessage"));
        int previewSize = numberDialog.open();
        if (previewSize > 0) {
            TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
            progressDialog.open();
            if (!progressDialog.isCancelled()) {
                Trans trans = progressDialog.getTrans();
                String loggingText = progressDialog.getLoggingText();
                if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
                    EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
                    etd.setReadOnly();
                    etd.open();
                }
                PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
                prd.open();
            }
        }
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "LDAPInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "LDAPInputDialog.ErrorPreviewingData.DialogMessage"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TransPreviewProgressDialog(org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog) TransMeta(org.pentaho.di.trans.TransMeta) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) PreviewRowsDialog(org.pentaho.di.ui.core.dialog.PreviewRowsDialog) EnterNumberDialog(org.pentaho.di.ui.core.dialog.EnterNumberDialog) Trans(org.pentaho.di.trans.Trans) LDAPInputMeta(org.pentaho.di.trans.steps.ldapinput.LDAPInputMeta)

Example 15 with TransPreviewProgressDialog

use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.

the class GetSubFoldersDialog method preview.

// Preview the data
private void preview() {
    // Create the XML input step
    GetSubFoldersMeta oneMeta = new GetSubFoldersMeta();
    getInfo(oneMeta);
    TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
    EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "GetSubFoldersDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "GetSubFoldersDialog.PreviewSize.DialogMessage"));
    int previewSize = numberDialog.open();
    if (previewSize > 0) {
        TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
        progressDialog.open();
        if (!progressDialog.isCancelled()) {
            Trans trans = progressDialog.getTrans();
            String loggingText = progressDialog.getLoggingText();
            if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
                EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "GetSubFoldersDialog.ErrorInPreview.DialogMessage"), loggingText, true);
                etd.setReadOnly();
                etd.open();
            }
            PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
            prd.open();
        }
    }
}
Also used : TransPreviewProgressDialog(org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog) TransMeta(org.pentaho.di.trans.TransMeta) EnterTextDialog(org.pentaho.di.ui.core.dialog.EnterTextDialog) PreviewRowsDialog(org.pentaho.di.ui.core.dialog.PreviewRowsDialog) EnterNumberDialog(org.pentaho.di.ui.core.dialog.EnterNumberDialog) GetSubFoldersMeta(org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta) Trans(org.pentaho.di.trans.Trans)

Aggregations

TransMeta (org.pentaho.di.trans.TransMeta)49 TransPreviewProgressDialog (org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog)49 Trans (org.pentaho.di.trans.Trans)48 PreviewRowsDialog (org.pentaho.di.ui.core.dialog.PreviewRowsDialog)48 EnterTextDialog (org.pentaho.di.ui.core.dialog.EnterTextDialog)47 EnterNumberDialog (org.pentaho.di.ui.core.dialog.EnterNumberDialog)43 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)27 KettleException (org.pentaho.di.core.exception.KettleException)25 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)9 Point (org.eclipse.swt.graphics.Point)5 MessageBox (org.eclipse.swt.widgets.MessageBox)5 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)4 RowGeneratorMeta (org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta)4 Date (java.util.Date)3 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)3 StepPluginType (org.pentaho.di.core.plugins.StepPluginType)3 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)3 TransHopMeta (org.pentaho.di.trans.TransHopMeta)3 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)3 StepMeta (org.pentaho.di.trans.step.StepMeta)3