Search in sources :

Example 1 with PluginFolderInterface

use of org.pentaho.di.core.plugins.PluginFolderInterface in project pentaho-kettle by pentaho.

the class TwoWayPasswordEncoderPluginType method registerXmlPlugins.

@Override
protected void registerXmlPlugins() throws KettlePluginException {
    for (PluginFolderInterface folder : pluginFolders) {
        if (folder.isPluginXmlFolder()) {
            List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
            for (FileObject file : pluginXmlFiles) {
                try {
                    Document document = XMLHandler.loadXMLFile(file);
                    Node pluginNode = XMLHandler.getSubNode(document, "plugin");
                    if (pluginNode != null) {
                        registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
                    }
                } catch (Exception e) {
                    // We want to report this plugin.xml error, perhaps an XML typo or something like that...
                    // 
                    log.logError("Error found while reading password encoder plugin.xml file: " + file.getName().toString(), e);
                }
            }
        }
    }
}
Also used : PluginFolderInterface(org.pentaho.di.core.plugins.PluginFolderInterface) Node(org.w3c.dom.Node) FileObject(org.apache.commons.vfs2.FileObject) Document(org.w3c.dom.Document) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException)

Example 2 with PluginFolderInterface

use of org.pentaho.di.core.plugins.PluginFolderInterface in project pentaho-kettle by pentaho.

the class LoggingPluginType method registerXmlPlugins.

@Override
protected void registerXmlPlugins() throws KettlePluginException {
    for (PluginFolderInterface folder : pluginFolders) {
        if (folder.isPluginXmlFolder()) {
            List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
            for (FileObject file : pluginXmlFiles) {
                try {
                    Document document = XMLHandler.loadXMLFile(file);
                    Node pluginNode = XMLHandler.getSubNode(document, "plugin");
                    if (pluginNode != null) {
                        registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
                    }
                } catch (Exception e) {
                    // We want to report this plugin.xml error, perhaps an XML typo or something like that...
                    // 
                    log.logError("Error found while reading logging plugin.xml file: " + file.getName().toString(), e);
                }
            }
        }
    }
}
Also used : PluginFolderInterface(org.pentaho.di.core.plugins.PluginFolderInterface) Node(org.w3c.dom.Node) FileObject(org.apache.commons.vfs2.FileObject) Document(org.w3c.dom.Document) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException)

Example 3 with PluginFolderInterface

use of org.pentaho.di.core.plugins.PluginFolderInterface in project pentaho-kettle by pentaho.

the class ValueMetaPluginType method registerXmlPlugins.

@Override
protected void registerXmlPlugins() throws KettlePluginException {
    for (PluginFolderInterface folder : pluginFolders) {
        if (folder.isPluginXmlFolder()) {
            List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
            for (FileObject file : pluginXmlFiles) {
                try {
                    Document document = XMLHandler.loadXMLFile(file);
                    Node pluginNode = XMLHandler.getSubNode(document, "plugin");
                    if (pluginNode != null) {
                        registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
                    }
                } catch (Exception e) {
                    // We want to report this plugin.xml error, perhaps an XML typo or something like that...
                    // 
                    log.logError("Error found while reading step plugin.xml file: " + file.getName().toString(), e);
                }
            }
        }
    }
}
Also used : PluginFolderInterface(org.pentaho.di.core.plugins.PluginFolderInterface) Node(org.w3c.dom.Node) FileObject(org.apache.commons.vfs2.FileObject) Document(org.w3c.dom.Document) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException)

Example 4 with PluginFolderInterface

use of org.pentaho.di.core.plugins.PluginFolderInterface in project pentaho-kettle by pentaho.

the class LogTablePluginType method registerXmlPlugins.

protected void registerXmlPlugins() throws KettlePluginException {
    for (PluginFolderInterface folder : pluginFolders) {
        if (folder.isPluginXmlFolder()) {
            List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
            for (FileObject file : pluginXmlFiles) {
                try {
                    Document document = XMLHandler.loadXMLFile(file);
                    Node pluginNode = XMLHandler.getSubNode(document, "plugin");
                    if (pluginNode != null) {
                        registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
                    }
                } catch (Exception e) {
                    // We want to report this plugin.xml error, perhaps an XML typo or something like that...
                    // 
                    log.logError("Error found while reading logging plugin.xml file: " + file.getName().toString(), e);
                }
            }
        }
    }
}
Also used : PluginFolderInterface(org.pentaho.di.core.plugins.PluginFolderInterface) Node(org.w3c.dom.Node) FileObject(org.apache.commons.vfs2.FileObject) Document(org.w3c.dom.Document) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException)

Aggregations

FileObject (org.apache.commons.vfs2.FileObject)4 KettlePluginException (org.pentaho.di.core.exception.KettlePluginException)4 PluginFolderInterface (org.pentaho.di.core.plugins.PluginFolderInterface)4 Document (org.w3c.dom.Document)4 Node (org.w3c.dom.Node)4