Search in sources :

Example 31 with FileInputList

use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.

the class YamlInputMeta method check.

@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    // See if we get input...
    if (input.length <= 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInputExpected"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInput"), stepMeta);
        remarks.add(cr);
    }
    if (getInputFields().length <= 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoInputField"), stepMeta);
        remarks.add(cr);
    }
    if (isInFields()) {
        if (Utils.isEmpty(getYamlField())) {
            cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoField"), stepMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.FieldOk"), stepMeta);
            remarks.add(cr);
        }
    } else {
        FileInputList fileInputList = getFiles(transMeta);
        // String files[] = getFiles();
        if (fileInputList == null || fileInputList.getFiles().size() == 0) {
            cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.NoFiles"), stepMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "YamlInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
            remarks.add(cr);
        }
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) FileInputList(org.pentaho.di.core.fileinput.FileInputList)

Example 32 with FileInputList

use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.

the class PropertyInputMeta method check.

public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    // See if we get input...
    if (input.length > 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoInputExpected"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoInput"), stepMeta);
        remarks.add(cr);
    }
    FileInputList fileInputList = getFiles(transMeta);
    if (fileInputList == null || fileInputList.getFiles().size() == 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.NoFiles"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "PropertyInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
        remarks.add(cr);
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) FileInputList(org.pentaho.di.core.fileinput.FileInputList)

Example 33 with FileInputList

use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.

the class LDIFInputMeta method check.

public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    // See if we get input...
    if (input.length > 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoInputExpected"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoInput"), stepMeta);
        remarks.add(cr);
    }
    FileInputList fileInputList = getFiles(transMeta);
    if (fileInputList == null || fileInputList.getFiles().size() == 0) {
        cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.NoFiles"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LDIFInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
        remarks.add(cr);
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) FileInputList(org.pentaho.di.core.fileinput.FileInputList)

Example 34 with FileInputList

use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.

the class LoadFileInputMeta method check.

public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    if (getIsInFields()) {
        // See if we get input...
        if (input.length == 0) {
            cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoInputExpected"), stepMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoInput"), stepMeta);
            remarks.add(cr);
        }
        if (Utils.isEmpty(getDynamicFilenameField())) {
            cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoField"), stepMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.FieldOk"), stepMeta);
            remarks.add(cr);
        }
    } else {
        FileInputList fileInputList = getFiles(transMeta);
        if (fileInputList == null || fileInputList.getFiles().size() == 0) {
            cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.NoFiles"), stepMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "LoadFileInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()), stepMeta);
            remarks.add(cr);
        }
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) FileInputList(org.pentaho.di.core.fileinput.FileInputList)

Example 35 with FileInputList

use of org.pentaho.di.core.fileinput.FileInputList in project pentaho-kettle by pentaho.

the class GetFileNamesMeta method check.

@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    // See if we get input...
    if (filefield) {
        if (input.length > 0) {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.InputOk"), stepMeta);
        } else {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.InputErrorKo"), stepMeta);
        }
        remarks.add(cr);
        if (Utils.isEmpty(dynamicFilenameField)) {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.FolderFieldnameMissing"), stepMeta);
        } else {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.FolderFieldnameOk"), stepMeta);
        }
        remarks.add(cr);
    } else {
        if (input.length > 0) {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.NoInputError"), stepMeta);
        } else {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.NoInputOk"), stepMeta);
        }
        remarks.add(cr);
        // check specified file names
        FileInputList fileList = getFileList(transMeta);
        if (fileList.nrOfFiles() == 0) {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.ExpectedFilesError"), stepMeta);
        } else {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetFileNamesMeta.CheckResult.ExpectedFilesOk", "" + fileList.nrOfFiles()), stepMeta);
        }
        remarks.add(cr);
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) FileInputList(org.pentaho.di.core.fileinput.FileInputList)

Aggregations

FileInputList (org.pentaho.di.core.fileinput.FileInputList)54 KettleException (org.pentaho.di.core.exception.KettleException)25 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)22 MessageBox (org.eclipse.swt.widgets.MessageBox)18 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)16 CheckResult (org.pentaho.di.core.CheckResult)14 FileObject (org.apache.commons.vfs2.FileObject)12 FileDialog (org.eclipse.swt.widgets.FileDialog)11 EnterSelectionDialog (org.pentaho.di.ui.core.dialog.EnterSelectionDialog)11 Shell (org.eclipse.swt.widgets.Shell)10 RowMeta (org.pentaho.di.core.row.RowMeta)10 CTabFolder (org.eclipse.swt.custom.CTabFolder)9 ModifyEvent (org.eclipse.swt.events.ModifyEvent)9 ModifyListener (org.eclipse.swt.events.ModifyListener)9 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)9 SelectionEvent (org.eclipse.swt.events.SelectionEvent)9 ShellAdapter (org.eclipse.swt.events.ShellAdapter)9 ShellEvent (org.eclipse.swt.events.ShellEvent)9 FormAttachment (org.eclipse.swt.layout.FormAttachment)9 FormData (org.eclipse.swt.layout.FormData)9