use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryShell method loadXML.
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
setFileName(XMLHandler.getTagValue(entrynode, "filename"));
setWorkDirectory(XMLHandler.getTagValue(entrynode, "work_directory"));
argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
execPerRow = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "exec_per_row"));
setLogfile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "set_logfile"));
setAppendLogfile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "set_append_logfile"));
addDate = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
addTime = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
logfile = XMLHandler.getTagValue(entrynode, "logfile");
logext = XMLHandler.getTagValue(entrynode, "logext");
logFileLevel = LogLevel.getLogLevelForCode(XMLHandler.getTagValue(entrynode, "loglevel"));
insertScript = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "insertScript"));
script = XMLHandler.getTagValue(entrynode, "script");
// How many arguments?
int argnr = 0;
while (XMLHandler.getTagValue(entrynode, "argument" + argnr) != null) {
argnr++;
}
allocate(argnr);
// THE XML "DUBIOUS". DON'T REUSE IT.
for (int a = 0; a < argnr; a++) {
arguments[a] = XMLHandler.getTagValue(entrynode, "argument" + a);
}
} catch (KettleException e) {
throw new KettleXMLException("Unable to load job entry of type 'shell' from XML node", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntrySNMPTrap method loadXML.
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
port = XMLHandler.getTagValue(entrynode, "port");
serverName = XMLHandler.getTagValue(entrynode, "servername");
oid = XMLHandler.getTagValue(entrynode, "oid");
message = XMLHandler.getTagValue(entrynode, "message");
comString = XMLHandler.getTagValue(entrynode, "comstring");
timeout = XMLHandler.getTagValue(entrynode, "timeout");
nrretry = XMLHandler.getTagValue(entrynode, "nrretry");
targettype = XMLHandler.getTagValue(entrynode, "targettype");
user = XMLHandler.getTagValue(entrynode, "user");
passphrase = Encr.decryptPasswordOptionallyEncrypted(XMLHandler.getTagValue(entrynode, "passphrase"));
engineid = XMLHandler.getTagValue(entrynode, "engineid");
} catch (KettleXMLException xe) {
throw new KettleXMLException("Unable to load job entry of type 'SNMPTrap' from XML node", xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntrySQL method loadXML.
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
sql = XMLHandler.getTagValue(entrynode, "sql");
String dbname = XMLHandler.getTagValue(entrynode, "connection");
String sSubs = XMLHandler.getTagValue(entrynode, "useVariableSubstitution");
if (sSubs != null && sSubs.equalsIgnoreCase("T")) {
useVariableSubstitution = true;
}
connection = DatabaseMeta.findDatabase(databases, dbname);
String ssql = XMLHandler.getTagValue(entrynode, "sqlfromfile");
if (ssql != null && ssql.equalsIgnoreCase("T")) {
sqlfromfile = true;
}
sqlfilename = XMLHandler.getTagValue(entrynode, "sqlfilename");
String sOneStatement = XMLHandler.getTagValue(entrynode, "sendOneStatement");
if (sOneStatement != null && sOneStatement.equalsIgnoreCase("T")) {
sendOneStatement = true;
}
} catch (KettleException e) {
throw new KettleXMLException("Unable to load job entry of type 'sql' from XML node", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryDosToUnix method loadXML.
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
resultfilenames = XMLHandler.getTagValue(entrynode, "resultfilenames");
Node fields = XMLHandler.getSubNode(entrynode, "fields");
// How many field arguments?
int nrFields = XMLHandler.countNodes(fields, "field");
allocate(nrFields);
// Read them all...
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
source_filefolder[i] = XMLHandler.getTagValue(fnode, "source_filefolder");
wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
conversionTypes[i] = getConversionTypeByCode(Const.NVL(XMLHandler.getTagValue(fnode, "ConversionType"), ""));
}
} catch (KettleXMLException xe) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobDosToUnix.Error.Exception.UnableLoadXML"), xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryEvalTableContent method loadXML.
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
String dbname = XMLHandler.getTagValue(entrynode, "connection");
connection = DatabaseMeta.findDatabase(databases, dbname);
schemaname = XMLHandler.getTagValue(entrynode, "schemaname");
tablename = XMLHandler.getTagValue(entrynode, "tablename");
successCondition = getSucessConditionByCode(Const.NVL(XMLHandler.getTagValue(entrynode, "success_condition"), ""));
limit = Const.NVL(XMLHandler.getTagValue(entrynode, "limit"), "0");
useCustomSQL = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_custom_sql"));
useVars = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_usevars"));
customSQL = XMLHandler.getTagValue(entrynode, "custom_sql");
addRowsResult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_rows_result"));
clearResultList = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "clear_result_rows"));
} catch (KettleException e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryEvalTableContent.UnableLoadXML"), e);
}
}
Aggregations