use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryWriteToLog method loadXML.
@Override
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
logmessage = XMLHandler.getTagValue(entrynode, "logmessage");
entryLogLevel = LogLevel.getLogLevelForCode(XMLHandler.getTagValue(entrynode, "loglevel"));
logsubject = XMLHandler.getTagValue(entrynode, "logsubject");
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "WriteToLog.Error.UnableToLoadFromXML.Label"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryZipFile 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);
zipFilename = XMLHandler.getTagValue(entrynode, "zipfilename");
compressionRate = Const.toInt(XMLHandler.getTagValue(entrynode, "compressionrate"), -1);
ifZipFileExists = Const.toInt(XMLHandler.getTagValue(entrynode, "ifzipfileexists"), -1);
afterZip = Const.toInt(XMLHandler.getTagValue(entrynode, "afterzip"), -1);
wildCard = XMLHandler.getTagValue(entrynode, "wildcard");
excludeWildCard = XMLHandler.getTagValue(entrynode, "wildcardexclude");
sourceDirectory = XMLHandler.getTagValue(entrynode, "sourcedirectory");
movetoDirectory = XMLHandler.getTagValue(entrynode, "movetodirectory");
addFileToResult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "addfiletoresult"));
isFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "isfromprevious"));
createParentFolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "createparentfolder"));
addDate = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "adddate"));
addTime = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "addtime"));
specifyFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyFormat"));
dateTimeFormat = XMLHandler.getTagValue(entrynode, "date_time_format");
createMoveToDirectory = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "createMoveToDirectory"));
includingSubFolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
storedSourcePathDepth = XMLHandler.getTagValue(entrynode, "stored_source_path_depth");
} catch (KettleXMLException xe) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryZipFile.UnableLoadJobEntryXML"), xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryBase method loadXML.
/**
* This method is called by PDI whenever a job entry needs to read its settings from XML. The XML node containing the
* job entry's settings is passed in as an argument. Again, the helper class org.pentaho.di.core.xml.XMLHandler is
* typically used to conveniently read the settings from the XML node.
*
* @param entrynode
* the top-level XML node
* @param databases
* the list of databases
* @param slaveServers
* the list of slave servers
* @throws KettleXMLException
* if any errors occur during the loading of the XML
*/
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleXMLException {
try {
setName(XMLHandler.getTagValue(entrynode, "name"));
setDescription(XMLHandler.getTagValue(entrynode, "description"));
// Load the attribute groups map
//
attributesMap = AttributesUtil.loadAttributes(XMLHandler.getSubNode(entrynode, AttributesUtil.XML_TAG));
} catch (Exception e) {
throw new KettleXMLException("Unable to load base info for job entry", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryCheckFilesLocked 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);
argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
includeSubfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
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);
arguments[i] = XMLHandler.getTagValue(fnode, "name");
filemasks[i] = XMLHandler.getTagValue(fnode, "filemask");
}
} catch (KettleXMLException xe) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryCheckFilesLocked.UnableToLoadFromXml"), xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryColumnsExist 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);
tablename = XMLHandler.getTagValue(entrynode, "tablename");
schemaname = XMLHandler.getTagValue(entrynode, "schemaname");
String dbname = XMLHandler.getTagValue(entrynode, "connection");
connection = DatabaseMeta.findDatabase(databases, dbname);
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);
arguments[i] = XMLHandler.getTagValue(fnode, "name");
}
} catch (KettleException e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryColumnsExist.Meta.UnableLoadXml"), e);
}
}
Aggregations