public boolean save(EngineMetaInterface meta, String fname, boolean export) { Spoon spoon = Spoon.getInstance(); EngineMetaInterface lmeta; if (export) { lmeta = (JobMeta) ((JobMeta) meta).realClone(false); } else { lmeta = meta; } return spoon.saveMeta(lmeta, fname); }
public void setActive(boolean active) { for (SpoonPerspectiveListener l : listeners) { if (active) { l.onActivation(); Spoon.getInstance().enableMenus(); } else { l.onDeactication(); } } }
public boolean open(Node jobNode, String fname, boolean importfile) { Spoon spoon = Spoon.getInstance(); try { // Call extension point(s) before the file has been opened ExtensionPointHandler.callExtensionPoint( spoon.getLog(), KettleExtensionPoint.JobBeforeOpen.id, fname); JobMeta jobMeta = new JobMeta(); jobMeta.loadXML(jobNode, fname, spoon.getRepository(), spoon.getMetaStore(), false, spoon); jobMeta.setRepositoryDirectory(spoon.getDefaultSaveLocation(jobMeta)); jobMeta.setRepository(spoon.getRepository()); jobMeta.setMetaStore(spoon.getMetaStore()); spoon.setJobMetaVariables(jobMeta); spoon.getProperties().addLastFile(LastUsedFile.FILE_TYPE_JOB, fname, null, false, null); spoon.addMenuLast(); // If we are importing into a repository we need to fix // up the references to other jobs and transformations // if any exist. if (importfile) { if (spoon.getRepository() != null) { jobMeta = fixLinks(jobMeta); } } else { jobMeta.clearChanged(); } jobMeta.setFilename(fname); spoon.delegates.jobs.addJobGraph(jobMeta); // Call extension point(s) now that the file has been opened ExtensionPointHandler.callExtensionPoint( spoon.getLog(), KettleExtensionPoint.JobAfterOpen.id, jobMeta); spoon.refreshTree(); SpoonPerspectiveManager.getInstance().activatePerspective(MainSpoonPerspective.class); return true; } catch (KettleException e) { new ErrorDialog( spoon.getShell(), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorOpening.Title"), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorOpening.Message") + fname, e); } return false; }