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);
}
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);
}
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);
}
}
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();
}
}
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);
}
Aggregations