Search in sources :

Example 51 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class GetFileNamesMeta method getFields.

@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    // the filename
    ValueMetaInterface filename = new ValueMetaString("filename");
    filename.setLength(500);
    filename.setPrecision(-1);
    filename.setOrigin(name);
    row.addValueMeta(filename);
    // the short filename
    ValueMetaInterface short_filename = new ValueMetaString("short_filename");
    short_filename.setLength(500);
    short_filename.setPrecision(-1);
    short_filename.setOrigin(name);
    row.addValueMeta(short_filename);
    // the path
    ValueMetaInterface path = new ValueMetaString("path");
    path.setLength(500);
    path.setPrecision(-1);
    path.setOrigin(name);
    row.addValueMeta(path);
    // the type
    ValueMetaInterface type = new ValueMetaString("type");
    type.setLength(500);
    type.setPrecision(-1);
    type.setOrigin(name);
    row.addValueMeta(type);
    // the exists
    ValueMetaInterface exists = new ValueMetaBoolean("exists");
    exists.setOrigin(name);
    row.addValueMeta(exists);
    // the ishidden
    ValueMetaInterface ishidden = new ValueMetaBoolean("ishidden");
    ishidden.setOrigin(name);
    row.addValueMeta(ishidden);
    // the isreadable
    ValueMetaInterface isreadable = new ValueMetaBoolean("isreadable");
    isreadable.setOrigin(name);
    row.addValueMeta(isreadable);
    // the iswriteable
    ValueMetaInterface iswriteable = new ValueMetaBoolean("iswriteable");
    iswriteable.setOrigin(name);
    row.addValueMeta(iswriteable);
    // the lastmodifiedtime
    ValueMetaInterface lastmodifiedtime = new ValueMetaDate("lastmodifiedtime");
    lastmodifiedtime.setOrigin(name);
    row.addValueMeta(lastmodifiedtime);
    // the size
    ValueMetaInterface size = new ValueMetaInteger("size");
    size.setOrigin(name);
    row.addValueMeta(size);
    // the extension
    ValueMetaInterface extension = new ValueMetaString("extension");
    extension.setOrigin(name);
    row.addValueMeta(extension);
    // the uri
    ValueMetaInterface uri = new ValueMetaString("uri");
    uri.setOrigin(name);
    row.addValueMeta(uri);
    // the rooturi
    ValueMetaInterface rooturi = new ValueMetaString("rooturi");
    rooturi.setOrigin(name);
    row.addValueMeta(rooturi);
    if (includeRowNumber) {
        ValueMetaInterface v = new ValueMetaInteger(space.environmentSubstitute(rowNumberField));
        v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 52 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class GetSubFoldersMeta method getFields.

public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    // the folderName
    ValueMetaInterface folderName = new ValueMetaString("folderName");
    folderName.setLength(500);
    folderName.setPrecision(-1);
    folderName.setOrigin(name);
    row.addValueMeta(folderName);
    // the short folderName
    ValueMetaInterface short_folderName = new ValueMetaString("short_folderName");
    short_folderName.setLength(500);
    short_folderName.setPrecision(-1);
    short_folderName.setOrigin(name);
    row.addValueMeta(short_folderName);
    // the path
    ValueMetaInterface path = new ValueMetaString("path");
    path.setLength(500);
    path.setPrecision(-1);
    path.setOrigin(name);
    row.addValueMeta(path);
    // the ishidden
    ValueMetaInterface ishidden = new ValueMetaBoolean("ishidden");
    ishidden.setOrigin(name);
    row.addValueMeta(ishidden);
    // the isreadable
    ValueMetaInterface isreadable = new ValueMetaBoolean("isreadable");
    isreadable.setOrigin(name);
    row.addValueMeta(isreadable);
    // the iswriteable
    ValueMetaInterface iswriteable = new ValueMetaBoolean("iswriteable");
    iswriteable.setOrigin(name);
    row.addValueMeta(iswriteable);
    // the lastmodifiedtime
    ValueMetaInterface lastmodifiedtime = new ValueMetaDate("lastmodifiedtime");
    lastmodifiedtime.setOrigin(name);
    row.addValueMeta(lastmodifiedtime);
    // the uri
    ValueMetaInterface uri = new ValueMetaString("uri");
    uri.setOrigin(name);
    row.addValueMeta(uri);
    // the rooturi
    ValueMetaInterface rooturi = new ValueMetaString("rooturi");
    rooturi.setOrigin(name);
    row.addValueMeta(rooturi);
    // childrens
    ValueMetaInterface childrens = new ValueMetaInteger(space.environmentSubstitute("childrens"));
    childrens.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
    childrens.setOrigin(name);
    row.addValueMeta(childrens);
    if (includeRowNumber) {
        ValueMetaInterface v = new ValueMetaInteger(space.environmentSubstitute(rowNumberField));
        v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
        v.setOrigin(name);
        row.addValueMeta(v);
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 53 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class GetTableNamesMeta method getFields.

public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    String realtablename = space.environmentSubstitute(tablenamefieldname);
    if (!Utils.isEmpty(realtablename)) {
        ValueMetaInterface v = new ValueMetaString(realtablename);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String realObjectType = space.environmentSubstitute(objecttypefieldname);
    if (!Utils.isEmpty(realObjectType)) {
        ValueMetaInterface v = new ValueMetaString(realObjectType);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String sysobject = space.environmentSubstitute(issystemobjectfieldname);
    if (!Utils.isEmpty(sysobject)) {
        ValueMetaInterface v = new ValueMetaBoolean(sysobject);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
    String realSQLCreation = space.environmentSubstitute(sqlcreationfieldname);
    if (!Utils.isEmpty(realSQLCreation)) {
        ValueMetaInterface v = new ValueMetaString(realSQLCreation);
        v.setLength(500);
        v.setPrecision(-1);
        v.setOrigin(name);
        r.addValueMeta(v);
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 54 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class FileLockedMeta method getFields.

public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (!Utils.isEmpty(resultfieldname)) {
        ValueMetaInterface v = new ValueMetaBoolean(resultfieldname);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 55 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class JobExecutorMeta method getFields.

@Override
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    row.clear();
    if (nextStep != null && resultRowsTargetStepMeta != null && nextStep.equals(resultRowsTargetStepMeta)) {
        for (int i = 0; i < resultRowsField.length; i++) {
            ValueMetaInterface value;
            try {
                value = ValueMetaFactory.createValueMeta(resultRowsField[i], resultRowsType[i], resultRowsLength[i], resultRowsPrecision[i]);
            } catch (KettlePluginException e) {
                value = new ValueMetaNone(resultRowsField[i]);
                value.setLength(resultRowsLength[i], resultRowsPrecision[i]);
            }
            row.addValueMeta(value);
        }
    } else if (nextStep != null && resultFilesTargetStepMeta != null && nextStep.equals(resultFilesTargetStepMeta)) {
        if (!Utils.isEmpty(resultFilesFileNameField)) {
            ValueMetaInterface value = new ValueMetaString("filename", 255, 0);
            row.addValueMeta(value);
        }
    } else if (nextStep != null && executionResultTargetStepMeta != null && nextStep.equals(executionResultTargetStepMeta)) {
        if (!Utils.isEmpty(executionTimeField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionTimeField, 15, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionResultField)) {
            ValueMetaInterface value = new ValueMetaBoolean(executionResultField);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionNrErrorsField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionNrErrorsField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesReadField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesReadField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesWrittenField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesWrittenField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesInputField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesInputField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesOutputField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesOutputField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesRejectedField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesRejectedField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesUpdatedField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesUpdatedField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLinesDeletedField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionLinesDeletedField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionFilesRetrievedField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionFilesRetrievedField, 9, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionExitStatusField)) {
            ValueMetaInterface value = new ValueMetaInteger(executionExitStatusField, 3, 0);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLogTextField)) {
            ValueMetaInterface value = new ValueMetaString(executionLogTextField);
            value.setLargeTextField(true);
            row.addValueMeta(value);
        }
        if (!Utils.isEmpty(executionLogChannelIdField)) {
            ValueMetaInterface value = new ValueMetaString(executionLogChannelIdField, 50, 0);
            row.addValueMeta(value);
        }
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException) ValueMetaNone(org.pentaho.di.core.row.value.ValueMetaNone) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)84 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)68 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)60 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)46 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)44 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)32 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)25 RowMeta (org.pentaho.di.core.row.RowMeta)22 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)20 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)20 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)18 Test (org.junit.Test)16 ValueMetaInternetAddress (org.pentaho.di.core.row.value.ValueMetaInternetAddress)15 KettleException (org.pentaho.di.core.exception.KettleException)13 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)13 ObjectId (org.pentaho.di.repository.ObjectId)12 LongObjectId (org.pentaho.di.repository.LongObjectId)9 KettleStepException (org.pentaho.di.core.exception.KettleStepException)8 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)7 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)6