/** * Find the fields that are entering a certain step. * * @param stepMeta * The step queried * @return A row containing the fields (w/ origin) entering the step * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getPrevStepFields( StepMeta stepMeta ) throws KettleStepException { return getPrevStepFields( stepMeta, null ); }
protected void setSQLToolTip() { if ( wVariables.getSelection() ) { wSQL.setToolTipText( transMeta.environmentSubstitute( wSQL.getText() ) ); } }
/** * Find the fields that are entering a step with a certain name. * * @param stepname * The name of the step queried * @return A row containing the fields (w/ origin) entering the step * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getPrevStepFields( String stepname ) throws KettleStepException { return getPrevStepFields( findStep( stepname ) ); }
/** * Checks if the transformation is referenced by a file. If the transformation is not referenced by a repository, it * is assumed to be referenced by a file. * * @return true if the transformation is referenced by a file, false otherwise * @see #isRepReference() */ public boolean isFileReference() { return !isRepReference( getFilename(), this.getName() ); }
/** * Find the informational fields coming from an informational step into the step specified. * * @param stepname * The name of the step * @return A row containing fields with origin. * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getPrevInfoFields( String stepname ) throws KettleStepException { return getPrevInfoFields( findStep( stepname ) ); }
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { inputRowMeta = transMeta.getPrevStepFields( stepMeta ); infoRowMeta = transMeta.getPrevInfoFields( stepMeta ); outputRowMeta = transMeta.getThisStepFields( stepMeta, null, inputRowMeta.clone() ); populateFieldsTree(); } catch ( KettleException e ) { log.logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), e ); } } } };
protected void setupDatabaseMeta() { if ( this.getDatabaseMeta() == null ) { if ( getParentStepMeta() != null ) { TransMeta transMeta = getParentStepMeta().getParentTransMeta(); if ( transMeta != null ) { setDatabaseMeta( transMeta.findDatabase( transMeta.environmentSubstitute( getStringProperty( "AgileBIDatabase", "AgileBI" ) ) ) ); } } } }
/** * Searches the list of steps for a step with a certain name. * * @param name * The name of the step to look for * @return The step information or null if no nothing was found. */ public StepMeta findStep( String name ) { return findStep( name, null ); }
@Before public void setUp() throws Exception { meta = new StuffStreamMeta(); KettleLogStore.setLogChannelInterfaceFactory( logChannelFactory ); when( logChannelFactory.create( any(), any() ) ).thenReturn( logChannel ); when( logChannelFactory.create( any() ) ).thenReturn( logChannel ); when( mappingMetaRetriever.get( any(), any(), any(), any() ) ).thenReturn( subTransMeta ); when( subTransMeta.getPrevStepFields( anyString() ) ).thenReturn( prevRowMeta ); when( subTransMeta.getSteps() ).thenReturn( singletonList( subTransStepMeta ) ); when( subTransStepMeta.getStepMetaInterface() ).thenReturn( stepMetaInterface ); when( subTransStepMeta.getName() ).thenReturn( "SubStepName" ); meta.mappingMetaRetriever = mappingMetaRetriever; }
public void setFlags() { wlIgnoreFlagField.setEnabled( wErrorIgnored.getSelection() ); wIgnoreFlagField.setEnabled( wErrorIgnored.getSelection() ); DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() ); boolean hasErrorHandling = transMeta.findStep( stepname ).isDoingErrorHandling(); // Can't use batch yet when grabbing auto-generated keys... // Only enable batch option when not returning keys. // If we are on PostgreSQL (and look-a-likes), error handling is not supported. (PDI-366) // boolean enableBatch = wBatch.getSelection() && !transMeta.isUsingUniqueConnections(); enableBatch = enableBatch && !( databaseMeta != null && databaseMeta.supportsErrorHandlingOnBatchUpdates() && hasErrorHandling ); }
/** * Gets the name of the transformation. * * @return the transformation name */ public String getName() { if ( transMeta == null ) { return null; } return transMeta.getName(); }
private void loadRepositoryTrans( String transName, RepositoryDirectoryInterface repdir ) throws KettleException { // Read the transformation... // mappingTransMeta = repository.loadTransformation( transMeta.environmentSubstitute( transName ), repdir, null, true, null ); mappingTransMeta.clearChanged(); }
private void activeSequence() { boolean useDatabase = wUseDatabase.getSelection(); DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() ); wbSequence.setEnabled( databaseMeta == null ? false : useDatabase && databaseMeta.supportsSequences() ); }
/** * Counts the number of previous steps for a step name. * * @param stepname * The name of the step to start from * @return The number of preceding steps. * @deprecated */ @Deprecated public int findNrPrevSteps( String stepname ) { return findNrPrevSteps( findStep( stepname ), false ); }
/** * Retrieve an array of succeeding step names for a certain originating step name. * * @param stepname * The originating step name * @return An array of succeeding step names */ public String[] getPrevStepNames( String stepname ) { return getPrevStepNames( findStep( stepname ) ); }
@Test public void simpleConvert() { TransMeta meta = new TransMeta(); meta.setFilename( "fileName" ); meta.addStep( new StepMeta( "stepName", stepMetaInterface ) ); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getId(), is( meta.getFilename() ) ); assertThat( trans.getOperations().size(), is( 1 ) ); assertThat( trans.getOperations().get( 0 ).getId(), is( "stepName" ) ); }
private void getInfo( TableInputMeta meta, boolean preview ) { meta.setSQL( preview && !Utils.isEmpty( wSQL.getSelectionText() ) ? wSQL.getSelectionText() : wSQL.getText() ); meta.setDatabaseMeta( transMeta.findDatabase( wConnection.getText() ) ); meta.setRowLimit( wLimit.getText() ); StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get( 0 ); infoStream.setStepMeta( transMeta.findStep( wDatefrom.getText() ) ); meta.setExecuteEachInputRow( wEachRow.getSelection() ); meta.setVariableReplacementActive( wVariables.getSelection() ); meta.setLazyConversionActive( wLazyConversion.getSelection() ); }
/** * Return the fields that are emitted by a step with a certain name. * * @param stepname * The name of the step that's being queried. * @param row * A row containing the input fields or an empty row if no input is required. * @return A Row containing the output fields. * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getThisStepFields( String stepname, RowMetaInterface row ) throws KettleStepException { return getThisStepFields( findStep( stepname ), null, row ); }
private Trans createLegacyTrans() { try { return new Trans( transMeta, spoon.rep, transMeta.getName(), transMeta.getRepositoryDirectory().getPath(), transMeta.getFilename() ); } catch ( KettleException e ) { throw new RuntimeException( e ); } }
private boolean isTransOpened( String id, String path, String name ) { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getObjectId() != null && id.equals( t.getObjectId().getId() ) || ( path.equals( t.getRepositoryDirectory().getPath() ) && name.equals( t.getName() ) ) ) { return true; } } return false; }