Search in sources :

Example 11 with JobGraph

use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.

the class Spoon method addJobLog.

public void addJobLog() {
    JobGraph activeJobGraph = getActiveJobGraph();
    if (activeJobGraph != null) {
        activeJobGraph.jobLogDelegate.addJobLog();
        activeJobGraph.jobGridDelegate.addJobGrid();
    }
}
Also used : JobGraph(org.pentaho.di.ui.spoon.job.JobGraph)

Example 12 with JobGraph

use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.

the class Spoon method refreshGraph.

public void refreshGraph() {
    if (shell.isDisposed()) {
        return;
    }
    TabItem tabItem = tabfolder.getSelected();
    if (tabItem == null) {
        return;
    }
    TabMapEntry tabMapEntry = delegates.tabs.getTab(tabItem);
    if (tabMapEntry != null) {
        if (tabMapEntry.getObject() instanceof TransGraph) {
            TransGraph transGraph = (TransGraph) tabMapEntry.getObject();
            transGraph.redraw();
        }
        if (tabMapEntry.getObject() instanceof JobGraph) {
            JobGraph jobGraph = (JobGraph) tabMapEntry.getObject();
            jobGraph.redraw();
        }
    }
    setShellText();
}
Also used : TabItem(org.pentaho.xul.swt.tab.TabItem) CTabItem(org.eclipse.swt.custom.CTabItem) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 13 with JobGraph

use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.

the class Spoon method paste.

public void paste() {
    String clipContent = fromClipboard();
    if (clipContent != null) {
        // 
        try {
            Document document = XMLHandler.loadXMLString(clipContent);
            boolean transformation = XMLHandler.getSubNode(document, TransMeta.XML_TAG) != null;
            boolean job = XMLHandler.getSubNode(document, JobMeta.XML_TAG) != null;
            boolean steps = XMLHandler.getSubNode(document, Spoon.XML_TAG_TRANSFORMATION_STEPS) != null;
            boolean jobEntries = XMLHandler.getSubNode(document, Spoon.XML_TAG_JOB_JOB_ENTRIES) != null;
            if (transformation) {
                pasteTransformation();
            } else if (job) {
                pasteJob();
            } else if (steps) {
                TransGraph transGraph = getActiveTransGraph();
                if (transGraph != null && transGraph.getLastMove() != null) {
                    pasteXML(transGraph.getManagedObject(), clipContent, transGraph.getLastMove());
                }
            } else if (jobEntries) {
                JobGraph jobGraph = getActiveJobGraph();
                if (jobGraph != null && jobGraph.getLastMove() != null) {
                    pasteXML(jobGraph.getManagedObject(), clipContent, jobGraph.getLastMove());
                }
            }
        } catch (KettleXMLException e) {
            log.logError("Unable to paste", e);
        }
    }
}
Also used : JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph) Document(org.w3c.dom.Document)

Example 14 with JobGraph

use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.

the class Spoon method printJobFile.

private void printJobFile(JobMeta jobMeta) {
    JobGraph jobGraph = getActiveJobGraph();
    if (jobGraph == null) {
        return;
    }
    PrintSpool ps = new PrintSpool();
    Printer printer = ps.getPrinter(shell);
    // Create an image of the screen
    Point max = jobMeta.getMaximum();
    Image img = jobGraph.getJobImage(printer, max.x, max.y, 1.0f);
    ps.printImage(shell, img);
    img.dispose();
    ps.dispose();
}
Also used : JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) PrintSpool(org.pentaho.di.ui.core.PrintSpool) Printer(org.eclipse.swt.printing.Printer) Image(org.eclipse.swt.graphics.Image)

Example 15 with JobGraph

use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.

the class GraphTest method testDelSelectionsJob.

@Test
public void testDelSelectionsJob() {
    JobMeta jobMeta = mock(JobMeta.class);
    Spoon spoon = mock(Spoon.class);
    JobEntryCopy selected1 = mock(JobEntryCopy.class);
    JobEntryCopy selected2 = mock(JobEntryCopy.class);
    when(jobMeta.getSelectedEntries()).thenReturn(Arrays.asList(selected1, selected2));
    JobGraph jobGraph = mock(JobGraph.class);
    doCallRealMethod().when(jobGraph).setJobMeta(any(JobMeta.class));
    doCallRealMethod().when(jobGraph).setSpoon(any(Spoon.class));
    doCallRealMethod().when(jobGraph).delSelected(any(JobEntryCopy.class));
    jobGraph.setJobMeta(jobMeta);
    jobGraph.setSpoon(spoon);
    jobGraph.delSelected(null);
    verify(spoon).deleteJobEntryCopies(eq(jobMeta), AdditionalMatchers.aryEq(new JobEntryCopy[] { selected1, selected2 }));
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) Test(org.junit.Test)

Aggregations

JobGraph (org.pentaho.di.ui.spoon.job.JobGraph)27 TransGraph (org.pentaho.di.ui.spoon.trans.TransGraph)15 JobMeta (org.pentaho.di.job.JobMeta)8 TransMeta (org.pentaho.di.trans.TransMeta)6 Test (org.junit.Test)5 TabMapEntry (org.pentaho.di.ui.spoon.TabMapEntry)5 TabItem (org.pentaho.xul.swt.tab.TabItem)5 EngineMetaInterface (org.pentaho.di.core.EngineMetaInterface)4 KettleException (org.pentaho.di.core.exception.KettleException)4 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)4 FileObject (org.apache.commons.vfs2.FileObject)3 Point (org.pentaho.di.core.gui.Point)3 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)3 AbstractMeta (org.pentaho.di.base.AbstractMeta)2 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)2 TransAction (org.pentaho.di.core.undo.TransAction)2 JobExecutionConfiguration (org.pentaho.di.job.JobExecutionConfiguration)2 PurRepository (org.pentaho.di.repository.pur.PurRepository)2 IAbsSecurityProvider (org.pentaho.di.ui.repository.pur.services.IAbsSecurityProvider)2 Spoon (org.pentaho.di.ui.spoon.Spoon)2