use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class SalesforceInsertMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
setBatchSize(XMLHandler.getTagValue(stepnode, "batchSize"));
setSalesforceIDFieldName(XMLHandler.getTagValue(stepnode, "salesforceIDFieldName"));
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrFields = XMLHandler.countNodes(fields, "field");
allocate(nrFields);
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
updateLookup[i] = XMLHandler.getTagValue(fnode, "name");
updateStream[i] = XMLHandler.getTagValue(fnode, "field");
if (updateStream[i] == null) {
// default: the same name!
updateStream[i] = updateLookup[i];
}
String updateValue = XMLHandler.getTagValue(fnode, "useExternalId");
if (updateValue == null) {
// default FALSE
useExternalId[i] = Boolean.FALSE;
} else {
if (updateValue.equalsIgnoreCase("Y")) {
useExternalId[i] = Boolean.TRUE;
} else {
useExternalId[i] = Boolean.FALSE;
}
}
}
setRollbackAllChangesOnError("Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rollbackAllChangesOnError")));
} 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 SalesforceUpdateMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
setBatchSize(XMLHandler.getTagValue(stepnode, "batchSize"));
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrFields = XMLHandler.countNodes(fields, "field");
allocate(nrFields);
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
updateLookup[i] = XMLHandler.getTagValue(fnode, "name");
updateStream[i] = XMLHandler.getTagValue(fnode, "field");
if (updateStream[i] == null) {
// default: the same name!
updateStream[i] = updateLookup[i];
}
String updateValue = XMLHandler.getTagValue(fnode, "useExternalId");
if (updateValue == null) {
// default FALSE
useExternalId[i] = Boolean.FALSE;
} else {
if (updateValue.equalsIgnoreCase("Y")) {
useExternalId[i] = Boolean.TRUE;
} else {
useExternalId[i] = Boolean.FALSE;
}
}
}
setRollbackAllChangesOnError("Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rollbackAllChangesOnError")));
} 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 SalesforceUpsertMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
setUpsertField(XMLHandler.getTagValue(stepnode, "upsertfield"));
setBatchSize(XMLHandler.getTagValue(stepnode, "batchSize"));
setSalesforceIDFieldName(XMLHandler.getTagValue(stepnode, "salesforceIDFieldName"));
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrFields = XMLHandler.countNodes(fields, "field");
allocate(nrFields);
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
updateLookup[i] = XMLHandler.getTagValue(fnode, "name");
updateStream[i] = XMLHandler.getTagValue(fnode, "field");
if (updateStream[i] == null) {
// default: the same name!
updateStream[i] = updateLookup[i];
}
String updateValue = XMLHandler.getTagValue(fnode, "useExternalId");
if (updateValue == null) {
// default FALSE
useExternalId[i] = Boolean.FALSE;
} else {
if (updateValue.equalsIgnoreCase("Y")) {
useExternalId[i] = Boolean.TRUE;
} else {
useExternalId[i] = Boolean.FALSE;
}
}
}
setRollbackAllChangesOnError("Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rollbackAllChangesOnError")));
} 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 XMLInputMeta method readData.
private void readData(Node stepnode) throws KettleXMLException {
try {
includeFilename = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "include"));
filenameField = XMLHandler.getTagValue(stepnode, "include_field");
includeRowNumber = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rownum"));
rowNumberField = XMLHandler.getTagValue(stepnode, "rownum_field");
fileBaseURI = XMLHandler.getTagValue(stepnode, "file_base_uri");
ignoreEntities = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "ignore_entities"));
namespaceAware = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "namespace_aware"));
Node filenode = XMLHandler.getSubNode(stepnode, "file");
Node fields = XMLHandler.getSubNode(stepnode, "fields");
Node positions = XMLHandler.getSubNode(stepnode, "positions");
int nrFiles = XMLHandler.countNodes(filenode, "name");
int nrFields = XMLHandler.countNodes(fields, "field");
int nrPositions = XMLHandler.countNodes(positions, "position");
allocate(nrFiles, nrFields, nrPositions);
for (int i = 0; i < nrFiles; i++) {
Node filenamenode = XMLHandler.getSubNodeByNr(filenode, "name", i);
Node filemasknode = XMLHandler.getSubNodeByNr(filenode, "filemask", i);
fileName[i] = XMLHandler.getNodeValue(filenamenode);
fileMask[i] = XMLHandler.getNodeValue(filemasknode);
}
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
XMLInputField field = new XMLInputField(fnode);
inputFields[i] = field;
}
for (int i = 0; i < nrPositions; i++) {
Node positionnode = XMLHandler.getSubNodeByNr(positions, "position", i);
inputPosition[i] = XMLHandler.getNodeValue(positionnode);
}
// Is there a limit on the number of rows we process?
rowLimit = Const.toLong(XMLHandler.getTagValue(stepnode, "limit"), 0L);
// Do we skip rows before starting to read
nrRowsToSkip = Const.toInt(XMLHandler.getTagValue(stepnode, "skip"), 0);
} 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 JobEntryDTDValidator 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);
xmlfilename = XMLHandler.getTagValue(entrynode, "xmlfilename");
dtdfilename = XMLHandler.getTagValue(entrynode, "dtdfilename");
dtdintern = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "dtdintern"));
} catch (KettleXMLException xe) {
throw new KettleXMLException("Unable to load job entry of type 'DTDvalidator' from XML node", xe);
}
}
Aggregations