use of org.pentaho.di.core.variables.Variables in project pentaho-kettle by pentaho.
the class TransFileListener method open.
public boolean open(Node transNode, String fname, boolean importfile) throws KettleMissingPluginsException {
final Spoon spoon = Spoon.getInstance();
final PropsUI props = PropsUI.getInstance();
try {
// Call extension point(s) before the file has been opened
ExtensionPointHandler.callExtensionPoint(spoon.getLog(), KettleExtensionPoint.TransBeforeOpen.id, fname);
TransMeta transMeta = new TransMeta();
transMeta.loadXML(transNode, fname, spoon.getMetaStore(), spoon.getRepository(), true, new Variables(), new OverwritePrompter() {
public boolean overwritePrompt(String message, String rememberText, String rememberPropertyName) {
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
Object[] res = spoon.messageDialogWithToggle(BaseMessages.getString(PKG, "System.Button.Yes"), null, message, Const.WARNING, new String[] { BaseMessages.getString(PKG, "System.Button.Yes"), BaseMessages.getString(PKG, "System.Button.No") }, 1, rememberText, !props.askAboutReplacingDatabaseConnections());
int idx = ((Integer) res[0]).intValue();
boolean toggleState = ((Boolean) res[1]).booleanValue();
props.setAskAboutReplacingDatabaseConnections(!toggleState);
// Yes means: overwrite
return ((idx & 0xFF) == 0);
}
});
if (transMeta.hasMissingPlugins()) {
StepMeta stepMeta = transMeta.getStep(0);
MissingTransDialog missingDialog = new MissingTransDialog(spoon.getShell(), transMeta.getMissingTrans(), stepMeta.getStepMetaInterface(), transMeta, stepMeta.getName());
if (missingDialog.open() == null) {
return true;
}
}
transMeta.setRepositoryDirectory(spoon.getDefaultSaveLocation(transMeta));
transMeta.setRepository(spoon.getRepository());
transMeta.setMetaStore(spoon.getMetaStore());
spoon.setTransMetaVariables(transMeta);
spoon.getProperties().addLastFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, fname, null, false, null);
spoon.addMenuLast();
// if any exist.
if (importfile) {
if (spoon.getRepository() != null) {
transMeta = fixLinks(transMeta);
}
} else {
transMeta.clearChanged();
}
transMeta.setFilename(fname);
spoon.addTransGraph(transMeta);
spoon.sharedObjectsFileMap.put(transMeta.getSharedObjects().getFilename(), transMeta.getSharedObjects());
// Call extension point(s) now that the file has been opened
ExtensionPointHandler.callExtensionPoint(spoon.getLog(), KettleExtensionPoint.TransAfterOpen.id, transMeta);
SpoonPerspectiveManager.getInstance().activatePerspective(MainSpoonPerspective.class);
spoon.refreshTree();
return true;
} catch (KettleMissingPluginsException e) {
throw e;
} 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;
}
use of org.pentaho.di.core.variables.Variables in project pentaho-kettle by pentaho.
the class JobEntryCreateFolder method main.
public static void main(String[] args) {
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
new JobEntryCreateFile().check(remarks, null, new Variables(), null, null);
System.out.printf("Remarks: %s\n", remarks);
}
use of org.pentaho.di.core.variables.Variables in project pentaho-kettle by pentaho.
the class JobEntrySFTP method main.
public static void main(String[] args) {
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
new JobEntrySFTP().check(remarks, null, new Variables(), null, null);
System.out.printf("Remarks: %s\n", remarks);
}
use of org.pentaho.di.core.variables.Variables in project pentaho-kettle by pentaho.
the class JobEntryExportRepository method main.
public static void main(String[] args) {
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
new JobEntrySFTP().check(remarks, null, new Variables(), null, null);
System.out.printf("Remarks: %s\n", remarks);
}
use of org.pentaho.di.core.variables.Variables in project pentaho-kettle by pentaho.
the class JobEntryJob method main.
public static void main(String[] args) {
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
new JobEntryJob().check(remarks, null, new Variables(), null, null);
System.out.printf("Remarks: %s\n", remarks);
}
Aggregations