Search in sources :

Example 1 with GetRepositoryNamesMeta

use of org.pentaho.di.trans.steps.getrepositorynames.GetRepositoryNamesMeta in project pentaho-kettle by pentaho.

the class GetRepositoryNamesDialog method preview.

// Preview the data
private void preview() {
    // Create the XML input step
    GetRepositoryNamesMeta oneMeta = new GetRepositoryNamesMeta();
    getInfo(oneMeta);
    TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
    previewMeta.setRepository(repository);
    EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "GetRepositoryNamesDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "GetRepositoryNamesDialog.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, "GetRepositoryNamesDialog.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 : GetRepositoryNamesMeta(org.pentaho.di.trans.steps.getrepositorynames.GetRepositoryNamesMeta) 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) Trans(org.pentaho.di.trans.Trans)

Aggregations

Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)1 GetRepositoryNamesMeta (org.pentaho.di.trans.steps.getrepositorynames.GetRepositoryNamesMeta)1 EnterNumberDialog (org.pentaho.di.ui.core.dialog.EnterNumberDialog)1 EnterTextDialog (org.pentaho.di.ui.core.dialog.EnterTextDialog)1 PreviewRowsDialog (org.pentaho.di.ui.core.dialog.PreviewRowsDialog)1 TransPreviewProgressDialog (org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog)1