Search in sources :

Example 21 with KettleXMLException

use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.

the class JobEntryShell 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);
        setFileName(XMLHandler.getTagValue(entrynode, "filename"));
        setWorkDirectory(XMLHandler.getTagValue(entrynode, "work_directory"));
        argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
        execPerRow = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "exec_per_row"));
        setLogfile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "set_logfile"));
        setAppendLogfile = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "set_append_logfile"));
        addDate = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
        addTime = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
        logfile = XMLHandler.getTagValue(entrynode, "logfile");
        logext = XMLHandler.getTagValue(entrynode, "logext");
        logFileLevel = LogLevel.getLogLevelForCode(XMLHandler.getTagValue(entrynode, "loglevel"));
        insertScript = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "insertScript"));
        script = XMLHandler.getTagValue(entrynode, "script");
        // How many arguments?
        int argnr = 0;
        while (XMLHandler.getTagValue(entrynode, "argument" + argnr) != null) {
            argnr++;
        }
        allocate(argnr);
        // THE XML "DUBIOUS". DON'T REUSE IT.
        for (int a = 0; a < argnr; a++) {
            arguments[a] = XMLHandler.getTagValue(entrynode, "argument" + a);
        }
    } catch (KettleException e) {
        throw new KettleXMLException("Unable to load job entry of type 'shell' from XML node", e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 22 with KettleXMLException

use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.

the class JobEntrySNMPTrap 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);
        port = XMLHandler.getTagValue(entrynode, "port");
        serverName = XMLHandler.getTagValue(entrynode, "servername");
        oid = XMLHandler.getTagValue(entrynode, "oid");
        message = XMLHandler.getTagValue(entrynode, "message");
        comString = XMLHandler.getTagValue(entrynode, "comstring");
        timeout = XMLHandler.getTagValue(entrynode, "timeout");
        nrretry = XMLHandler.getTagValue(entrynode, "nrretry");
        targettype = XMLHandler.getTagValue(entrynode, "targettype");
        user = XMLHandler.getTagValue(entrynode, "user");
        passphrase = Encr.decryptPasswordOptionallyEncrypted(XMLHandler.getTagValue(entrynode, "passphrase"));
        engineid = XMLHandler.getTagValue(entrynode, "engineid");
    } catch (KettleXMLException xe) {
        throw new KettleXMLException("Unable to load job entry of type 'SNMPTrap' from XML node", xe);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 23 with KettleXMLException

use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.

the class JobEntrySQL 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);
        sql = XMLHandler.getTagValue(entrynode, "sql");
        String dbname = XMLHandler.getTagValue(entrynode, "connection");
        String sSubs = XMLHandler.getTagValue(entrynode, "useVariableSubstitution");
        if (sSubs != null && sSubs.equalsIgnoreCase("T")) {
            useVariableSubstitution = true;
        }
        connection = DatabaseMeta.findDatabase(databases, dbname);
        String ssql = XMLHandler.getTagValue(entrynode, "sqlfromfile");
        if (ssql != null && ssql.equalsIgnoreCase("T")) {
            sqlfromfile = true;
        }
        sqlfilename = XMLHandler.getTagValue(entrynode, "sqlfilename");
        String sOneStatement = XMLHandler.getTagValue(entrynode, "sendOneStatement");
        if (sOneStatement != null && sOneStatement.equalsIgnoreCase("T")) {
            sendOneStatement = true;
        }
    } catch (KettleException e) {
        throw new KettleXMLException("Unable to load job entry of type 'sql' from XML node", e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 24 with KettleXMLException

use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.

the class JobEntryDosToUnix 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);
        arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
        include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
        nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
        success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
        resultfilenames = XMLHandler.getTagValue(entrynode, "resultfilenames");
        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");
            wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
            conversionTypes[i] = getConversionTypeByCode(Const.NVL(XMLHandler.getTagValue(fnode, "ConversionType"), ""));
        }
    } catch (KettleXMLException xe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobDosToUnix.Error.Exception.UnableLoadXML"), xe);
    }
}
Also used : Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 25 with KettleXMLException

use of org.pentaho.di.core.exception.KettleXMLException in project pentaho-kettle by pentaho.

the class JobEntryEvalTableContent 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");
        connection = DatabaseMeta.findDatabase(databases, dbname);
        schemaname = XMLHandler.getTagValue(entrynode, "schemaname");
        tablename = XMLHandler.getTagValue(entrynode, "tablename");
        successCondition = getSucessConditionByCode(Const.NVL(XMLHandler.getTagValue(entrynode, "success_condition"), ""));
        limit = Const.NVL(XMLHandler.getTagValue(entrynode, "limit"), "0");
        useCustomSQL = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_custom_sql"));
        useVars = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "is_usevars"));
        customSQL = XMLHandler.getTagValue(entrynode, "custom_sql");
        addRowsResult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_rows_result"));
        clearResultList = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "clear_result_rows"));
    } catch (KettleException e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryEvalTableContent.UnableLoadXML"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) 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