Search in sources :

Example 1 with DummyMeta

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;
}
Also used : DummyMeta(org.apache.hop.pipeline.transforms.dummy.DummyMeta) PluginRegistry(org.apache.hop.core.plugins.PluginRegistry) ITransformMeta(org.apache.hop.pipeline.transform.ITransformMeta) TransformMeta(org.apache.hop.pipeline.transform.TransformMeta) TransformPluginType(org.apache.hop.core.plugins.TransformPluginType)

Example 2 with DummyMeta

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);
    }
}
Also used : DummyMeta(org.apache.hop.pipeline.transforms.dummy.DummyMeta) HopDataOrchestrationPerspective(org.apache.hop.ui.hopgui.perspective.dataorch.HopDataOrchestrationPerspective) TransformMeta(org.apache.hop.pipeline.transform.TransformMeta) PipelineHopMeta(org.apache.hop.pipeline.PipelineHopMeta) ErrorDialog(org.apache.hop.ui.core.dialog.ErrorDialog) PipelineLoggingMeta(org.apache.hop.reflection.pipeline.transform.PipelineLoggingMeta) HopPipelineFileType(org.apache.hop.ui.hopgui.file.pipeline.HopPipelineFileType) PipelineMeta(org.apache.hop.pipeline.PipelineMeta)

Example 3 with DummyMeta

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);
    }
}
Also used : PipelineDataProbeMeta(org.apache.hop.reflection.probe.transform.PipelineDataProbeMeta) DummyMeta(org.apache.hop.pipeline.transforms.dummy.DummyMeta) HopDataOrchestrationPerspective(org.apache.hop.ui.hopgui.perspective.dataorch.HopDataOrchestrationPerspective) TransformMeta(org.apache.hop.pipeline.transform.TransformMeta) PipelineHopMeta(org.apache.hop.pipeline.PipelineHopMeta) ErrorDialog(org.apache.hop.ui.core.dialog.ErrorDialog) HopPipelineFileType(org.apache.hop.ui.hopgui.file.pipeline.HopPipelineFileType) PipelineMeta(org.apache.hop.pipeline.PipelineMeta)

Example 4 with DummyMeta

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;
}
Also used : DummyMeta(org.apache.hop.pipeline.transforms.dummy.DummyMeta) TransformMeta(org.apache.hop.pipeline.transform.TransformMeta)

Example 5 with DummyMeta

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;
}
Also used : DummyMeta(org.apache.hop.pipeline.transforms.dummy.DummyMeta) TransformMeta(org.apache.hop.pipeline.transform.TransformMeta) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString)

Aggregations

DummyMeta (org.apache.hop.pipeline.transforms.dummy.DummyMeta)19 TransformMeta (org.apache.hop.pipeline.transform.TransformMeta)16 PipelineHopMeta (org.apache.hop.pipeline.PipelineHopMeta)10 PipelineMeta (org.apache.hop.pipeline.PipelineMeta)10 ValueMetaString (org.apache.hop.core.row.value.ValueMetaString)5 PluginRegistry (org.apache.hop.core.plugins.PluginRegistry)4 LocalPipelineEngine (org.apache.hop.pipeline.engines.local.LocalPipelineEngine)4 FileDefinition (org.apache.hop.beam.metadata.FileDefinition)3 BeamInputMeta (org.apache.hop.beam.transforms.io.BeamInputMeta)3 BeamOutputMeta (org.apache.hop.beam.transforms.io.BeamOutputMeta)3 RowMetaAndData (org.apache.hop.core.RowMetaAndData)3 TransformPluginType (org.apache.hop.core.plugins.TransformPluginType)3 Pipeline (org.apache.hop.pipeline.Pipeline)3 RowProducer (org.apache.hop.pipeline.RowProducer)3 ITransform (org.apache.hop.pipeline.transform.ITransform)3 InjectorMeta (org.apache.hop.pipeline.transforms.injector.InjectorMeta)3 RowTransformCollector (org.apache.hop.pipeline.transforms.xml.RowTransformCollector)3 ErrorDialog (org.apache.hop.ui.core.dialog.ErrorDialog)3 HopPipelineFileType (org.apache.hop.ui.hopgui.file.pipeline.HopPipelineFileType)3 HopDataOrchestrationPerspective (org.apache.hop.ui.hopgui.perspective.dataorch.HopDataOrchestrationPerspective)3