public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface v = new ValueMeta( this.getValueName(), ValueMetaInterface.TYPE_STRING ); v.setOrigin( name ); row.addValueMeta( v ); }
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { // Output field (String) ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getResultfieldname() ), ValueMeta.TYPE_STRING ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); }
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { if ( !Utils.isEmpty( resultFieldname ) ) { if ( outputStringField ) { // Output field (String) ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getResultfieldname() ), ValueMeta.TYPE_STRING ); inputRowMeta.addValueMeta( v ); } else { // Output field (boolean) ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getResultfieldname() ), ValueMeta.TYPE_BOOLEAN ); inputRowMeta.addValueMeta( v ); } } // Add String Field that contain validation message (most the time, errors) if ( addValidationMessage && !Utils.isEmpty( validationMessageField ) ) { ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( validationMessageField ), ValueMeta.TYPE_STRING ); inputRowMeta.addValueMeta( v ); } }
private RowMetaInterface getOutWebServiceFields() { RowMetaInterface r = null; if ( outWsdlParamContainer != null ) { r = new RowMeta(); String[] outParams = outWsdlParamContainer.getParamNames(); // If we have already saved fields mapping, we only show these mappings for ( int cpt = 0; cpt < outParams.length; cpt++ ) { ValueMetaInterface value = new ValueMeta( outParams[cpt], XsdType.xsdTypeToKettleType( outWsdlParamContainer .getParamType( outParams[cpt] ) ) ); r.addValueMeta( value ); } } return r; }
private RowMetaInterface getInWebServiceFields() { RowMetaInterface r = null; if ( inWsdlParamContainer != null ) { r = new RowMeta(); String[] params = inWsdlParamContainer.getParamNames(); // If we have already saved fields mapping, we only show these mappings for ( int cpt = 0; cpt < params.length; cpt++ ) { ValueMetaInterface value = new ValueMeta( params[cpt], XsdType.xsdTypeToKettleType( inWsdlParamContainer .getParamType( params[cpt] ) ) ); r.addValueMeta( value ); } } return r; }
public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException { RowMeta row = new RowMeta(); for ( int i = 0; i < outputFields.length; i++ ) { XMLField field = outputFields[i]; row.addValueMeta( new ValueMeta( field.getFieldName(), field.getType(), field.getLength(), field.getPrecision() ) ); } return row; }
public StringEvaluationResult build() { ValueMetaInterface meta = new ValueMeta( name, type ); meta.setConversionMask( format ); meta.setTrimType( trimType ); meta.setDecimalSymbol( decimalSymbol ); meta.setGroupingSymbol( groupingSymbol ); meta.setLength( length ); meta.setPrecision( precision ); return new StringEvaluationResult( meta ); }
ValueMetaInterface filename = new ValueMeta("filename", ValueMetaInterface.TYPE_STRING); filename.setOrigin(name); filename.setLength(255); ValueMetaInterface ft = new ValueMeta("filetype", ValueMetaInterface.TYPE_STRING); ft.setLength(50); ft.setOrigin(name); ValueMetaInterface shnr = new ValueMeta("shapenr", ValueMetaInterface.TYPE_INTEGER); shnr.setOrigin(name); row.addValueMeta( shnr ); ValueMetaInterface pnr = new ValueMeta("partnr", ValueMetaInterface.TYPE_INTEGER); pnr.setOrigin(name); row.addValueMeta( pnr ); ValueMetaInterface nrp = new ValueMeta("nrparts", ValueMetaInterface.TYPE_INTEGER); nrp.setOrigin(name); row.addValueMeta( nrp ); ValueMetaInterface ptnr = new ValueMeta("pointnr", ValueMetaInterface.TYPE_INTEGER); ptnr.setOrigin(name); row.addValueMeta( ptnr ); ValueMetaInterface nrpt = new ValueMeta("nrpointS", ValueMetaInterface.TYPE_INTEGER); nrpt.setOrigin(name); row.addValueMeta( nrpt ); ValueMetaInterface x = new ValueMeta("x", ValueMetaInterface.TYPE_NUMBER);
int pos = 1; if ( resultname != null && resultname.length() != 0 ) { ValueMeta vMeta = new ValueMeta( resultname, resulttype ); Object v = null; switch ( resulttype ) {
public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface v = new ValueMeta( this.getValueXMLfield(), ValueMetaInterface.TYPE_STRING ); v.setOrigin( name ); TransMeta transMeta = (TransMeta) space; try { // Row should only include fields from the target and not the source. During the preview table generation // the fields from all previous steps (source and target) are included in the row so lets remove the // source fields. for ( String fieldName : transMeta.getStepFields( transMeta.findStep( getSourceXMLstep() ), null, null ).getFieldNames() ) { row.removeValueMeta( fieldName ); } } catch ( KettleValueException e ) { // Pass } row.addValueMeta( v ); }
/** * Create a new row metadata object from XML * * @param node the XML node to deserialize from * @throws IOException Thrown in case there is an (Base64/GZip) decoding problem */ public RowMeta( Node node ) throws KettleException { this(); int nrValues = XMLHandler.countNodes( node, ValueMeta.XML_META_TAG ); for ( int i = 0; i < nrValues; i++ ) { ValueMeta valueMetaSource = new ValueMeta( XMLHandler.getSubNodeByNr( node, ValueMeta.XML_META_TAG, i ) ); ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( valueMetaSource.getName(), valueMetaSource.getType(), valueMetaSource.getLength(), valueMetaSource.getPrecision() ); ValueMetaFactory.cloneInfo( valueMetaSource, valueMeta ); addValueMeta( valueMeta ); } }
ValueMetaInterface valueMeta = new ValueMeta( field.getFieldName(), valueType, field.getLength(), -1 ); if ( conversionMask != null ) { valueMeta.setConversionMask( conversionMask );
ValueMetaInterface valueMeta = new ValueMeta( field.getFieldName(), valueType, field.getLength(), -1 ); if ( conversionMask != null ) { valueMeta.setConversionMask( conversionMask );
vm = new ValueMeta(); meta.getRuleResultColumns().add( vm ); meta.setChanged();
vm = new ValueMeta(); meta.getRuleResultColumns().add( vm ); meta.setChanged();
ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( filenameField ), ValueMeta.TYPE_STRING ); v.setLength( 250 ); v.setPrecision( -1 ); ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( rowNumberField ), ValueMeta.TYPE_INTEGER ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); new ValueMeta( space.environmentSubstitute( getShortFileNameField() ), ValueMeta.TYPE_STRING ); v.setLength( 100, -1 ); v.setOrigin( name ); ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getExtensionField() ), ValueMeta.TYPE_STRING ); v.setLength( 100, -1 ); v.setOrigin( name ); ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getPathField() ), ValueMeta.TYPE_STRING ); v.setLength( 100, -1 ); v.setOrigin( name ); ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( getSizeField() ), ValueMeta.TYPE_INTEGER ); v.setOrigin( name ); v.setLength( 9 ); ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( isHiddenField() ), ValueMeta.TYPE_BOOLEAN ); v.setOrigin( name ); r.addValueMeta( v ); new ValueMeta( space.environmentSubstitute( getLastModificationDateField() ), ValueMeta.TYPE_DATE );
@Override public void readRep( Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters ) throws KettleException { try { String name = rep.getStepAttributeString( id_step, 0, "value_name" ); String typedesc = rep.getStepAttributeString( id_step, 0, "value_type" ); String text = rep.getStepAttributeString( id_step, 0, "value_text" ); boolean isnull = rep.getStepAttributeBoolean( id_step, 0, "value_null" ); int length = (int) rep.getStepAttributeInteger( id_step, 0, "value_length" ); int precision = (int) rep.getStepAttributeInteger( id_step, 0, "value_precision" ); int type = ValueMetaFactory.getIdForValueMeta( typedesc ); value = new ValueMetaAndData( new ValueMeta( name, type ), null ); value.getValueMeta().setLength( length ); value.getValueMeta().setPrecision( precision ); if ( isnull ) { value.setValueData( null ); } else { ValueMetaInterface stringMeta = new ValueMetaString( name ); if ( type != ValueMetaInterface.TYPE_STRING ) { text = Const.trim( text ); } value.setValueData( value.getValueMeta().convertData( stringMeta, text ) ); } } catch ( KettleDatabaseException dbe ) { throw new KettleException( "error reading step with id_step=" + id_step + " from the repository", dbe ); } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step with id_step=" + id_step + " from the repository", e ); } }
String mask = XMLHandler.getTagValue( valnode, "mask" ); valueMeta = new ValueMeta( valname, valtype ); valueData = text; valueMeta.setLength( len );
TextFileInputField field = inputFields[i]; ValueMetaInterface valueMeta = new ValueMeta( field.getName(), field.getType() ); valueMeta.setConversionMask( field.getFormat() ); valueMeta.setLength( field.getLength() );
@Override public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface idValueMeta = new ValueMeta( VALUE_META_NAME, ValueMetaInterface.TYPE_STRING ); idValueMeta.setOrigin( origin ); rowMeta.addValueMeta( idValueMeta ); }