Package org.apache.beehive.netui.util.config

Examples of org.apache.beehive.netui.util.config.ConfigInitializationException


                    LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                        "with a set of minimum parameters.");

                /* todo: should this throw an exception? */
                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());
View Full Code Here


                        LOGGER.info("Validation warning validating config file \"" + resourcePath +
                            "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                }

                public void error(SAXParseException exception) {
                        throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                            resourcePath + "\".  Cause: " + exception, exception);
                }

                public void fatalError(SAXParseException exception) {
                    throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                        resourcePath + "\".  Cause: " + exception, exception);
                }
            });

            db.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) {
                    if(systemId.endsWith("/beehive-netui-config.xsd")) {
                        InputStream inputStream = NetUIConfigParser.class.getClassLoader().getResourceAsStream(CONFIG_SCHEMA);
                        return new InputSource(inputStream);
                    }
                    else return null;
                }
            });

            Document document = db.parse(is);

            PageFlowActionInterceptorsConfig pfActionInterceptorsConfig = parsePfActionInterceptorsConfig(document);
            PageFlowHandlersConfig pfHandlersConfig = parsePfHandlersConfig(document);
            PageFlowConfig pfConfig = parsePfConfig(document);
            PageFlowFactoriesConfig pfFactoriesConfig = parsePfFactoriesConfig(document);
            SharedFlowRefConfig[] sharedFlowRefConfigs = parseSharedFlowRefConfigs(document);
            RequestInterceptorsConfig requestInterceptorsConfig = parseRequestInterceptorsConfig(document);

            JspTagConfig jspTagConfig = parseJspTagConfig(document);
            ExpressionLanguagesConfig elConfig = parseExpressionLanguageConfig(document);
            TypeConverterConfig[] typeConvertersConfig = parseTypeConvertersConfig(document);
            UrlConfig urlConfig = parseUrlConfig(document);
            IteratorFactoryConfig[] iteratorFactories = parseIteratorFactoryConfig(document);
            PrefixHandlerConfig[] prefixHandlers = parsePrefixHandlerConfig(document);

            netuiConfig = new NetUIConfig(
                pfActionInterceptorsConfig,
                pfHandlersConfig,
                pfConfig,
                pfFactoriesConfig,
                sharedFlowRefConfigs,
                requestInterceptorsConfig,
                jspTagConfig,
                prefixHandlers,
                elConfig,
                iteratorFactories,
                typeConvertersConfig,
                urlConfig
                );
        }
        catch(ParserConfigurationException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(IOException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(SAXException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        finally {
            try{if(xsdInputStream != null) xsdInputStream.close();} catch(IOException e) {}
        }
        return netuiConfig;
View Full Code Here

                    LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                        "with a set of minimum parameters.");

                /* todo: should this throw an exception? */
                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());
View Full Code Here

                        LOGGER.info("Validation warning validating config file \"" + resourcePath +
                            "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                }

                public void error(SAXParseException exception) {
                        throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                            resourcePath + "\".  Cause: " + exception, exception);
                }

                public void fatalError(SAXParseException exception) {
                    throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                        resourcePath + "\".  Cause: " + exception, exception);
                }
            });

            db.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) {
                    if(systemId.endsWith("/beehive-netui-config.xsd")) {
                        InputStream inputStream = NetUIConfigParser.class.getClassLoader().getResourceAsStream(CONFIG_SCHEMA);
                        return new InputSource(inputStream);
                    }
                    else return null;
                }
            });

            Document document = db.parse(is);

            PageFlowActionInterceptorsConfig pfActionInterceptorsConfig = parsePfActionInterceptorsConfig(document);
            PageFlowHandlersConfig pfHandlersConfig = parsePfHandlersConfig(document);
            PageFlowConfig pfConfig = parsePfConfig(document);
            PageFlowFactoriesConfig pfFactoriesConfig = parsePfFactoriesConfig(document);
            SharedFlowRefConfig[] sharedFlowRefConfigs = parseSharedFlowRefConfigs(document);
            RequestInterceptorsConfig requestInterceptorsConfig = parseRequestInterceptorsConfig(document);

            JspTagConfig jspTagConfig = parseJspTagConfig(document);
            ExpressionLanguagesConfig elConfig = parseExpressionLanguageConfig(document);
            TypeConverterConfig[] typeConvertersConfig = parseTypeConvertersConfig(document);
            UrlConfig urlConfig = parseUrlConfig(document);
            IteratorFactoryConfig[] iteratorFactories = parseIteratorFactoryConfig(document);
            PrefixHandlerConfig[] prefixHandlers = parsePrefixHandlerConfig(document);

            netuiConfig = new NetUIConfig(
                pfActionInterceptorsConfig,
                pfHandlersConfig,
                pfConfig,
                pfFactoriesConfig,
                sharedFlowRefConfigs,
                requestInterceptorsConfig,
                jspTagConfig,
                prefixHandlers,
                elConfig,
                iteratorFactories,
                typeConvertersConfig,
                urlConfig
                );
        }
        catch(ParserConfigurationException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(IOException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(SAXException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        finally {
            try{if(xsdInputStream != null) xsdInputStream.close();} catch(IOException e) {}
        }
        return netuiConfig;
View Full Code Here

                LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                    "with a set of minimum parameters.");

                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());
View Full Code Here

                        LOGGER.info("Validation warning validating config file \"" + resourcePath +
                            "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                }

                public void error(SAXParseException exception) {
                        throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                            resourcePath + "\".  Cause: " + exception, exception);
                }

                public void fatalError(SAXParseException exception) {
                    throw new ConfigInitializationException("Validation errors occurred parsing the config file \"" +
                        resourcePath + "\".  Cause: " + exception, exception);
                }
            });

            db.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) {
                    if(systemId.endsWith("/beehive-netui-config.xsd")) {
                        InputStream inputStream = NetUIConfigParser.class.getClassLoader().getResourceAsStream(CONFIG_SCHEMA);
                        return new InputSource(inputStream);
                    }
                    else return null;
                }
            });

            Document document = db.parse(is);

            PageFlowActionInterceptorsConfig pfActionInterceptorsConfig = parsePfActionInterceptorsConfig(document);
            PageFlowHandlersConfig pfHandlersConfig = parsePfHandlersConfig(document);
            PageFlowConfig pfConfig = parsePfConfig(document);
            PageFlowFactoriesConfig pfFactoriesConfig = parsePfFactoriesConfig(document);
            SharedFlowRefConfig[] sharedFlowRefConfigs = parseSharedFlowRefConfigs(document);
            RequestInterceptorsConfig requestInterceptorsConfig = parseRequestInterceptorsConfig(document);

            JspTagConfig jspTagConfig = parseJspTagConfig(document);
            ExpressionLanguagesConfig elConfig = parseExpressionLanguageConfig(document);
            TypeConverterConfig[] typeConvertersConfig = parseTypeConvertersConfig(document);
            UrlConfig urlConfig = parseUrlConfig(document);
            IteratorFactoryConfig[] iteratorFactories = parseIteratorFactoryConfig(document);
            PrefixHandlerConfig[] prefixHandlers = parsePrefixHandlerConfig(document);

            Element catalogElement = DomUtils.getChildElementByName(document.getDocumentElement(), "catalog");
            CatalogConfig catalogConfig = parseCatalogs(catalogElement);

            netuiConfig = new NetUIConfig(
                pfActionInterceptorsConfig,
                pfHandlersConfig,
                pfConfig,
                pfFactoriesConfig,
                sharedFlowRefConfigs,
                requestInterceptorsConfig,
                jspTagConfig,
                prefixHandlers,
                elConfig,
                iteratorFactories,
                typeConvertersConfig,
                urlConfig
                );
            netuiConfig.setCatalogConfig(catalogConfig);
        }
        catch(ParserConfigurationException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(IOException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        catch(SAXException e) {
            throw new ConfigInitializationException("Error occurred parsing the config file \"" + resourcePath + "\"", e);
        }
        finally {
            try{if(xsdInputStream != null) xsdInputStream.close();} catch(IOException e) {}
        }
        return netuiConfig;
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.util.config.ConfigInitializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.