use of org.pentaho.di.trans.steps.salesforcedelete.SalesforceDeleteMeta in project pentaho-kettle by pentaho.
the class SalesforceDeleteDialog method getInfo.
@Override
protected void getInfo(SalesforceStepMeta in) throws KettleException {
SalesforceDeleteMeta meta = (SalesforceDeleteMeta) in;
// return value
stepname = wStepname.getText();
// copy info to SalesforceDeleteMeta class (input)
meta.setTargetURL(Const.NVL(wURL.getText(), SalesforceConnectionUtils.TARGET_DEFAULT_URL));
meta.setUsername(wUserName.getText());
meta.setPassword(wPassword.getText());
meta.setModule(wModule.getText());
meta.setDeleteField(wDeleteField.getText());
meta.setBatchSize(wBatchSize.getText());
meta.setCompression(wUseCompression.getSelection());
meta.setTimeout(Const.NVL(wTimeOut.getText(), "0"));
meta.setRollbackAllChangesOnError(wRollbackAllChangesOnError.getSelection());
}
use of org.pentaho.di.trans.steps.salesforcedelete.SalesforceDeleteMeta in project pentaho-kettle by pentaho.
the class SalesforceDeleteDialog method getModulesList.
private void getModulesList() {
if (!gotModule) {
SalesforceConnection connection = null;
try {
SalesforceDeleteMeta meta = new SalesforceDeleteMeta();
getInfo(meta);
String url = transMeta.environmentSubstitute(meta.getTargetURL());
String selectedField = wModule.getText();
wModule.removeAll();
// Define a new Salesforce connection
connection = new SalesforceConnection(log, url, transMeta.environmentSubstitute(meta.getUsername()), Utils.resolvePassword(transMeta, meta.getPassword()));
int realTimeOut = Const.toInt(transMeta.environmentSubstitute(meta.getTimeout()), 0);
connection.setTimeOut(realTimeOut);
// connect to Salesforce
connection.connect();
// return
wModule.setItems(connection.getAllAvailableObjects(false));
if (!Utils.isEmpty(selectedField)) {
wModule.setText(selectedField);
}
gotModule = true;
getModulesListError = false;
} catch (Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceDeleteDialog.ErrorRetrieveModules.DialogTitle"), BaseMessages.getString(PKG, "SalesforceDeleteDialog.ErrorRetrieveData.ErrorRetrieveModules"), e);
getModulesListError = true;
} finally {
if (connection != null) {
try {
connection.close();
} catch (Exception e) {
/* Ignore */
}
}
}
}
}
Aggregations