@Override public void addJobGraph( JobMeta jobMeta ) { delegates.jobs.addJobGraph( jobMeta ); }
public JobMeta[] getLoadedJobs() { if ( delegates != null && delegates.jobs != null ) { List<JobMeta> list = delegates.jobs.getJobList(); return list.toArray( new JobMeta[list.size()] ); } else { return null; } }
public void deleteJobEntryCopies( JobMeta jobMeta, JobEntryCopy[] jobEntry ) { delegates.jobs.deleteJobEntryCopies( jobMeta, jobEntry ); }
/** * @param jobMeta * the transformation to close, make sure it's ok to dispose of it BEFORE you call this. */ public void closeJob( JobMeta jobMeta ) { // Close the associated tabs... // TabMapEntry entry = getSpoon().delegates.tabs.findTabMapEntry( jobMeta ); if ( entry != null ) { getSpoon().delegates.tabs.removeTab( entry ); } // Also remove it from the item from the jobMap // Otherwise it keeps showing up in the objects tree // int index = getJobList().indexOf( jobMeta ); while ( index >= 0 ) { getJobList().remove( index ); index = getJobList().indexOf( jobMeta ); } getSpoon().refreshTree(); getSpoon().enableMenus(); }
public void update( Spoon spoon ) { SpoonJobDelegate origJobs = jobs; try { jobs = (SpoonJobDelegate) SpoonDelegateRegistry.getInstance().constructSpoonJobDelegate( spoon ); } catch ( InstanceCreationException e ) { jobs = new SpoonJobDelegate( spoon ); } if ( origJobs != null ) { // preserve open jobs for ( JobMeta jobMeta : origJobs.getLoadedJobs() ) { jobs.addJob( jobMeta ); } } SpoonTransformationDelegate origTrans = trans; try { trans = (SpoonTransformationDelegate) SpoonDelegateRegistry.getInstance().constructSpoonTransDelegate( spoon ); } catch ( InstanceCreationException e ) { trans = new SpoonTransformationDelegate( spoon ); } if ( origTrans != null ) { // preseve open trans for ( TransMeta transMeta : origTrans.getLoadedTransformations() ) { trans.addTransformation( transMeta ); } } } }
public boolean performFinish() { try { JobMeta jobMeta = ripDB( databases, page3.getJobname(), page3.getRepositoryDirectory(), page3.getDirectory(), page1 .getSourceDatabase(), page1.getTargetDatabase(), page2.getSelection() ); if ( jobMeta == null ) { return false; } if ( page3.getRepositoryDirectory() != null ) { spoon.saveToRepository( jobMeta, false ); } else { spoon.saveToFile( jobMeta ); } addJobGraph( jobMeta ); return true; } catch ( Exception e ) { new ErrorDialog( spoon.getShell(), "Error", "An unexpected error occurred!", e ); return false; } }
public void addJobGraph( JobMeta jobMeta ) { boolean added = addJob( jobMeta ); if ( added ) { if ( tabName.length() >= getMaxTabLength() ) { tabName = new StringBuilder().append( tabName.substring( 0, getMaxTabLength() ) ).append( "\u2026" ).toString();
public void copyEntry() { if ( RepositorySecurityUI.verifyOperations( shell, spoon.rep, RepositoryOperation.MODIFY_JOB, RepositoryOperation.EXECUTE_JOB ) ) { return; } List<JobEntryCopy> entries = jobMeta.getSelectedEntries(); Iterator<JobEntryCopy> iterator = entries.iterator(); while ( iterator.hasNext() ) { JobEntryCopy entry = iterator.next(); if ( !canDup( entry ) ) { iterator.remove(); } } spoon.delegates.jobs.copyJobEntries( entries ); }
public void dupeJobEntry() { final JobMeta jobMeta = (JobMeta) selectionObjectParent; final JobEntryCopy jobEntry = (JobEntryCopy) selectionObject; delegates.jobs.dupeJobEntry( jobMeta, jobEntry ); }
public void editJobEntry( JobMeta jobMeta, JobEntryCopy je ) { delegates.jobs.editJobEntry( jobMeta, je ); }
public void executeJob( JobMeta jobMeta, boolean local, boolean remote, Date replayDate, boolean safe, String startCopyName, int startCopyNr ) { if ( RepositorySecurityUI.verifyOperations( shell, rep, RepositoryOperation.EXECUTE_JOB ) ) { return; } try { delegates.jobs.executeJob( jobMeta, local, remote, replayDate, safe, startCopyName, startCopyNr ); } catch ( Exception e ) { new ErrorDialog( shell, "Execute job", "There was an error during job execution", e ); } }
spoon.delegates.jobs.closeJob( jobMeta ); spoon.refreshTree();
public void copyJobentries() { JobMeta jobMeta = getActiveJob(); if ( jobMeta != null ) { if ( RepositorySecurityUI.verifyOperations( shell, rep, RepositoryOperation.MODIFY_JOB, RepositoryOperation.EXECUTE_JOB ) ) { return; } delegates.jobs.copyJobEntries( jobMeta.getSelectedEntries() ); } }
public void duplicateEntry() throws KettleException { if ( !canDup( jobEntry ) ) { JobGraph.showOnlyStartOnceMessage( spoon.getShell() ); } spoon.delegates.jobs.dupeJobEntry( jobMeta, jobEntry ); }
/** * Add a job to the job map * * @param jobMeta * the job to add to the map * @return true if the job was added */ public boolean addJob( JobMeta jobMeta ) { int index = getJobList().indexOf( jobMeta ); if ( index < 0 ) { getJobList().add( jobMeta ); return true; } else { /* * ShowMessageDialog dialog = new ShowMessageDialog(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION, * BaseMessages.getString(PKG, "Spoon.Dialog.JobAlreadyLoaded.Title"), "'" + jobMeta.toString() + "'" + Const.CR + * Const.CR + BaseMessages.getString(PKG, "Spoon.Dialog.JobAlreadyLoaded.Message")); dialog.setTimeOut(6); * dialog.open(); */ return false; } }
@Override public void addJobGraph( JobMeta jobMeta ) { super.addJobGraph( jobMeta ); TabMapEntry tabEntry = spoon.delegates.tabs.findTabMapEntry( jobMeta ); if ( tabEntry != null ) { TabItem tabItem = tabEntry.getTabItem(); try { if ( ( service != null ) && ( jobMeta.getObjectId() != null ) && ( service.getJobLock( jobMeta.getObjectId() ) != null ) ) { tabItem.setImage( GUIResource.getInstance().getImageLocked() ); } } catch ( Exception e ) { throw new RuntimeException( e ); } } }
public void deleteJobEntryCopies( JobMeta jobMeta, JobEntryCopy jobEntry ) { delegates.jobs.deleteJobEntryCopies( jobMeta, jobEntry ); }
private boolean isJobOpened( String id, String path, String name ) { List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList(); for ( JobMeta j : openedJobFiles ) { if ( j.getObjectId() != null && id.equals( j.getObjectId().getId() ) || ( path.equals( j.getRepositoryDirectory().getPath() ) && name.equals( j.getName() ) ) ) { return true; } } return false; }
spoon.delegates.jobs.addJobGraph( jobMeta );
private void isFileOpenedInFolder( String path ) throws KettleException { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getRepositoryDirectory().getPath() != null && ( t.getRepositoryDirectory().getPath() + "/" ).startsWith( path + "/" ) ) { throw new KettleTransException(); } } List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList(); for ( JobMeta j : openedJobFiles ) { if ( j.getRepositoryDirectory().getPath() != null && ( j.getRepositoryDirectory().getPath() + "/" ).startsWith( path + "/" ) ) { throw new KettleJobException(); } } }