use of org.apache.hop.pipeline.transforms.dummy.DummyMeta in project hop by apache.
the class PipelinePreviewFactory method generatePreviewPipeline.
public static final PipelineMeta generatePreviewPipeline(IHopMetadataProvider metadataProvider, ITransformMeta oneMeta, String oneTransformName) {
PluginRegistry registry = PluginRegistry.getInstance();
PipelineMeta previewMeta = new PipelineMeta();
// Pass the MetaStore to look up shared metadata at runtime
//
previewMeta.setMetadataProvider(metadataProvider);
// The following operation resets the internal variables!
//
previewMeta.setName("Preview pipeline for " + oneTransformName);
// At it to the first transform.
TransformMeta one = new TransformMeta(registry.getPluginId(TransformPluginType.class, oneMeta), oneTransformName, oneMeta);
one.setLocation(50, 50);
previewMeta.addTransform(one);
DummyMeta twoMeta = new DummyMeta();
TransformMeta two = new TransformMeta(registry.getPluginId(TransformPluginType.class, twoMeta), "dummy", twoMeta);
two.setLocation(250, 50);
previewMeta.addTransform(two);
PipelineHopMeta hop = new PipelineHopMeta(one, two);
previewMeta.addPipelineHop(hop);
return previewMeta;
}
use of org.apache.hop.pipeline.transforms.dummy.DummyMeta in project hop by apache.
the class PipelineLogEditor method createPipelineFile.
/**
* Create a new pipeline file: ask the user for a name. Add a standard transform and a dummy to
* show how it works.
*
* @param parent
*/
private void createPipelineFile(Composite parent) {
try {
PipelineMeta pipelineMeta = new PipelineMeta();
// Add a Pipeline Logging transform...
//
PipelineLoggingMeta pipelineLoggingMeta = new PipelineLoggingMeta();
pipelineLoggingMeta.setLoggingTransforms(true);
TransformMeta pipelineLogging = new TransformMeta("Pipeline Logging", pipelineLoggingMeta);
pipelineLogging.setLocation(200, 150);
pipelineMeta.addTransform(pipelineLogging);
// Add a dummy
//
DummyMeta dummyMeta = new DummyMeta();
TransformMeta dummy = new TransformMeta("Save logging here", dummyMeta);
dummy.setLocation(500, 150);
pipelineMeta.addTransform(dummy);
// Add a hop between both transforms...
//
pipelineMeta.addPipelineHop(new PipelineHopMeta(pipelineLogging, dummy));
// Save it...
//
HopPipelineFileType<PipelineMeta> type = new HopPipelineFileType<>();
String filename = BaseDialog.presentFileDialog(// save
true, parent.getShell(), wFilename, manager.getVariables(), type.getFilterExtensions(), type.getFilterNames(), true);
if (filename != null) {
// User specified a pipeline filename
//
String realFilename = manager.getVariables().resolve(filename);
pipelineMeta.setFilename(realFilename);
pipelineMeta.clearChanged();
HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective();
// Switch to the perspective
//
perspective.activate();
// Open it in the Hop GUI
//
HopGui.getDataOrchestrationPerspective().addPipeline(hopGui, pipelineMeta, type);
// Save the file
hopGui.fileDelegate.fileSave();
}
} catch (Exception e) {
new ErrorDialog(parent.getShell(), "Error", "Error creating pipeline", e);
}
}
use of org.apache.hop.pipeline.transforms.dummy.DummyMeta in project hop by apache.
the class PipelineProbeEditor method createPipelineFile.
/**
* Create a new pipeline file: ask the user for a name. Add a standard transform and a dummy to
* show how it works.
*
* @param parent
*/
private void createPipelineFile(Composite parent) {
try {
PipelineMeta pipelineMeta = new PipelineMeta();
// Add a Pipeline Data Probe transform...
//
PipelineDataProbeMeta pipelineDataProbeMeta = new PipelineDataProbeMeta();
pipelineDataProbeMeta.setLoggingTransforms(true);
TransformMeta pipelineLogging = new TransformMeta("Pipeline Data Probe", pipelineDataProbeMeta);
pipelineLogging.setLocation(200, 150);
pipelineMeta.addTransform(pipelineLogging);
// Add a dummy
//
DummyMeta dummyMeta = new DummyMeta();
TransformMeta dummy = new TransformMeta("Process values here", dummyMeta);
dummy.setLocation(500, 150);
pipelineMeta.addTransform(dummy);
// Add a hop between both transforms...
//
pipelineMeta.addPipelineHop(new PipelineHopMeta(pipelineLogging, dummy));
// Save it...
//
HopPipelineFileType<PipelineMeta> type = new HopPipelineFileType<>();
String filename = BaseDialog.presentFileDialog(// save
true, parent.getShell(), wFilename, manager.getVariables(), type.getFilterExtensions(), type.getFilterNames(), true);
if (filename != null) {
// User specified a pipeline filename
//
String realFilename = manager.getVariables().resolve(filename);
pipelineMeta.setFilename(realFilename);
pipelineMeta.clearChanged();
HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective();
// Switch to the perspective
//
perspective.activate();
// Open it in the Hop GUI
//
HopGui.getDataOrchestrationPerspective().addPipeline(hopGui, pipelineMeta, type);
// Save the file
hopGui.fileDelegate.fileSave();
}
} catch (Exception e) {
new ErrorDialog(parent.getShell(), "Error", "Error creating pipeline", e);
}
}
use of org.apache.hop.pipeline.transforms.dummy.DummyMeta in project hop by apache.
the class TestUtilities method createDummyTransform.
/**
* Creates a dummy
*
* @param name
* @param pluginRegistry
* @return TransformMata
*/
public static synchronized TransformMeta createDummyTransform(String name, PluginRegistry pluginRegistry) {
DummyMeta dummyPipelineMeta = new DummyMeta();
String dummyPid = pluginRegistry.getPluginId(TransformPluginType.class, dummyPipelineMeta);
TransformMeta dummyTransform = new TransformMeta(dummyPid, name, dummyPipelineMeta);
return dummyTransform;
}
use of org.apache.hop.pipeline.transforms.dummy.DummyMeta in project hop by apache.
the class JsonOutputTest method createDummyTransform.
/**
* Create a dummy transform for this class.
*
* @param name
* @param registry
* @return
*/
private TransformMeta createDummyTransform(String name, PluginRegistry registry) {
// Create a dummy transform 1 and add it to the tranMeta
String dummyTransformName = "dummy transform";
DummyMeta dm1 = new DummyMeta();
String dummyPid1 = registry.getPluginId(TransformPluginType.class, dm1);
TransformMeta dummyTransform = new TransformMeta(dummyPid1, dummyTransformName, dm1);
return dummyTransform;
}
Aggregations