Search in sources :

Example 1 with KettleXMLException

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);
    }
}
Also used : InputStream(java.io.InputStream) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 2 with KettleXMLException

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);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 3 with KettleXMLException

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);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 4 with KettleXMLException

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);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 5 with KettleXMLException

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);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Aggregations

KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)286 KettleException (org.pentaho.di.core.exception.KettleException)209 Node (org.w3c.dom.Node)164 KettleStepException (org.pentaho.di.core.exception.KettleStepException)150 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)25 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)23 KettlePluginException (org.pentaho.di.core.exception.KettlePluginException)20 Document (org.w3c.dom.Document)13 IOException (java.io.IOException)10 KettleValueException (org.pentaho.di.core.exception.KettleValueException)10 StringObjectId (org.pentaho.di.repository.StringObjectId)8 KettleFileException (org.pentaho.di.core.exception.KettleFileException)7 FileNotFoundException (java.io.FileNotFoundException)5 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)5 StreamInterface (org.pentaho.di.trans.step.errorhandling.StreamInterface)5 InputStream (java.io.InputStream)4 MalformedURLException (java.net.MalformedURLException)4 ParseException (java.text.ParseException)4 FileSystemException (org.apache.commons.vfs2.FileSystemException)4 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)4