@Test public void testGetFields() throws KettleStepException { SalesforceInputMeta meta = new SalesforceInputMeta(); meta.setDefault(); RowMetaInterface r = new RowMeta(); meta.getFields( r, "thisStep", null, null, new Variables(), null, null ); assertEquals( 0, r.size() ); meta.setInputFields( new SalesforceInputField[]{ new SalesforceInputField( "field1" ) } ); r.clear(); meta.getFields( r, "thisStep", null, null, new Variables(), null, null ); assertEquals( 1, r.size() ); meta.setIncludeDeletionDate( true ); meta.setDeletionDateField( "DeletionDate" ); meta.setIncludeModule( true ); meta.setModuleField( "ModuleName" ); meta.setIncludeRowNumber( true ); meta.setRowNumberField( "RN" ); meta.setIncludeSQL( true ); meta.setSQLField( "sqlField" ); meta.setIncludeTargetURL( true ); meta.setTargetURLField( "Target" ); meta.setIncludeTimestamp( true ); meta.setTimestampField( "TS" ); r.clear(); meta.getFields( r, "thisStep", null, null, new Variables(), null, null ); assertEquals( 7, r.size() ); assertTrue( r.indexOfValue( "field1" ) >= 0 ); assertTrue( r.indexOfValue( "DeletionDate" ) >= 0 ); assertTrue( r.indexOfValue( "ModuleName" ) >= 0 ); assertTrue( r.indexOfValue( "RN" ) >= 0 ); assertTrue( r.indexOfValue( "sqlField" ) >= 0 ); assertTrue( r.indexOfValue( "Target" ) >= 0 ); assertTrue( r.indexOfValue( "TS" ) >= 0 ); }
public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { int i; for ( i = 0; i < inputFields.length; i++ ) { SalesforceInputField field = inputFields[i]; int type = field.getType(); if ( type == ValueMetaInterface.TYPE_NONE ) { type = ValueMetaInterface.TYPE_STRING; } try { ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type ); v.setLength( field.getLength() ); v.setPrecision( field.getPrecision() ); v.setOrigin( name ); v.setConversionMask( field.getFormat() ); v.setDecimalSymbol( field.getDecimalSymbol() ); v.setGroupingSymbol( field.getGroupSymbol() ); v.setCurrencySymbol( field.getCurrencySymbol() ); r.addValueMeta( v ); } catch ( Exception e ) { throw new KettleStepException( e ); } } if ( includeTargetURL && !Utils.isEmpty( targetURLField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( targetURLField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeModule && !Utils.isEmpty( moduleField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( moduleField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeSQL && !Utils.isEmpty( sqlField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( sqlField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeTimestamp && !Utils.isEmpty( timestampField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( timestampField ) ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeRowNumber && !Utils.isEmpty( rowNumberField ) ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeDeletionDate && !Utils.isEmpty( deletionDateField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( deletionDateField ) ); v.setOrigin( name ); r.addValueMeta( v ); } }
SalesforceInputMeta extends SalesforceStepMeta { public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { int i; for ( i = 0; i < inputFields.length; i++ ) { SalesforceInputField field = inputFields[i]; int type = field.getType(); if ( type == ValueMetaInterface.TYPE_NONE ) { type = ValueMetaInterface.TYPE_STRING; } try { ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type ); v.setLength( field.getLength() ); v.setPrecision( field.getPrecision() ); v.setOrigin( name ); v.setConversionMask( field.getFormat() ); v.setDecimalSymbol( field.getDecimalSymbol() ); v.setGroupingSymbol( field.getGroupSymbol() ); v.setCurrencySymbol( field.getCurrencySymbol() ); r.addValueMeta( v ); } catch ( Exception e ) { throw new KettleStepException( e ); } } if ( includeTargetURL && !Utils.isEmpty( targetURLField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( targetURLField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeModule && !Utils.isEmpty( moduleField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( moduleField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeSQL && !Utils.isEmpty( sqlField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( sqlField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeTimestamp && !Utils.isEmpty( timestampField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( timestampField ) ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeRowNumber && !Utils.isEmpty( rowNumberField ) ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeDeletionDate && !Utils.isEmpty( deletionDateField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( deletionDateField ) ); v.setOrigin( name ); r.addValueMeta( v ); } } }
SalesforceInputMeta extends SalesforceStepMeta { public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { int i; for ( i = 0; i < inputFields.length; i++ ) { SalesforceInputField field = inputFields[i]; int type = field.getType(); if ( type == ValueMetaInterface.TYPE_NONE ) { type = ValueMetaInterface.TYPE_STRING; } try { ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type ); v.setLength( field.getLength() ); v.setPrecision( field.getPrecision() ); v.setOrigin( name ); v.setConversionMask( field.getFormat() ); v.setDecimalSymbol( field.getDecimalSymbol() ); v.setGroupingSymbol( field.getGroupSymbol() ); v.setCurrencySymbol( field.getCurrencySymbol() ); r.addValueMeta( v ); } catch ( Exception e ) { throw new KettleStepException( e ); } } if ( includeTargetURL && !Utils.isEmpty( targetURLField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( targetURLField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeModule && !Utils.isEmpty( moduleField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( moduleField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeSQL && !Utils.isEmpty( sqlField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( sqlField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeTimestamp && !Utils.isEmpty( timestampField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( timestampField ) ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeRowNumber && !Utils.isEmpty( rowNumberField ) ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeDeletionDate && !Utils.isEmpty( deletionDateField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( deletionDateField ) ); v.setOrigin( name ); r.addValueMeta( v ); } } SalesforceInputMeta(); }
SalesforceInputMeta extends SalesforceStepMeta { public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { int i; for ( i = 0; i < inputFields.length; i++ ) { SalesforceInputField field = inputFields[i]; int type = field.getType(); if ( type == ValueMetaInterface.TYPE_NONE ) { type = ValueMetaInterface.TYPE_STRING; } try { ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type ); v.setLength( field.getLength() ); v.setPrecision( field.getPrecision() ); v.setOrigin( name ); v.setConversionMask( field.getFormat() ); v.setDecimalSymbol( field.getDecimalSymbol() ); v.setGroupingSymbol( field.getGroupSymbol() ); v.setCurrencySymbol( field.getCurrencySymbol() ); r.addValueMeta( v ); } catch ( Exception e ) { throw new KettleStepException( e ); } } if ( includeTargetURL && !Utils.isEmpty( targetURLField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( targetURLField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeModule && !Utils.isEmpty( moduleField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( moduleField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeSQL && !Utils.isEmpty( sqlField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( sqlField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeTimestamp && !Utils.isEmpty( timestampField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( timestampField ) ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeRowNumber && !Utils.isEmpty( rowNumberField ) ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeDeletionDate && !Utils.isEmpty( deletionDateField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( deletionDateField ) ); v.setOrigin( name ); r.addValueMeta( v ); } } SalesforceInputMeta(); SalesforceInputField[] getInputFields(); void setInputFields( SalesforceInputField[] inputFields ); String getQuery(); void setQuery( String query ); boolean isSpecifyQuery(); void setSpecifyQuery( boolean specifyQuery ); boolean isQueryAll(); void setQueryAll( boolean value ); String getCondition(); void setCondition( String condition ); void setTargetURLField( String TargetURLField ); void setSQLField( String sqlField ); void setTimestampField( String timestampField ); void setModuleField( String module_field ); int getRecordsFilter(); void setRecordsFilter( int recordsFilter ); boolean includeTargetURL(); boolean includeSQL(); void setIncludeSQL( boolean includeSQL ); boolean includeTimestamp(); void setIncludeTimestamp( boolean includeTimestamp ); boolean includeModule(); void setIncludeTargetURL( boolean includeTargetURL ); void setIncludeModule( boolean includemodule ); boolean includeRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); boolean includeDeletionDate(); void setIncludeDeletionDate( boolean includeDeletionDate ); String getRowLimit(); void setRowLimit( String rowLimit ); String getRowNumberField(); String getDeletionDateField(); void setDeletionDateField( String value ); String getTargetURLField(); String getReadFrom(); void setReadFrom( String readFrom ); String getReadTo(); void setReadTo( String readTo ); String getSQLField(); String getTimestampField(); String getModuleField(); void setRowNumberField( String rowNumberField ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); String getXML(); void allocate( int nrfields ); int getNrFields(); void setDefault(); void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); }
SalesforceInputMeta extends SalesforceStepMeta { public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { int i; for ( i = 0; i < inputFields.length; i++ ) { SalesforceInputField field = inputFields[i]; int type = field.getType(); if ( type == ValueMetaInterface.TYPE_NONE ) { type = ValueMetaInterface.TYPE_STRING; } try { ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type ); v.setLength( field.getLength() ); v.setPrecision( field.getPrecision() ); v.setOrigin( name ); v.setConversionMask( field.getFormat() ); v.setDecimalSymbol( field.getDecimalSymbol() ); v.setGroupingSymbol( field.getGroupSymbol() ); v.setCurrencySymbol( field.getCurrencySymbol() ); r.addValueMeta( v ); } catch ( Exception e ) { throw new KettleStepException( e ); } } if ( includeTargetURL && !Utils.isEmpty( targetURLField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( targetURLField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeModule && !Utils.isEmpty( moduleField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( moduleField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeSQL && !Utils.isEmpty( sqlField ) ) { ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( sqlField ) ); v.setLength( 250 ); v.setPrecision( -1 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeTimestamp && !Utils.isEmpty( timestampField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( timestampField ) ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeRowNumber && !Utils.isEmpty( rowNumberField ) ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); r.addValueMeta( v ); } if ( includeDeletionDate && !Utils.isEmpty( deletionDateField ) ) { ValueMetaInterface v = new ValueMetaDate( space.environmentSubstitute( deletionDateField ) ); v.setOrigin( name ); r.addValueMeta( v ); } } SalesforceInputMeta(); SalesforceInputField[] getInputFields(); void setInputFields( SalesforceInputField[] inputFields ); String getQuery(); void setQuery( String query ); boolean isSpecifyQuery(); void setSpecifyQuery( boolean specifyQuery ); boolean isQueryAll(); void setQueryAll( boolean value ); String getCondition(); void setCondition( String condition ); void setTargetURLField( String TargetURLField ); void setSQLField( String sqlField ); void setTimestampField( String timestampField ); void setModuleField( String module_field ); int getRecordsFilter(); void setRecordsFilter( int recordsFilter ); boolean includeTargetURL(); boolean includeSQL(); void setIncludeSQL( boolean includeSQL ); boolean includeTimestamp(); void setIncludeTimestamp( boolean includeTimestamp ); boolean includeModule(); void setIncludeTargetURL( boolean includeTargetURL ); void setIncludeModule( boolean includemodule ); boolean includeRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); boolean includeDeletionDate(); void setIncludeDeletionDate( boolean includeDeletionDate ); String getRowLimit(); void setRowLimit( String rowLimit ); String getRowNumberField(); String getDeletionDateField(); void setDeletionDateField( String value ); String getTargetURLField(); String getReadFrom(); void setReadFrom( String readFrom ); String getReadTo(); void setReadTo( String readTo ); String getSQLField(); String getTimestampField(); String getModuleField(); void setRowNumberField( String rowNumberField ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); String getXML(); void allocate( int nrfields ); int getNrFields(); void setDefault(); void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); static String DATE_TIME_FORMAT; }