本文整理汇总了Java中org.pentaho.di.core.plugins.StepPluginType类的典型用法代码示例。如果您正苦于以下问题:Java StepPluginType类的具体用法?Java StepPluginType怎么用?Java StepPluginType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StepPluginType类属于org.pentaho.di.core.plugins包,在下文中一共展示了StepPluginType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGet
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("application/json");
final PluginRegistry registry = PluginRegistry.getInstance();
final List<PluginInterface> basesteps = registry.getPlugins(StepPluginType.class);
final List<String> basecat = registry.getCategories(StepPluginType.class);
List<Map<String, Object>> categoryList = new ArrayList<Map<String, Object>>();
Map<String, Map<String, Object>> categoryMap = new HashMap<String, Map<String, Object>>();
for (String category : basecat) {
getCategoryMap(category, categoryList, categoryMap);
}
for (PluginInterface pluginInterface : basesteps) {
Map<String, Object> thisCategory = getCategoryMap(pluginInterface.getCategory(), categoryList, categoryMap);
List<Map<String, String>> stepList = (List<Map<String, String>>) thisCategory.get("steps");
Map<String, String> step = new HashMap<String, String>();
step.put("name", pluginInterface.getIds()[0]);
step.put("label", pluginInterface.getName());
step.put("image", KThinStepImageServlet.CONTEXT_PATH.substring(1) + "/?name=" + pluginInterface.getIds()[0]);
stepList.add(step);
}
resp.getWriter().print(JSON.toString(categoryList));
resp.getWriter().flush();
}
示例2: doGet
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("image/png");
String id = req.getParameter("name");
PluginInterface pluginInterface = images.get(id);
if (pluginInterface == null) {
for (PluginInterface pluginInterface1 : registry.getPlugins(StepPluginType.class)) {
if (pluginInterface1.getIds()[0].equalsIgnoreCase(id)) {
pluginInterface = pluginInterface1;
}
}
}
OutputStream outputStream = resp.getOutputStream();
try {
IOUtils.copy(getImage(pluginInterface), outputStream);
} catch (KettlePluginException e) {
throw new ServletException(e);
}
outputStream.flush();
}
示例3: generatePreviewTransformation
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
public static final TransMeta generatePreviewTransformation(VariableSpace parent, StepMetaInterface oneMeta, String oneStepname)
{
PluginRegistry registry = PluginRegistry.getInstance();
TransMeta previewMeta = new TransMeta(parent);
// The following operation resets the internal variables!
//
previewMeta.setName(parent==null ? "Preview transformation" : parent.toString());
// At it to the first step.
StepMeta one = new StepMeta(registry.getPluginId(StepPluginType.class, oneMeta), oneStepname, oneMeta);
one.setLocation(50,50);
one.setDraw(true);
previewMeta.addStep(one);
DummyTransMeta twoMeta = new DummyTransMeta();
StepMeta two = new StepMeta(registry.getPluginId(StepPluginType.class, twoMeta), "dummy", twoMeta); //$NON-NLS-1$
two.setLocation(250,50);
two.setDraw(true);
previewMeta.addStep(two);
TransHopMeta hop = new TransHopMeta(one, two);
previewMeta.addTransHop(hop);
return previewMeta;
}
示例4: StepMeta
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* @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)
{
this.stepid = PluginRegistry.getInstance().getPluginId(StepPluginType.class, stepMetaInterface);
}
this.stepname = stepname;
setStepMetaInterface( stepMetaInterface );
selected = false;
distributes = true;
copies = 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>();
}
示例5: loadStepImages
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
private Map<String, BufferedImage> loadStepImages() throws KettleException {
Map<String, BufferedImage> map = new HashMap<String, BufferedImage>();
for (PluginInterface plugin: PluginRegistry.getInstance().getPlugins(StepPluginType.class)) {
try {
BufferedImage image = getImageIcon(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);
try {
getImageIcon(plugin);
} catch(Exception ex) {
//
}
}
}
return map;
}
示例6: createTransformationMeta
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* Creates a transformation with a row generator step and
* hopped to a GPLoadStep with the passed name.
*
* @param gpLoadStepname The name of the GPLoad step.
*
* @throws KettleException
*/
public TransMeta createTransformationMeta(String gpLoadStepname)
throws Exception {
// Create a new transformation...
TransMeta transMeta = new TransMeta();
transMeta.setName("row generatortest");
// Add a database connection to the trans meta
transMeta.addDatabase(new DatabaseMeta(GREENPLUM_DATABASE_CONNECTION));
// get a reference to the plugin registry
PluginRegistry registry = PluginRegistry.getInstance();
if (registry == null) {
throw new Exception("Plugin registry is null. Make sure that the Kettle environment was initialized.");
}
// create the GPLoad step
GPLoadMeta gpLoadMeta = new GPLoadMeta();
String dummyPid = registry.getPluginId(StepPluginType.class, gpLoadMeta);
StepMeta gpLoadStepMeta = new StepMeta(dummyPid, gpLoadStepname, (StepMetaInterface) gpLoadMeta);
transMeta.addStep(gpLoadStepMeta);
return transMeta;
}
示例7: setUp
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
@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 );
}
示例8: createRowGeneratorStep
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* 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 = (Const.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.setFieldFormat(new String[]{"", "", ""});
rowGeneratorMeta.setRowLimit("10");
// return the step meta
return generateRowsStep;
}
示例9: StepMeta
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* @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) {
this.stepid = PluginRegistry.getInstance().getPluginId(StepPluginType.class, stepMetaInterface);
}
this.stepname = 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>();
}
示例10: setUp
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
@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 );
}
示例11: createRowGeneratorStep
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* 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 = (Const.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;
}
示例12: setUp
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
@Before
public void setUp() throws KettlePluginException, SQLException {
PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
PluginRegistry.init( true );
loaderData = new VerticaBulkLoaderData();
loaderMeta = spy( new VerticaBulkLoaderMeta() );
TransMeta transMeta = new TransMeta();
transMeta.setName( "loader" );
PluginRegistry pluginRegistry = PluginRegistry.getInstance();
String loaderPid = pluginRegistry.getPluginId( StepPluginType.class, loaderMeta );
StepMeta stepMeta = new StepMeta( loaderPid, "loader", loaderMeta );
Trans trans = new Trans( transMeta );
transMeta.addStep( stepMeta );
trans.setRunning( true );
loaderMeta.setDatabaseMeta( mock( DatabaseMeta.class ) );
loader = spy( new VerticaBulkLoader( stepMeta, loaderData, 1, transMeta, trans ) );
loader.init( loaderMeta, loaderData );
doReturn( mock( VerticaCopyStream.class ) ).when( loader ).createVerticaCopyStream( anyString() );
}
示例13: createTransformationMeta
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* Creates a transformation with a row generator step and hopped to a GPLoadStep with the passed name.
*
* @param gpLoadStepname
* The name of the GPLoad step.
*
* @throws KettleException
*/
public TransMeta createTransformationMeta( String gpLoadStepname ) throws Exception {
// Create a new transformation...
TransMeta transMeta = new TransMeta();
transMeta.setName( "row generatortest" );
// Add a database connection to the trans meta
transMeta.addDatabase( new DatabaseMeta( GREENPLUM_DATABASE_CONNECTION ) );
// get a reference to the plugin registry
PluginRegistry registry = PluginRegistry.getInstance();
if ( registry == null ) {
throw new Exception( "Plugin registry is null. Make sure that the Kettle environment was initialized." );
}
// create the GPLoad step
GPLoadMeta gpLoadMeta = new GPLoadMeta();
String dummyPid = registry.getPluginId( StepPluginType.class, gpLoadMeta );
StepMeta gpLoadStepMeta = new StepMeta( dummyPid, gpLoadStepname, gpLoadMeta );
transMeta.addStep( gpLoadStepMeta );
return transMeta;
}
示例14: createRowGeneratorStep
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
/**
* 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;
}
示例15: createRestInputStep
import org.pentaho.di.core.plugins.StepPluginType; //导入依赖的package包/类
public StepMeta createRestInputStep( TransMeta transMeta, PluginRegistry registry ) throws Exception {
String inputName = "rest input step";
RestMeta meta = new RestMeta();
String inputPid = registry.getPluginId( StepPluginType.class, meta );
StepMeta inputStep = new StepMeta( inputPid, inputName, meta );
transMeta.addStep( inputStep );
meta.setDefault();
meta.setUrl( tester.createSocketConnector( true ) + "/context/simple/join" );
meta.setMethod( "POST" );
meta.setMatrixParameterField( new String[] { "pageSize" } );
meta.setMatrixParameterName( new String[] { "limit" } );
meta.setParameterField( new String[] { "name" } );
meta.setParameterName( new String[] { "name" } );
meta.setApplicationType( RestMeta.APPLICATION_TYPE_TEXT_PLAIN );
meta.setFieldName( "result" );
return inputStep;
}