Search in sources :

Example 71 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class Spoon method helpJobEntry.

public void helpJobEntry() {
    final JobEntryCopy jobEntry = (JobEntryCopy) selectionObject;
    String jobName = jobEntry.getName();
    PluginInterface jobEntryPlugin = PluginRegistry.getInstance().findPluginWithName(JobEntryPluginType.class, jobName);
    HelpUtils.openHelpDialog(shell, jobEntryPlugin);
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) PluginInterface(org.pentaho.di.core.plugins.PluginInterface) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString)

Example 72 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class Spoon method editJobEntry.

public void editJobEntry() {
    final JobMeta jobMeta = (JobMeta) selectionObjectParent;
    final JobEntryCopy jobEntry = (JobEntryCopy) selectionObject;
    editJobEntry(jobMeta, jobEntry);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy)

Example 73 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class Spoon method refreshJobEntriesSubtree.

private void refreshJobEntriesSubtree(TreeItem tiJobName, JobMeta jobMeta, GUIResource guiResource) {
    TreeItem tiJobEntriesTitle = createTreeItem(tiJobName, STRING_JOB_ENTRIES, guiResource.getImageFolder());
    for (int i = 0; i < jobMeta.nrJobEntries(); i++) {
        JobEntryCopy jobEntry = jobMeta.getJobEntry(i);
        if (!filterMatch(jobEntry.getName()) && !filterMatch(jobEntry.getDescription())) {
            continue;
        }
        TreeItem tiJobEntry = ConstUI.findTreeItem(tiJobEntriesTitle, jobEntry.getName());
        if (tiJobEntry != null) {
            // only show it once
            continue;
        }
        // if (jobEntry.isShared())
        // tiStep.setFont(guiResource.getFontBold()); TODO:
        // allow job entries to be shared as well...
        Image icon;
        if (jobEntry.isStart()) {
            icon = GUIResource.getInstance().getImageStartMedium();
        } else if (jobEntry.isDummy()) {
            icon = GUIResource.getInstance().getImageDummyMedium();
        } else {
            String key = jobEntry.getEntry().getPluginId();
            icon = GUIResource.getInstance().getImagesJobentriesSmall().get(key);
        }
        createTreeItem(tiJobEntriesTitle, jobEntry.getName(), icon);
    }
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) TreeItem(org.eclipse.swt.widgets.TreeItem) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) Image(org.eclipse.swt.graphics.Image) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 74 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-metaverse by pentaho.

the class MetaverseValidationIT method testJobEntryNodes.

@Test
public void testJobEntryNodes() throws Exception {
    for (JobNode jobNode : root.getJobs()) {
        JobMeta jobMeta = new JobMeta(new FileInputStream(jobNode.getPath()), null, null);
        int numJobEntries = jobMeta.nrJobEntries();
        int matchCount = 0;
        for (int i = 0; i < numJobEntries; i++) {
            JobEntryCopy jobEntry = jobMeta.getJobEntry(i);
            assertNotNull(jobEntry);
            JobEntryNode jobEntryNode = jobNode.getJobEntryNode(jobEntry.getName());
            assertNotNull("Job Entry " + jobEntry.getName() + " should be in the graph!", jobEntryNode);
            assertEquals(jobEntry.getName(), jobEntryNode.getName());
            assertEquals(jobEntry.getDescription(), jobEntryNode.getDescription());
            assertEquals("Incorrect type", DictionaryConst.NODE_TYPE_JOB_ENTRY, jobEntryNode.getType());
            assertEquals("Incorrect entity type", DictionaryConst.NODE_TYPE_JOB_ENTRY, jobEntryNode.getEntity().getName());
            matchCount++;
        }
        assertEquals("Not all job entries are accounted for in the graph for Job [" + jobMeta.getName() + "]", numJobEntries, matchCount);
        assertEquals("Incorrect number of job entries for in the graph for Job [" + jobMeta.getName() + "]", numJobEntries, getIterableSize(jobNode.getJobEntryNodes()));
        // it should be contained in a "Locator" node
        jobNode.getLocator();
    }
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) JobEntryNode(org.pentaho.metaverse.frames.JobEntryNode) JobNode(org.pentaho.metaverse.frames.JobNode) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Example 75 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-metaverse by pentaho.

the class JobAnalyzerTest method testAnalyzerJobWithEntriesAndHop.

@Test
public void testAnalyzerJobWithEntriesAndHop() throws MetaverseAnalyzerException {
    JobEntryCopy mockToEntryMeta = mock(JobEntryCopy.class);
    when(mockToEntryMeta.getEntry()).thenReturn(mockJobEntryInterface);
    when(mockToEntryMeta.getParentJobMeta()).thenReturn(mockContent);
    when(mockContent.nrJobEntries()).thenReturn(2);
    when(mockContent.getJobEntry(0)).thenReturn(mockJobEntry);
    when(mockContent.getJobEntry(1)).thenReturn(mockToEntryMeta);
    when(mockContent.nrJobHops()).thenReturn(1);
    final JobHopMeta hop = new JobHopMeta(mockJobEntry, mockToEntryMeta);
    when(mockContent.getJobHop(0)).thenReturn(hop);
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) JobHopMeta(org.pentaho.di.job.JobHopMeta) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Aggregations

JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)149 Point (org.pentaho.di.core.gui.Point)54 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)51 JobMeta (org.pentaho.di.job.JobMeta)47 KettleException (org.pentaho.di.core.exception.KettleException)30 Test (org.junit.Test)28 JobEntryInterface (org.pentaho.di.job.entry.JobEntryInterface)28 NotePadMeta (org.pentaho.di.core.NotePadMeta)24 JobHopMeta (org.pentaho.di.job.JobHopMeta)24 ArrayList (java.util.ArrayList)18 Job (org.pentaho.di.job.Job)18 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)16 JobEntryTrans (org.pentaho.di.job.entries.trans.JobEntryTrans)15 MessageBox (org.eclipse.swt.widgets.MessageBox)13 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)10 Result (org.pentaho.di.core.Result)8 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)8 AreaOwner (org.pentaho.di.core.gui.AreaOwner)8 JobEntrySpecial (org.pentaho.di.job.entries.special.JobEntrySpecial)8 Before (org.junit.Before)7