parse(context, digester);
return tobagoConfig;
}
private Digester configure(TobagoConfig config) {
Digester digester = new Digester();
digester.setUseContextClassLoader(true);
digester.push(config);
digester.setValidating(true);
// theme-config
digester.addCallMethod("tobago-config/theme-config/default-theme", "setDefaultThemeName", 0);
digester.addCallMethod("tobago-config/theme-config/supported-theme", "addSupportedThemeName", 0);
// mapping rules
digester.addObjectCreate("tobago-config/mapping-rule", MappingRule.class);
digester.addSetNext("tobago-config/mapping-rule", "addMappingRule");
digester.addCallMethod(
"tobago-config/mapping-rule/request-uri", "setRequestUri", 0);
digester.addCallMethod(
"tobago-config/mapping-rule/forward-uri", "setForwardUri", 0);
digester.addObjectCreate(
"tobago-config/mapping-rule/attribute", Attribute.class);
digester.addSetNext(
"tobago-config/mapping-rule/attribute", "addAttribute");
digester.addCallMethod(
"tobago-config/mapping-rule/attribute/key", "setKey", 0);
digester.addCallMethod(
"tobago-config/mapping-rule/attribute/value", "setValue", 0);
// XXX: deprecated! will ever be true (will be removed in next release after 1.0.7)
digester.addCallMethod("tobago-config/load-theme-resources-from-classpath", "setLoadThemesFromClasspath", 0);
// resource dirs
digester.addCallMethod("tobago-config/resource-dir", "addResourceDir", 0);
// enable ajax
digester.addCallMethod("tobago-config/ajax-enabled", "setAjaxEnabled", 0);
// see bug TOBAGO-912
digester.addCallMethod("tobago-config/fix-resource-order", "setFixResourceOrder", 0);
// see bug TOBAGO-916
digester.addCallMethod("tobago-config/fix-layout-transparency", "setFixLayoutTransparency", 0);
digester.addObjectCreate("tobago-config/renderers", RenderersConfigImpl.class);
digester.addSetNext("tobago-config/renderers", "setRenderersConfig");
digester.addObjectCreate("tobago-config/renderers/renderer", RendererConfig.class);
digester.addSetNext("tobago-config/renderers/renderer", "addRenderer");
digester.addCallMethod("tobago-config/renderers/renderer/name", "setName", 0);
digester.addObjectCreate("tobago-config/renderers/renderer/supported-markup", MarkupConfig.class);
digester.addSetNext("tobago-config/renderers/renderer/supported-markup", "setMarkupConfig");
digester.addCallMethod("tobago-config/renderers/renderer/supported-markup/markup", "addMarkup", 0);
return digester;
}