use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class ScriptValuesHelp method xparseXmlFile.
private static void xparseXmlFile(String strFileName) throws KettleXMLException {
try {
InputStream is = ScriptValuesHelp.class.getResourceAsStream(strFileName);
int c;
StringBuilder buffer = new StringBuilder();
while ((c = is.read()) != -1) {
buffer.append((char) c);
}
is.close();
dom = XMLHandler.loadXMLString(buffer.toString());
} catch (Exception e) {
throw new KettleXMLException("Unable to read script values help file from file [" + strFileName + "]", e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryTruncateTables 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");
this.connection = DatabaseMeta.findDatabase(databases, dbname);
this.argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
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);
this.arguments[i] = XMLHandler.getTagValue(fnode, "name");
this.schemaname[i] = XMLHandler.getTagValue(fnode, "schemaname");
}
} catch (KettleException e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryTruncateTables.UnableLoadXML"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryWaitForSQL 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);
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"), ""));
rowsCountValue = Const.NVL(XMLHandler.getTagValue(entrynode, "rows_count_value"), "0");
iscustomSQL = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_custom_sql"));
isUseVars = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_usevars"));
customSQL = XMLHandler.getTagValue(entrynode, "custom_sql");
isAddRowsResult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_rows_result"));
maximumTimeout = XMLHandler.getTagValue(entrynode, "maximum_timeout");
checkCycleTime = XMLHandler.getTagValue(entrynode, "check_cycle_time");
successOnTimeout = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "success_on_timeout"));
isClearResultList = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "clear_result_rows"));
} catch (KettleException e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryWaitForSQL.UnableLoadXML"), e);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryWebServiceAvailable 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);
url = XMLHandler.getTagValue(entrynode, "url");
connectTimeOut = XMLHandler.getTagValue(entrynode, "connectTimeOut");
readTimeOut = XMLHandler.getTagValue(entrynode, "readTimeOut");
} catch (KettleXMLException xe) {
throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryWebServiceAvailable.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node"), xe);
}
}
use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.
the class JobEntryWriteToFile 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);
filename = XMLHandler.getTagValue(entrynode, "filename");
createParentFolder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "createParentFolder"));
appendFile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "appendFile"));
content = XMLHandler.getTagValue(entrynode, "content");
encoding = XMLHandler.getTagValue(entrynode, "encoding");
} catch (KettleXMLException xe) {
throw new KettleXMLException("Unable to load job entry of type 'create file' from XML node", xe);
}
}
Aggregations