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;