use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class ConstantMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrfields = XMLHandler.countNodes(fields, "field");
allocate(nrfields);
String slength, sprecision;
for (int i = 0; i < nrfields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
fieldName[i] = XMLHandler.getTagValue(fnode, "name");
fieldType[i] = XMLHandler.getTagValue(fnode, "type");
fieldFormat[i] = XMLHandler.getTagValue(fnode, "format");
currency[i] = XMLHandler.getTagValue(fnode, "currency");
decimal[i] = XMLHandler.getTagValue(fnode, "decimal");
group[i] = XMLHandler.getTagValue(fnode, "group");
value[i] = XMLHandler.getTagValue(fnode, "nullif");
slength = XMLHandler.getTagValue(fnode, "length");
sprecision = XMLHandler.getTagValue(fnode, "precision");
fieldLength[i] = Const.toInt(slength, -1);
fieldPrecision[i] = Const.toInt(sprecision, -1);
String emptyString = XMLHandler.getTagValue(fnode, "set_empty_string");
setEmptyString[i] = !Utils.isEmpty(emptyString) && "Y".equalsIgnoreCase(emptyString);
}
} catch (Exception e) {
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class CreditCardValidatorMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
fieldname = XMLHandler.getTagValue(stepnode, "fieldname");
resultfieldname = XMLHandler.getTagValue(stepnode, "resultfieldname");
cardtype = XMLHandler.getTagValue(stepnode, "cardtype");
notvalidmsg = XMLHandler.getTagValue(stepnode, "notvalidmsg");
onlydigits = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "onlydigits"));
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "CreditCardValidatorMeta.Exception.UnableToReadStepInfo"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class CubeOutputMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
filename = XMLHandler.getTagValue(stepnode, "file", "name");
addToResultFilenames = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "file", "add_to_result_filenames"));
doNotOpenNewFileInit = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "file", "do_not_open_newfile_init"));
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "CubeOutputMeta.Exception.UnableToLoadStepInfo"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class DelayMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
timeout = XMLHandler.getTagValue(stepnode, "timeout");
scaletime = XMLHandler.getTagValue(stepnode, "scaletime");
// set all unknown values to seconds
// compatibility reasons for transformations before 3.1.1, see PDI-1850,
setScaleTimeCode(getScaleTimeCode());
// PDI-1532
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "DelayMeta.Exception.UnableToReadStepInfo"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class DeleteMeta method readData.
private void readData(Node stepnode, List<? extends SharedObjectInterface> databases) throws KettleXMLException {
try {
String csize;
int nrkeys;
String con = XMLHandler.getTagValue(stepnode, "connection");
databaseMeta = DatabaseMeta.findDatabase(databases, con);
csize = XMLHandler.getTagValue(stepnode, "commit");
commitSize = (csize != null) ? csize : "0";
schemaName = XMLHandler.getTagValue(stepnode, "lookup", "schema");
tableName = XMLHandler.getTagValue(stepnode, "lookup", "table");
Node lookup = XMLHandler.getSubNode(stepnode, "lookup");
nrkeys = XMLHandler.countNodes(lookup, "key");
allocate(nrkeys);
for (int i = 0; i < nrkeys; i++) {
Node knode = XMLHandler.getSubNodeByNr(lookup, "key", i);
keyStream[i] = XMLHandler.getTagValue(knode, "name");
keyLookup[i] = XMLHandler.getTagValue(knode, "field");
keyCondition[i] = XMLHandler.getTagValue(knode, "condition");
if (keyCondition[i] == null) {
keyCondition[i] = "=";
}
keyStream2[i] = XMLHandler.getTagValue(knode, "name2");
}
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "DeleteMeta.Exception.UnableToReadStepInfoFromXML"), e);
}
}
Aggregations