use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryMailValidator 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);
smtpCheck = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "smtpCheck"));
timeout = XMLHandler.getTagValue(entrynode, "timeout");
defaultSMTP = XMLHandler.getTagValue(entrynode, "defaultSMTP");
emailSender = XMLHandler.getTagValue(entrynode, "emailSender");
emailAddress = XMLHandler.getTagValue(entrynode, "emailAddress");
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryMailValidator.Meta.UnableToLoadFromXML"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryMysqlBulkFile 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);
schemaname = XMLHandler.getTagValue(entrynode, "schemaname");
tablename = XMLHandler.getTagValue(entrynode, "tablename");
filename = XMLHandler.getTagValue(entrynode, "filename");
separator = XMLHandler.getTagValue(entrynode, "separator");
enclosed = XMLHandler.getTagValue(entrynode, "enclosed");
lineterminated = XMLHandler.getTagValue(entrynode, "lineterminated");
limitlines = XMLHandler.getTagValue(entrynode, "limitlines");
listcolumn = XMLHandler.getTagValue(entrynode, "listcolumn");
highpriority = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "highpriority"));
optionenclosed = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "optionenclosed"));
outdumpvalue = Const.toInt(XMLHandler.getTagValue(entrynode, "outdumpvalue"), -1);
iffileexists = Const.toInt(XMLHandler.getTagValue(entrynode, "iffileexists"), -1);
String dbname = XMLHandler.getTagValue(entrynode, "connection");
connection = DatabaseMeta.findDatabase(databases, dbname);
addfiletoresult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "addfiletoresult"));
} catch (KettleException e) {
throw new KettleXMLException("Unable to load job entry of type 'table exists' from XML node", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryMysqlBulkLoad 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);
schemaname = XMLHandler.getTagValue(entrynode, "schemaname");
tablename = XMLHandler.getTagValue(entrynode, "tablename");
filename = XMLHandler.getTagValue(entrynode, "filename");
separator = XMLHandler.getTagValue(entrynode, "separator");
enclosed = XMLHandler.getTagValue(entrynode, "enclosed");
escaped = XMLHandler.getTagValue(entrynode, "escaped");
linestarted = XMLHandler.getTagValue(entrynode, "linestarted");
lineterminated = XMLHandler.getTagValue(entrynode, "lineterminated");
replacedata = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "replacedata"));
ignorelines = XMLHandler.getTagValue(entrynode, "ignorelines");
listattribut = XMLHandler.getTagValue(entrynode, "listattribut");
localinfile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "localinfile"));
prorityvalue = Const.toInt(XMLHandler.getTagValue(entrynode, "prorityvalue"), -1);
String dbname = XMLHandler.getTagValue(entrynode, "connection");
addfiletoresult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "addfiletoresult"));
connection = DatabaseMeta.findDatabase(databases, dbname);
} catch (KettleException e) {
throw new KettleXMLException("Unable to load job entry of type 'Mysql bulk load' from XML node", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryPGPDecryptFiles 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);
gpglocation = XMLHandler.getTagValue(entrynode, "gpglocation");
arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname"));
destination_is_a_file = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "destination_is_a_file"));
create_destination_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_destination_folder"));
add_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
add_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
SpecifyFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyFormat"));
AddDateBeforeExtension = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "AddDateBeforeExtension"));
DoNotKeepFolderStructure = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "DoNotKeepFolderStructure"));
date_time_format = XMLHandler.getTagValue(entrynode, "date_time_format");
nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
iffileexists = XMLHandler.getTagValue(entrynode, "iffileexists");
destinationFolder = XMLHandler.getTagValue(entrynode, "destinationFolder");
ifmovedfileexists = XMLHandler.getTagValue(entrynode, "ifmovedfileexists");
moved_date_time_format = XMLHandler.getTagValue(entrynode, "moved_date_time_format");
AddMovedDateBeforeExtension = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "AddMovedDateBeforeExtension"));
create_move_to_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_move_to_folder"));
add_moved_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_moved_date"));
add_moved_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_moved_time"));
SpecifyMoveFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyMoveFormat"));
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");
passphrase[i] = Encr.decryptPasswordOptionallyEncrypted(XMLHandler.getTagValue(fnode, "passphrase"));
destination_filefolder[i] = XMLHandler.getTagValue(fnode, "destination_filefolder");
wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
}
} catch (KettleXMLException xe) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobPGPDecryptFiles.Error.Exception.UnableLoadXML"), xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class XMLOutputMetaTest method testLoadXmlException.
@Test
public void testLoadXmlException() throws Exception {
XMLOutputMeta xmlOutputMeta = new XMLOutputMeta();
DatabaseMeta dbMeta = mock(DatabaseMeta.class);
IMetaStore metaStore = mock(IMetaStore.class);
Node stepNode = mock(Node.class);
when(stepNode.getChildNodes()).thenThrow(new RuntimeException("some words"));
try {
xmlOutputMeta.loadXML(stepNode, Collections.singletonList(dbMeta), metaStore);
} catch (KettleXMLException e) {
assertEquals("some words", e.getCause().getMessage());
}
}
Aggregations