Search in sources :

Example 46 with TextFileInputField

use of org.pentaho.di.trans.steps.textfileinput.TextFileInputField in project pentaho-kettle by pentaho.

the class CsvInputUnitTestBase method createField.

TextFileInputField createField(String name) {
    TextFileInputField field = new TextFileInputField();
    field.setName(name);
    field.setType(ValueMetaInterface.TYPE_STRING);
    return field;
}
Also used : TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField)

Example 47 with TextFileInputField

use of org.pentaho.di.trans.steps.textfileinput.TextFileInputField in project pentaho-kettle by pentaho.

the class CsvInputBase method createCsvInputStep.

public StepMeta createCsvInputStep(TransMeta transMeta, PluginRegistry registry, String enclosure, boolean headerPresent) {
    // 
    // Create a Csv Input step
    // 
    String csvInputName = "csv input step";
    CsvInputMeta cim = new CsvInputMeta();
    String csvInputPid = registry.getPluginId(StepPluginType.class, cim);
    StepMeta csvInputStep = new StepMeta(csvInputPid, csvInputName, cim);
    transMeta.addStep(csvInputStep);
    TextFileInputField[] fields = createTextFileInputFields();
    cim.setIncludingFilename(true);
    cim.setFilename("");
    cim.setFilenameField("filename");
    cim.setDelimiter(";");
    cim.setEnclosure(enclosure);
    cim.setBufferSize("50000");
    cim.setLazyConversionActive(false);
    cim.setHeaderPresent(headerPresent);
    cim.setAddResultFile(false);
    cim.setIncludingFilename(true);
    cim.setRowNumField("");
    cim.setRunningInParallel(false);
    cim.setInputFields(fields);
    return csvInputStep;
}
Also used : TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) StepMeta(org.pentaho.di.trans.step.StepMeta)

Aggregations

TextFileInputField (org.pentaho.di.trans.steps.textfileinput.TextFileInputField)47 KettleException (org.pentaho.di.core.exception.KettleException)13 KettleStepException (org.pentaho.di.core.exception.KettleStepException)11 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)11 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)11 TableItem (org.eclipse.swt.widgets.TableItem)9 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)4 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)4 S3ServiceException (org.jets3t.service.S3ServiceException)3 Node (org.w3c.dom.Node)3 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 TextFileInputFieldInterface (org.pentaho.di.core.gui.TextFileInputFieldInterface)2 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)2 StepInjectionMetaEntry (org.pentaho.di.trans.step.StepInjectionMetaEntry)2 StepMeta (org.pentaho.di.trans.step.StepMeta)2 File (java.io.File)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1