Search in sources :

Example 11 with KettleXMLException

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

the class JobEntryConnectedToRepository 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);
        isspecificrep = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "isspecificrep"));
        repname = XMLHandler.getTagValue(entrynode, "repname");
        isspecificuser = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "isspecificuser"));
        username = XMLHandler.getTagValue(entrynode, "username");
    } catch (Exception e) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryConnectedToRepository.Meta.UnableToLoadFromXML"), 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 12 with KettleXMLException

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

the class JobEntryCopyFiles 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);
        copy_empty_folders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "copy_empty_folders"));
        arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
        overwrite_files = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "overwrite_files"));
        include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders"));
        remove_source_files = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "remove_source_files"));
        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"));
        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] = loadSource(fnode);
            destination_filefolder[i] = loadDestination(fnode);
            wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
        }
    } catch (KettleXMLException xe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobCopyFiles.Error.Exception.UnableLoadXML"), xe);
    }
}
Also used : Node(org.w3c.dom.Node) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 13 with KettleXMLException

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

the class JobEntryCopyMoveResultFilenames method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "foldername", foldername);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "specify_wildcard", specifywildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcard", wildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcardexclude", wildcardexclude);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destination_folder", destination_folder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "nr_errors_less_than", nr_errors_less_than);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", success_condition);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_date", add_date);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_time", add_time);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "SpecifyFormat", SpecifyFormat);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "date_time_format", date_time_format);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "AddDateBeforeExtension", AddDateBeforeExtension);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "action", action);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "OverwriteFile", OverwriteFile);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "CreateDestinationFolder", CreateDestinationFolder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "RemovedSourceFilename", RemovedSourceFilename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "AddDestinationFilename", AddDestinationFilename);
    } catch (KettleDatabaseException dbe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.CanNotSaveToRep", "" + id_job, dbe.getMessage()));
    }
}
Also used : KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 14 with KettleXMLException

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

the class JobEntryCopyMoveResultFilenames 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");
        destination_folder = rep.getJobEntryAttributeString(id_jobentry, "destination_folder");
        nr_errors_less_than = rep.getJobEntryAttributeString(id_jobentry, "nr_errors_less_than");
        success_condition = rep.getJobEntryAttributeString(id_jobentry, "success_condition");
        add_date = rep.getJobEntryAttributeBoolean(id_jobentry, "add_date");
        add_time = rep.getJobEntryAttributeBoolean(id_jobentry, "add_time");
        SpecifyFormat = rep.getJobEntryAttributeBoolean(id_jobentry, "SpecifyFormat");
        date_time_format = rep.getJobEntryAttributeString(id_jobentry, "date_time_format");
        AddDateBeforeExtension = rep.getJobEntryAttributeBoolean(id_jobentry, "AddDateBeforeExtension");
        action = rep.getJobEntryAttributeString(id_jobentry, "action");
        OverwriteFile = rep.getJobEntryAttributeBoolean(id_jobentry, "OverwriteFile");
        CreateDestinationFolder = rep.getJobEntryAttributeBoolean(id_jobentry, "CreateDestinationFolder");
        RemovedSourceFilename = rep.getJobEntryAttributeBoolean(id_jobentry, "RemovedSourceFilename");
        AddDestinationFilename = rep.getJobEntryAttributeBoolean(id_jobentry, "AddDestinationFilename");
    } catch (KettleException dbe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.CanNotLoadFromRep", "" + id_jobentry, dbe.getMessage()));
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 15 with KettleXMLException

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

the class JobEntryCreateFolder 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);
        foldername = XMLHandler.getTagValue(entrynode, "foldername");
        failOfFolderExists = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "fail_of_folder_exists"));
    } catch (KettleXMLException xe) {
        throw new KettleXMLException("Unable to load job entry of type 'create folder' 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