Search in sources :

Example 16 with KettleXMLException

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

the class JobEntryDelay 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);
        maximumTimeout = XMLHandler.getTagValue(entrynode, "maximumTimeout");
        scaleTime = Integer.parseInt(XMLHandler.getTagValue(entrynode, "scaletime"));
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryDelay.UnableToLoadFromXml.Label"), e);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 17 with KettleXMLException

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

the class JobEntryDeleteResultFilenames method loadRep.

public void loadRep(Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException {
    try {
        foldername = rep.getJobEntryAttributeString(id_jobentry, "foldername");
        specifywildcard = rep.getJobEntryAttributeBoolean(id_jobentry, "specify_wildcard");
        wildcard = rep.getJobEntryAttributeString(id_jobentry, "wildcard");
        wildcardexclude = rep.getJobEntryAttributeString(id_jobentry, "wildcardexclude");
    } catch (KettleException dbe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryDeleteResultFilenames.CanNotLoadFromRep", "" + id_jobentry, dbe.getMessage()));
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 18 with KettleXMLException

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

the class JobEntryPGPEncryptFiles 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);
        gpglocation = XMLHandler.getTagValue(entrynode, "gpglocation");
        arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
        include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
        add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname"));
        destination_is_a_file = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "destination_is_a_file"));
        create_destination_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_destination_folder"));
        add_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_date"));
        add_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_time"));
        SpecifyFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyFormat"));
        AddDateBeforeExtension = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "AddDateBeforeExtension"));
        DoNotKeepFolderStructure = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "DoNotKeepFolderStructure"));
        date_time_format = XMLHandler.getTagValue(entrynode, "date_time_format");
        nr_errors_less_than = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
        success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
        iffileexists = XMLHandler.getTagValue(entrynode, "iffileexists");
        destinationFolder = XMLHandler.getTagValue(entrynode, "destinationFolder");
        ifmovedfileexists = XMLHandler.getTagValue(entrynode, "ifmovedfileexists");
        moved_date_time_format = XMLHandler.getTagValue(entrynode, "moved_date_time_format");
        AddMovedDateBeforeExtension = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "AddMovedDateBeforeExtension"));
        create_move_to_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_move_to_folder"));
        add_moved_date = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_moved_date"));
        add_moved_time = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_moved_time"));
        SpecifyMoveFormat = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "SpecifyMoveFormat"));
        asciiMode = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "asciiMode"));
        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);
            action_type[i] = getActionTypeByCode(Const.NVL(XMLHandler.getTagValue(fnode, "action_type"), ""));
            source_filefolder[i] = XMLHandler.getTagValue(fnode, "source_filefolder");
            userid[i] = XMLHandler.getTagValue(fnode, "userid");
            destination_filefolder[i] = XMLHandler.getTagValue(fnode, "destination_filefolder");
            wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
        }
    } catch (KettleXMLException xe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobPGPEncryptFiles.Error.Exception.UnableLoadXML"), xe);
    }
}
Also used : Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 19 with KettleXMLException

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

the class JobEntryPing method loadXML.

public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, IMetaStore metaStore) throws KettleXMLException {
    try {
        String nbrPaquets;
        super.loadXML(entrynode, databases, slaveServers);
        hostname = XMLHandler.getTagValue(entrynode, "hostname");
        nbrPackets = XMLHandler.getTagValue(entrynode, "nbr_packets");
        // TODO: The following lines may be removed 3 versions after 2.5.0
        nbrPaquets = XMLHandler.getTagValue(entrynode, "nbrpaquets");
        if (nbrPackets == null && nbrPaquets != null) {
            // if only nbrpaquets exists this means that the file was
            // save by a version 2.5.0 ping job entry
            nbrPackets = nbrPaquets;
        }
        timeout = XMLHandler.getTagValue(entrynode, "timeout");
        pingtype = XMLHandler.getTagValue(entrynode, "pingtype");
        if (Utils.isEmpty(pingtype)) {
            pingtype = classicPing;
            ipingtype = iclassicPing;
        } else {
            if (pingtype.equals(systemPing)) {
                ipingtype = isystemPing;
            } else if (pingtype.equals(bothPings)) {
                ipingtype = ibothPings;
            } else {
                ipingtype = iclassicPing;
            }
        }
    } catch (KettleXMLException xe) {
        throw new KettleXMLException("Unable to load job entry of type 'ping' from XML node", xe);
    }
}
Also used : KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 20 with KettleXMLException

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

the class JobEntrySendNagiosPassiveCheck 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");
        responseTimeOut = XMLHandler.getTagValue(entrynode, "responseTimeOut");
        connectionTimeOut = XMLHandler.getTagValue(entrynode, "connectionTimeOut");
        password = XMLHandler.getTagValue(entrynode, "password");
        senderServerName = XMLHandler.getTagValue(entrynode, "senderServerName");
        senderServiceName = XMLHandler.getTagValue(entrynode, "senderServiceName");
        message = XMLHandler.getTagValue(entrynode, "message");
        encryptionMode = getEncryptionModeByCode(XMLHandler.getTagValue(entrynode, "encryptionMode"));
        level = getLevelByCode(XMLHandler.getTagValue(entrynode, "level"));
    } catch (KettleXMLException xe) {
        throw new KettleXMLException("Unable to load job entry of type 'SendNagiosPassiveCheck' 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