Search in sources :

Example 81 with KettleXMLException

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

the class ConstantMeta method readData.

private void readData(Node stepnode) throws KettleXMLException {
    try {
        Node fields = XMLHandler.getSubNode(stepnode, "fields");
        int nrfields = XMLHandler.countNodes(fields, "field");
        allocate(nrfields);
        String slength, sprecision;
        for (int i = 0; i < nrfields; i++) {
            Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
            fieldName[i] = XMLHandler.getTagValue(fnode, "name");
            fieldType[i] = XMLHandler.getTagValue(fnode, "type");
            fieldFormat[i] = XMLHandler.getTagValue(fnode, "format");
            currency[i] = XMLHandler.getTagValue(fnode, "currency");
            decimal[i] = XMLHandler.getTagValue(fnode, "decimal");
            group[i] = XMLHandler.getTagValue(fnode, "group");
            value[i] = XMLHandler.getTagValue(fnode, "nullif");
            slength = XMLHandler.getTagValue(fnode, "length");
            sprecision = XMLHandler.getTagValue(fnode, "precision");
            fieldLength[i] = Const.toInt(slength, -1);
            fieldPrecision[i] = Const.toInt(sprecision, -1);
            String emptyString = XMLHandler.getTagValue(fnode, "set_empty_string");
            setEmptyString[i] = !Utils.isEmpty(emptyString) && "Y".equalsIgnoreCase(emptyString);
        }
    } catch (Exception e) {
        throw new KettleXMLException("Unable to load step info from XML", e);
    }
}
Also used : Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

Example 82 with KettleXMLException

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

the class CreditCardValidatorMeta method readData.

private void readData(Node stepnode) throws KettleXMLException {
    try {
        fieldname = XMLHandler.getTagValue(stepnode, "fieldname");
        resultfieldname = XMLHandler.getTagValue(stepnode, "resultfieldname");
        cardtype = XMLHandler.getTagValue(stepnode, "cardtype");
        notvalidmsg = XMLHandler.getTagValue(stepnode, "notvalidmsg");
        onlydigits = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "onlydigits"));
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "CreditCardValidatorMeta.Exception.UnableToReadStepInfo"), e);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

Example 83 with KettleXMLException

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

the class CubeOutputMeta method readData.

private void readData(Node stepnode) throws KettleXMLException {
    try {
        filename = XMLHandler.getTagValue(stepnode, "file", "name");
        addToResultFilenames = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "file", "add_to_result_filenames"));
        doNotOpenNewFileInit = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "file", "do_not_open_newfile_init"));
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "CubeOutputMeta.Exception.UnableToLoadStepInfo"), e);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 84 with KettleXMLException

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

the class DelayMeta method readData.

private void readData(Node stepnode) throws KettleXMLException {
    try {
        timeout = XMLHandler.getTagValue(stepnode, "timeout");
        scaletime = XMLHandler.getTagValue(stepnode, "scaletime");
        // set all unknown values to seconds
        // compatibility reasons for transformations before 3.1.1, see PDI-1850,
        setScaleTimeCode(getScaleTimeCode());
    // PDI-1532
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "DelayMeta.Exception.UnableToReadStepInfo"), e);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

Example 85 with KettleXMLException

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

the class DeleteMeta method readData.

private void readData(Node stepnode, List<? extends SharedObjectInterface> databases) throws KettleXMLException {
    try {
        String csize;
        int nrkeys;
        String con = XMLHandler.getTagValue(stepnode, "connection");
        databaseMeta = DatabaseMeta.findDatabase(databases, con);
        csize = XMLHandler.getTagValue(stepnode, "commit");
        commitSize = (csize != null) ? csize : "0";
        schemaName = XMLHandler.getTagValue(stepnode, "lookup", "schema");
        tableName = XMLHandler.getTagValue(stepnode, "lookup", "table");
        Node lookup = XMLHandler.getSubNode(stepnode, "lookup");
        nrkeys = XMLHandler.countNodes(lookup, "key");
        allocate(nrkeys);
        for (int i = 0; i < nrkeys; i++) {
            Node knode = XMLHandler.getSubNodeByNr(lookup, "key", i);
            keyStream[i] = XMLHandler.getTagValue(knode, "name");
            keyLookup[i] = XMLHandler.getTagValue(knode, "field");
            keyCondition[i] = XMLHandler.getTagValue(knode, "condition");
            if (keyCondition[i] == null) {
                keyCondition[i] = "=";
            }
            keyStream2[i] = XMLHandler.getTagValue(knode, "name2");
        }
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "DeleteMeta.Exception.UnableToReadStepInfoFromXML"), e);
    }
}
Also used : Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

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