From 49da447de101f61e643c10d4d89e6957afe0b802 Mon Sep 17 00:00:00 2001 From: tkellner Date: Fri, 3 Feb 2012 14:10:57 +0000 Subject: Disable use of StylesheetURL by default git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1024 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java | 15 ++++++++++++++- .../at/gv/egiz/bku/spring/ConfigurationFactoryBean.java | 8 +++++--- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'bkucommon/src/main') diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java index 05290de2..fb41c7fb 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java @@ -135,6 +135,11 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement .getString(ConfigurationFactoryBean.SIGNATURE_LAYOUT_PROPERTY); } + public boolean getEnableStylesheetURL() { + return configuration + .getBoolean(ConfigurationFactoryBean.USE_STYLESHEETURL_PROPERTY, false); + } + } /** @@ -538,7 +543,15 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement resultContentType = HttpUtil.TXT_XML; } } - templates = getTemplates(getStyleSheetUrl()); + String stylesheetURL = getStyleSheetUrl(); + if (configurationFacade.getEnableStylesheetURL()) + templates = getTemplates(stylesheetURL); + else + { + templates = null; + if (stylesheetURL != null) + log.info("Ignoring StylesheetURL ({})", stylesheetURL); + } if (templates != null) { log.debug("Output transformation required."); resultContentType = templates.getOutputProperties().getProperty("media-type"); diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java b/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java index c3eee861..55a1c7f2 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java @@ -57,13 +57,15 @@ public class ConfigurationFactoryBean implements FactoryBean, ResourceLoaderAwar protected static final Logger log = LoggerFactory.getLogger(ConfigurationFactoryBean.class); public static final String DEFAULT_CONFIG = "/WEB-INF/conf/configuration.xml"; - + public static final String MOCCA_IMPLEMENTATIONNAME_PROPERTY = "ProductName"; public static final String MOCCA_IMPLEMENTATIONVERSION_PROPERTY = "ProductVersion"; - + public static final String SIGNATURE_LAYOUT_PROPERTY = "SignatureLayout"; - + + public static final String USE_STYLESHEETURL_PROPERTY = "UseStylesheetURL"; + /** * The URL of the configuration file. */ -- cgit v1.2.3