// @todo make this part of the internal API and move to MPS
configBuilder.addApplicationPluginRuleSet(new MpsPluginRuleSet());
mariner = configBuilder.buildConfiguration();
// Create references to all the simple sub-objects
AgentConfiguration agent = mariner.getAgent();
AppServerConfiguration appServer = mariner.getAppServer();
DebugConfiguration debug = mariner.getDebug();
ProtocolsConfiguration protocols = mariner.getProtocols();
// Build the map of element attribute values just the same as the
// previous XMLHandler based Config did for backwards compatibility.
AttributeMap attrs;
if (mariner != null) {
attrs = makeAttrs(Volantis.CONFIG_PAGEMESSAGES_ELEMENT);
attrs.put("heading", mariner.getPageMessageHeading());
attrs = makeAttrs(Volantis.CONFIG_SCRIPTS_ELEMENT);
attrs.put("base", mariner.getScriptsBase());
attrs = makeAttrs(Volantis.CONFIG_MODESETS_ELEMENT);
attrs.put("base", mariner.getModeSetsBase());
attrs = makeAttrs(Volantis.CONFIG_CHARTIMAGES_ELEMENT);
attrs.put("base", mariner.getChartImagesBase());
attrs = makeAttrs(Volantis.PLUGINS_ELEMENT);
attrs.put("url-rewriter", mariner.getUrlRewriterPluginClass());
attrs.put("asset-url-rewriter",
mariner.getAssetURLRewriterPluginClass());
attrs.put("asset-transcoder",
mariner.getAssetTranscoderPluginClass());
attrs = makeAttrs(Volantis.CONFIG_PAGE_PACKAGING_MIME);
attrs.put("enabled", mariner.getPagePackagingMimeEnabled());
attrs = makeAttrs(Volantis.CONFIG_MAP_COOKIES_ELEMENT);
attrs.put("enabled", mariner.getSessionProxyCookieMappingEnabled());
}
if (debug != null) {
attrs = makeAttrs(Volantis.CONFIG_DEBUG_ELEMENT);
attrs.put("logPageOutput", debug.getLogPageOutput());
attrs.put("comments", debug.getComments());
}
if (protocols != null) {
attrs = makeAttrs(Volantis.CONFIG_PROTOCOLS_ELEMENT);
attrs.put("preferred-output-format",
protocols.getPreferredOutputFormat());
}
if (agent != null) {
attrs = makeAttrs(Volantis.CONFIG_AGENT_ELEMENT);
attrs.put("enabled", "true"); // corresponds to Enabled.
attrs.put("password", agent.getPassword());
attrs.put("port", agent.getPort());
}
if (appServer != null) {
attrs = makeAttrs(Volantis.CONFIG_WEBAPP_ELEMENT);
attrs.put("base-url", appServer.getBaseUrl());