/** * Support for CheckResultSourceInterface */ @Override public String getTypeId() { return this.getStepID(); }
@Override public String getStepID() { if ( stepMeta != null ) { return stepMeta.getStepID(); } return null; }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); SwingUniversalImage im = stepImages.get( steptype ); if ( im != null ) { // Draw the icon! drawImage( im, x + xOffset, y + xOffset, iconsize ); } }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); SwingUniversalImage im = stepImages.get( steptype ); if ( im != null ) { // Draw the icon! drawImage( im, x + xOffset, y + xOffset, iconsize ); } }
private static String getStepMetaCacheKey( StepMeta stepMeta, boolean info ) { return String.format( "%1$b-%2$s-%3$s", info, stepMeta.getStepID(), stepMeta.toString() ); }
public static String[] getMappingSteps( TransMeta mappingTransMeta, boolean mappingInput ) { List<StepMeta> steps = new ArrayList<StepMeta>(); for ( StepMeta stepMeta : mappingTransMeta.getSteps() ) { if ( mappingInput && stepMeta.getStepID().equals( "MappingInput" ) ) { steps.add( stepMeta ); } if ( !mappingInput && stepMeta.getStepID().equals( "MappingOutput" ) ) { steps.add( stepMeta ); } } String[] stepnames = new String[ steps.size() ]; for ( int i = 0; i < stepnames.length; i++ ) { stepnames[ i ] = steps.get( i ).getName(); } return stepnames; }
public static String[] getMappingSteps( TransMeta mappingTransMeta, boolean mappingInput ) { List<StepMeta> steps = new ArrayList<StepMeta>(); for ( StepMeta stepMeta : mappingTransMeta.getSteps() ) { if ( mappingInput && stepMeta.getStepID().equals( "MappingInput" ) ) { steps.add( stepMeta ); } if ( !mappingInput && stepMeta.getStepID().equals( "MappingOutput" ) ) { steps.add( stepMeta ); } } String[] stepnames = new String[ steps.size() ]; for ( int i = 0; i < stepnames.length; i++ ) { stepnames[ i ] = steps.get( i ).getName(); } return stepnames; }
private static void disableLazyConversion( TransMeta transMeta ) { transMeta.getSteps().stream().filter( step -> "CsvInput".equals( step.getStepID() ) ) .forEach( step -> ( (CsvInputMeta) step.getStepMetaInterface() ).setLazyConversionActive( false ) ); transMeta.getSteps().stream().filter( step -> "TableInput".equals( step.getStepID() ) ) .forEach( step -> ( (TableInputMeta) step.getStepMetaInterface() ).setLazyConversionActive( false ) ); }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); Image im = images.get( steptype ).getAsBitmapForSize( gc.getDevice(), Math.round( iconsize * magnification ), Math.round( iconsize * magnification ) ); if ( im != null ) { // Draw the icon! org.eclipse.swt.graphics.Rectangle bounds = im.getBounds(); gc.drawImage( im, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); } }
public void helpStep() { final StepMeta stepMeta = (StepMeta) selectionObject; PluginInterface stepPlugin = PluginRegistry.getInstance().findPluginWithId( StepPluginType.class, stepMeta.getStepID() ); HelpUtils.openHelpDialog( shell, stepPlugin ); }
protected TransMeta processLinkedJobs( TransMeta transMeta ) { for ( StepMeta stepMeta : transMeta.getSteps() ) { if ( stepMeta.getStepID().equalsIgnoreCase( "JobExecutor" ) ) { JobExecutorMeta jem = (JobExecutorMeta) stepMeta.getStepMetaInterface(); ObjectLocationSpecificationMethod specMethod = jem.getSpecificationMethod(); // If the reference is by filename, change it to Repository By Name. Otherwise it's fine so leave it alone if ( specMethod == ObjectLocationSpecificationMethod.FILENAME ) { jem.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME ); String filename = jem.getFileName(); String jobname = filename.substring( filename.lastIndexOf( "/" ) + 1, filename.lastIndexOf( '.' ) ); String directory = filename.substring( 0, filename.lastIndexOf( "/" ) ); jem.setJobName( jobname ); jem.setDirectoryPath( directory ); } } } return transMeta; }
protected TransMeta processLinkedTrans( TransMeta transMeta ) { for ( StepMeta stepMeta : transMeta.getSteps() ) { if ( stepMeta.getStepID().equalsIgnoreCase( "TransExecutor" ) ) { TransExecutorMeta tem = (TransExecutorMeta) stepMeta.getStepMetaInterface(); ObjectLocationSpecificationMethod specMethod = tem.getSpecificationMethod(); // If the reference is by filename, change it to Repository By Name. Otherwise it's fine so leave it alone if ( specMethod == ObjectLocationSpecificationMethod.FILENAME ) { tem.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME ); String filename = tem.getFileName(); String jobname = filename.substring( filename.lastIndexOf( "/" ) + 1, filename.lastIndexOf( '.' ) ); String directory = filename.substring( 0, filename.lastIndexOf( "/" ) ); tem.setTransName( jobname ); tem.setDirectoryPath( directory ); } } } return transMeta; }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); Image im = null; if ( stepMeta.isMissing() ) { im = GUIResource.getInstance().getImageMissing(); } else if ( stepMeta.isDeprecated() ) { im = GUIResource.getInstance().getImageDeprecated(); } else { im = images.get( steptype ).getAsBitmapForSize( gc.getDevice(), Math.round( iconsize * magnification ), Math.round( iconsize * magnification ) ); } if ( im != null ) { // Draw the icon! org.eclipse.swt.graphics.Rectangle bounds = im.getBounds(); gc.drawImage( im, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); } }
public boolean init() throws KettleException { // See if the steps support the SingleThreaded transformation type... // for ( StepMetaDataCombi combi : steps ) { TransformationType[] types = combi.stepMeta.getStepMetaInterface().getSupportedTransformationTypes(); boolean ok = false; for ( TransformationType type : types ) { if ( type == TransformationType.SingleThreaded ) { ok = true; } } if ( !ok ) { throw new KettleException( "Step '" + combi.stepname + "' of type '" + combi.stepMeta.getStepID() + "' is not yet supported in a Single Threaded transformation engine." ); } } // Initialize all the steps... // for ( StepMetaDataCombi combi : steps ) { boolean ok = combi.step.init( combi.meta, combi.data ); if ( !ok ) { return false; } } return true; }
if ( mappingStep.getStepID().equals( "MappingInput" ) ) { if ( stepMeta == null ) { stepMeta = mappingStep;
if ( mappingStep.getStepID().equals( "MappingOutput" ) ) { if ( stepMeta == null ) { stepMeta = mappingStep;
@Override public void refresh( AbstractMeta meta, TreeNode treeNode, String filter ) { TransMeta transMeta = (TransMeta) meta; for ( int i = 0; i < transMeta.nrSteps(); i++ ) { StepMeta stepMeta = transMeta.getStep( i ); if ( stepMeta.isMissing() ) { continue; } PluginInterface stepPlugin = PluginRegistry.getInstance().findPluginWithId( StepPluginType.class, stepMeta.getStepID() ); if ( !filterMatch( stepMeta.getName(), filter ) ) { continue; } Image stepIcon = GUIResource.getInstance().getImagesStepsSmall().get( stepPlugin.getIds()[ 0 ] ); if ( stepIcon == null ) { stepIcon = GUIResource.getInstance().getImageFolder(); } TreeNode childTreeNode = createTreeNode( treeNode, stepMeta.getName(), stepIcon ); childTreeNode.setData( "StepId", stepMeta.getStepID() ); if ( stepMeta.isShared() ) { childTreeNode.setFont( GUIResource.getInstance().getFontBold() ); } if ( !stepMeta.isDrawn() ) { childTreeNode.setForeground( GUIResource.getInstance().getColorDarkGray() ); } } }
@Test public void stepMetaXmlConsistency() throws Exception { StepMeta meta = new StepMeta( "id", "name", null ); StepMetaInterface smi = new MissingTrans( meta.getName(), meta.getStepID() ); meta.setStepMetaInterface( smi ); StepMeta fromXml = StepMeta.fromXml( meta.getXML() ); assertThat( meta.getXML(), is( fromXml.getXML() ) ); }
transformationId, stepMeta.getName(), stepMeta.getDescription(), stepMeta.getStepID(), stepMeta .isDistributes(), stepMeta.getCopies(), stepMeta.getLocation() == null ? -1 : stepMeta.getLocation().x, stepMeta.getLocation() == null ? -1 : stepMeta.getLocation().y,