org.pentaho.di.core.plugins.StepPluginType Java Examples
The following examples show how to use
org.pentaho.di.core.plugins.StepPluginType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TextFileOutputIT.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * Creates a row generator step for this class.. * * @param name * @param registry * @return */ private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) { // Default the name if it is empty String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name ); // create the RowGenerator and Step Meta RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta(); String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta ); StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta ); // Set the field names, types and values rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } ); rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } ); rowGeneratorMeta.setValue( new String[] { "1", "Orlando", "Florida" } ); rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } ); rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } ); rowGeneratorMeta.setGroup( new String[] { "", "", "" } ); rowGeneratorMeta.setDecimal( new String[] { "", "", "" } ); rowGeneratorMeta.setCurrency( new String[] { "", "", "" } ); rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } ); rowGeneratorMeta.setRowLimit( "10" ); // return the step meta return generateRowsStep; }
Example #2
Source File: PGBulkLoaderMetaTest.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@Before public void setUp() { TransMeta transMeta = new TransMeta(); transMeta.setName( "loader" ); lm = new PGBulkLoaderMeta(); ld = new PGBulkLoaderData(); PluginRegistry plugReg = PluginRegistry.getInstance(); String loaderPid = plugReg.getPluginId( StepPluginType.class, lm ); stepMeta = new StepMeta( loaderPid, "loader", lm ); Trans trans = new Trans( transMeta ); transMeta.addStep( stepMeta ); loader = new PGBulkLoader( stepMeta, ld, 1, transMeta, trans ); }
Example #3
Source File: DeleteMetaTest.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@Before public void setUp() { TransMeta transMeta = new TransMeta(); transMeta.setName( "delete1" ); Map<String, String> vars = new HashMap<String, String>(); vars.put( "max.sz", "10" ); transMeta.injectVariables( vars ); dmi = new DeleteMeta(); dd = new DeleteData(); PluginRegistry plugReg = PluginRegistry.getInstance(); String deletePid = plugReg.getPluginId( StepPluginType.class, dmi ); stepMeta = new StepMeta( deletePid, "delete", dmi ); Trans trans = new Trans( transMeta ); transMeta.addStep( stepMeta ); del = new Delete( stepMeta, dd, 1, transMeta, trans ); del.copyVariablesFrom( transMeta ); }
Example #4
Source File: SwingGUIResource.java From pentaho-kettle with Apache License 2.0 | 6 votes |
private Map<String, SwingUniversalImage> loadStepImages() { Map<String, SwingUniversalImage> map = new HashMap<>(); for ( PluginInterface plugin : PluginRegistry.getInstance().getPlugins( StepPluginType.class ) ) { try { SwingUniversalImage image = getUniversalImageIcon( plugin ); for ( String id : plugin.getIds() ) { map.put( id, image ); } } catch ( Exception e ) { log.logError( "Unable to load step icon image for plugin: " + plugin.getName() + " (id=" + plugin.getIds()[0] + ")", e ); } } return map; }
Example #5
Source File: KettleEnvironment.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * Initializes the Kettle environment. This method performs the following operations: * <p/> * - Creates a Kettle "home" directory if it does not already exist - Reads in the kettle.properties file - * Initializes the logging back-end - Sets the console log level to debug - If specified by parameter, configures * Simple JNDI - Registers the native types and the plugins for the various plugin types - Reads the list of variables * - Initializes the Lifecycle listeners * * @param simpleJndi true to configure Simple JNDI, false otherwise * @throws KettleException Any errors that occur during initialization will throw a KettleException. */ public static void init( boolean simpleJndi ) throws KettleException { init( Arrays.asList( RowDistributionPluginType.getInstance(), StepPluginType.getInstance(), StepDialogFragmentType.getInstance(), PartitionerPluginType.getInstance(), JobEntryPluginType.getInstance(), JobEntryDialogFragmentType.getInstance(), LogTablePluginType.getInstance(), RepositoryPluginType.getInstance(), LifecyclePluginType.getInstance(), KettleLifecyclePluginType.getInstance(), ImportRulePluginType.getInstance(), CartePluginType.getInstance(), CompressionPluginType.getInstance(), AuthenticationProviderPluginType.getInstance(), AuthenticationConsumerPluginType.getInstance(), EnginePluginType.getInstance() ), simpleJndi ); }
Example #6
Source File: SpoonJobDelegate.java From pentaho-kettle with Apache License 2.0 | 6 votes |
private StepMeta getToStep( DatabaseMeta targetDbInfo, String table ) { String tostepname = BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.ToStep.Name" ) + table + "]"; TableOutputMeta toi = new TableOutputMeta(); toi.setDatabaseMeta( targetDbInfo ); toi.setTableName( table ); toi.setCommitSize( 100 ); toi.setTruncateTable( true ); String tostepid = PluginRegistry.getInstance().getPluginId( StepPluginType.class, toi ); StepMeta tostep = new StepMeta( tostepid, tostepname, toi ); tostep.setLocation( 500, 100 ); tostep.setDraw( true ); tostep .setDescription( BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.ToStep.Description1" ) + table + BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.ToStep.Description2" ) + targetDbInfo + "]" ); return tostep; }
Example #7
Source File: StepMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * @param stepname * The name of the new step * @param stepMetaInterface * The step metadata interface to use (TextFileInputMeta, etc) */ public StepMeta( String stepname, StepMetaInterface stepMetaInterface ) { if ( stepMetaInterface != null ) { PluginRegistry registry = PluginRegistry.getInstance(); this.stepid = registry.getPluginId( StepPluginType.class, stepMetaInterface ); setDeprecationAndSuggestedStep(); } this.name = stepname; setStepMetaInterface( stepMetaInterface ); selected = false; distributes = true; copiesString = "1"; location = new Point( 0, 0 ); drawstep = false; description = null; stepPartitioningMeta = new StepPartitioningMeta(); // targetStepPartitioningMeta = new StepPartitioningMeta(); clusterSchema = null; // non selected by default. remoteInputSteps = new ArrayList<RemoteStep>(); remoteOutputSteps = new ArrayList<RemoteStep>(); attributesMap = new HashMap<String, Map<String, String>>(); }
Example #8
Source File: TestUtilities.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * Create and return a SortRows step. * * @param name * @param sortFields [] Fields to sort by * @param ascending [] Boolean indicating whether the corresponding field is to be sorted in ascending or * descending order. * @param caseSensitive [] Boolean indicating whether the corresponding field is to have case as a factor in the * sort. * @param directory The directory in the file system where the sort is to take place if it can't fit into * memory? * @param sortSize ??? * @param pluginRegistry The environment's Kettle plugin registry. * @return */ public static synchronized StepMeta createSortRowsStep( String name, String[] sortFields, boolean[] ascending, boolean[] caseSensitive, String directory, int sortSize, PluginRegistry pluginRegistry ) { SortRowsMeta sortRowsMeta = new SortRowsMeta(); sortRowsMeta.setSortSize( Integer.toString( sortSize / 10 ) ); sortRowsMeta.setFieldName( sortFields ); sortRowsMeta.setAscending( ascending ); sortRowsMeta.setCaseSensitive( caseSensitive ); sortRowsMeta.setDirectory( directory ); String sortRowsStepPid = pluginRegistry.getPluginId( StepPluginType.class, sortRowsMeta ); StepMeta sortRowsStep = new StepMeta( sortRowsStepPid, name, sortRowsMeta ); return sortRowsStep; }
Example #9
Source File: JsonOutputTest.java From pentaho-kettle with Apache License 2.0 | 6 votes |
/** * Creates a row generator step for this class.. * * @param name * @param registry * @return */ private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) { // Default the name if it is empty String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name ); // create the RowGenerator and Step Meta RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta(); String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta ); StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta ); // Set the field names, types and values rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } ); rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } ); rowGeneratorMeta.setValue( new String[] { "1", "Florida", "Orlando" } ); rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } ); rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } ); rowGeneratorMeta.setGroup( new String[] { "", "", "" } ); rowGeneratorMeta.setDecimal( new String[] { "", "", "" } ); rowGeneratorMeta.setCurrency( new String[] { "", "", "" } ); rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } ); rowGeneratorMeta.setRowLimit( "10" ); // return the step meta return generateRowsStep; }
Example #10
Source File: StepMeta.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void setDeprecationAndSuggestedStep() { PluginRegistry registry = PluginRegistry.getInstance(); final List<PluginInterface> deprecatedSteps = registry.getPluginsByCategory( StepPluginType.class, BaseMessages.getString( PKG, "BaseStep.Category.Deprecated" ) ); for ( PluginInterface p : deprecatedSteps ) { String[] ids = p.getIds(); if ( !ArrayUtils.isEmpty( ids ) && ids[0].equals( this.stepid ) ) { this.isDeprecated = true; this.suggestion = registry.findPluginWithId( StepPluginType.class, this.stepid ) != null ? registry.findPluginWithId( StepPluginType.class, this.stepid ).getSuggestion() : ""; break; } } }
Example #11
Source File: ConstantIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #12
Source File: TransTestFactory.java From pentaho-kettle with Apache License 2.0 | 5 votes |
static StepMeta getInjectorStepMeta() { InjectorMeta zeroMeta = new InjectorMeta(); StepMeta zero = new StepMeta( registry.getPluginId( StepPluginType.class, zeroMeta ), INJECTOR_STEPNAME, zeroMeta ); zero.setLocation( 50, 50 ); zero.setDraw( true ); return zero; }
Example #13
Source File: TransTestFactory.java From pentaho-kettle with Apache License 2.0 | 5 votes |
static StepMeta getReadStepMeta( String name ) { DummyTransMeta twoMeta = new DummyTransMeta(); StepMeta two = new StepMeta( registry.getPluginId( StepPluginType.class, twoMeta ), name, twoMeta ); two.setLocation( 250, 50 ); two.setDraw( true ); return two; }
Example #14
Source File: NormaliserMetaInjectionIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void initKettle() throws Exception { KettleEnvironment.init( false ); Map<Class<?>, String> classMap = new HashMap<>(); classMap.put( StepMetaInterface.class, "org.pentaho.di.trans.steps.metainject.MetaInjectMeta" ); List<String> libraries = new ArrayList<>(); PluginInterface plugin = new Plugin( new String[] { "MetaInject" }, StepPluginType.class, StepMetaInterface.class, "Flow", "MetaInjectMeta", null, null, false, false, classMap, libraries, null, null ); PluginRegistry.getInstance().registerPlugin( StepPluginType.class, plugin ); }
Example #15
Source File: TextFileInputIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #16
Source File: HelpUtils.java From pentaho-kettle with Apache License 2.0 | 5 votes |
public static String getHelpDialogTitle( PluginInterface plugin ) { if ( plugin == null ) { return ""; } String msgKey = ""; // TODO currently support only Step and JobEntry - extend if required. if ( plugin.getPluginType().equals( StepPluginType.class ) ) { msgKey = "System.ShowHelpDialog.StepPluginType.Title"; } else { msgKey = "System.ShowHelpDialog.JobEntryPluginType.Title"; } return BaseMessages.getString( PKG, msgKey, plugin.getName() ); }
Example #17
Source File: PropertyOutputIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #18
Source File: JobEntryJobIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #19
Source File: SafeStopTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #20
Source File: TestUtilities.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Create an injector step. * * @param name * @param registry * @return StepMeta */ public static StepMeta createInjectorStep( String name, PluginRegistry pluginRegistry ) { // create an injector step... InjectorMeta injectorMeta = new InjectorMeta(); // Set the information of the injector String injectorPid = pluginRegistry.getPluginId( StepPluginType.class, injectorMeta ); StepMeta injectorStep = new StepMeta( injectorPid, name, injectorMeta ); return injectorStep; }
Example #21
Source File: TestUtilities.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Creates a dummy * * @param name * @param pluginRegistry * @return StepMata */ public static synchronized StepMeta createDummyStep( String name, PluginRegistry pluginRegistry ) { DummyTransMeta dummyTransMeta = new DummyTransMeta(); String dummyPid = pluginRegistry.getPluginId( StepPluginType.class, dummyTransMeta ); StepMeta dummyStep = new StepMeta( dummyPid, name, dummyTransMeta ); return dummyStep; }
Example #22
Source File: SubtransExecutorTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }
Example #23
Source File: CsvInputBase.java From pentaho-kettle with Apache License 2.0 | 5 votes |
public StepMeta createInjectorStep( TransMeta transMeta, PluginRegistry registry ) { // // create an injector step... // String injectorStepname = "injector step"; InjectorMeta im = new InjectorMeta(); // Set the information of the injector. String injectorPid = registry.getPluginId( StepPluginType.class, im ); StepMeta injectorStep = new StepMeta( injectorPid, injectorStepname, im ); transMeta.addStep( injectorStep ); return injectorStep; }
Example #24
Source File: TestUtilities.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Create an injector step. * * @param name * @param registry * @return StepMeta */ public static synchronized StepMeta createInjectorStep( String name, PluginRegistry pluginRegistry ) { // create an injector step... InjectorMeta injectorMeta = new InjectorMeta(); // Set the information of the injector String injectorPid = pluginRegistry.getPluginId( StepPluginType.class, injectorMeta ); StepMeta injectorStep = new StepMeta( injectorPid, name, injectorMeta ); return injectorStep; }
Example #25
Source File: SpoonTreeDelegateTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@Test public void getTreeObjects_getStepById() { SpoonTreeDelegate std = spy( new SpoonTreeDelegate( spoon ) ); Tree selection = mock( Tree.class ); Tree core = mock( Tree.class ); TreeItem item = mock( TreeItem.class ); PluginInterface step = mock( PluginInterface.class ); PluginRegistry registry = mock( PluginRegistry.class ); TreeItem[] items = new TreeItem[] { item }; when( ConstUI.getTreeStrings( item ) ).thenReturn( new String[] { "Output", "Avro Output" } ); when( PluginRegistry.getInstance() ).thenReturn( registry ); doReturn( items ).when( core ).getSelection(); doReturn( "AvroOutputPlugin" ).when( item ).getData( anyString() ); doReturn( step ).when( registry ).findPluginWithId( StepPluginType.class, "AvroOutputPlugin" ); spoon.showJob = false; spoon.showTrans = true; TreeSelection[] ts = std.getTreeObjects( core, selection, core ); assertEquals( 1, ts.length ); assertEquals( step, ts[ 0 ].getSelection() ); }
Example #26
Source File: JsonOutputTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Create a dummy step for this class. * * @param name * @param registry * @return */ private StepMeta createDummyStep( String name, PluginRegistry registry ) { // Create a dummy step 1 and add it to the tranMeta String dummyStepName = "dummy step"; DummyTransMeta dm1 = new DummyTransMeta(); String dummyPid1 = registry.getPluginId( StepPluginType.class, dm1 ); StepMeta dummyStep = new StepMeta( dummyPid1, dummyStepName, dm1 ); return dummyStep; }
Example #27
Source File: RestInputIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
protected Trans createAndTestTrans( PluginRegistry registry, TransMeta transMeta, StepMeta inputStep, RowStepCollector rowStepCollector, String name, int limit ) throws KettleException { // // Create a dummy step // String dummyStepname = "dummy step"; DummyTransMeta dm1 = new DummyTransMeta(); String dummyPid1 = registry.getPluginId( StepPluginType.class, dm1 ); StepMeta dummyStep1 = new StepMeta( dummyPid1, dummyStepname, dm1 ); transMeta.addStep( dummyStep1 ); TransHopMeta hi3 = new TransHopMeta( inputStep, dummyStep1 ); transMeta.addTransHop( hi3 ); // Now execute the transformation... Trans trans = new Trans( transMeta ); trans.prepareExecution( null ); StepInterface si = trans.getStepInterface( dummyStepname, 0 ); si.addRowListener( rowStepCollector ); RowProducer rp = trans.addRowProducer( inputStep.getName(), 0 ); RowMeta rowMeta = new RowMeta(); rowMeta.addValueMeta( new ValueMetaString( "pageSize" ) ); rowMeta.addValueMeta( new ValueMetaString( "name" ) ); rp.putRow( rowMeta, new Object[] { Integer.valueOf( limit ), name } ); rp.finished(); return trans; }
Example #28
Source File: TextFileOutputIT.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Create a dummy step for this class. * * @param name * @param registry * @return */ private StepMeta createDummyStep( String name, PluginRegistry registry ) { // Create a dummy step 1 and add it to the tranMeta String dummyStepName = "dummy step"; DummyTransMeta dm1 = new DummyTransMeta(); String dummyPid1 = registry.getPluginId( StepPluginType.class, dm1 ); StepMeta dummyStep = new StepMeta( dummyPid1, dummyStepName, dm1 ); return dummyStep; }
Example #29
Source File: TestUtilities.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Creates a dummy * * @param name * @param pluginRegistry * @return StepMata */ public static synchronized StepMeta createDummyStep( String name, PluginRegistry pluginRegistry ) { DummyTransMeta dummyTransMeta = new DummyTransMeta(); String dummyPid = pluginRegistry.getPluginId( StepPluginType.class, dummyTransMeta ); StepMeta dummyStep = new StepMeta( dummyPid, name, dummyTransMeta ); return dummyStep; }
Example #30
Source File: TransMetaConverterTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@BeforeClass public static void init() throws Exception { KettleClientEnvironment.init(); PluginRegistry.addPluginType( StepPluginType.getInstance() ); PluginRegistry.init(); if ( !Props.isInitialized() ) { Props.init( 0 ); } }