Search in sources :

Example 1 with GetSubFoldersMeta

use of org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta 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)

Example 2 with GetSubFoldersMeta

use of org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta in project pentaho-kettle by pentaho.

the class GetSubFoldersDialog method getData.

/**
 * Read the data from the TextFileInputMeta object and show it in this dialog.
 *
 * @param meta
 *          The TextFileInputMeta object to obtain the data from.
 */
public void getData(GetSubFoldersMeta meta) {
    final GetSubFoldersMeta in = meta;
    if (in.getFolderName() != null) {
        wFoldernameList.removeAll();
        for (int i = 0; i < in.getFolderName().length; i++) {
            wFoldernameList.add(new String[] { in.getFolderName()[i], in.getRequiredFilesDesc(in.getFolderRequired()[i]) });
        }
        wFoldernameList.removeEmptyRows();
        wFoldernameList.setRowNums();
        wFoldernameList.optWidth(true);
        wInclRownum.setSelection(in.includeRowNumber());
        wFolderField.setSelection(in.isFoldernameDynamic());
        if (in.getRowNumberField() != null) {
            wInclRownumField.setText(in.getRowNumberField());
        }
        if (in.getDynamicFoldernameField() != null) {
            wFoldernameField.setText(in.getDynamicFoldernameField());
        }
        wLimit.setText("" + in.getRowLimit());
    }
    wStepname.selectAll();
    wStepname.setFocus();
}
Also used : GetSubFoldersMeta(org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta)

Aggregations

GetSubFoldersMeta (org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta)2 Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)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