From 0298f47d427f8f6afc3d2d67c5a1529cf41f6b8e Mon Sep 17 00:00:00 2001 From: "Niels Erik G. Nielsen" Date: Fri, 15 Mar 2013 20:57:50 -0400 Subject: [PATCH] Fixes config file path resolution issues --- .../java/com/indexdata/pz2utils4jsf/config/Configuration.java | 8 +++++++- .../com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java index adab4bb..67106c3 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java @@ -9,6 +9,12 @@ import org.apache.log4j.Logger; import com.indexdata.masterkey.config.MissingMandatoryParameterException; import com.indexdata.pz2utils4jsf.utils.Utils; +/** + * Represents a configuration as a set of key-value pairs + * + * @author Niels Erik + * + */ public class Configuration implements Serializable { private static final long serialVersionUID = -6801241975338182197L; @@ -62,7 +68,7 @@ public class Configuration implements Serializable { } public String getConfigFilePath() { - return get("configfilepath","nopathgiven"); + return get("configpath","nopathgiven"); } public Map getConfigMap() { diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java index 430cc73..554f931 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java @@ -22,6 +22,13 @@ import com.indexdata.pz2utils4jsf.errors.ConfigurationException; import com.indexdata.pz2utils4jsf.utils.Utils; import static com.indexdata.pz2utils4jsf.utils.Utils.nl; +/** + * Reads configuration from a MasterKey configuration scheme + * + * + * @author Niels Erik + * + */ @Named @SessionScoped @Alternative public class Mk2ConfigReader implements ConfigurationReader { @@ -58,7 +65,7 @@ public class Mk2ConfigReader implements ConfigurationReader { try { ModuleConfiguration moduleConfig = mkConfigContext.getModuleConfiguration(configurable.getModuleName()); config.addAll(configurable.getDefaults(),moduleConfig.getConfigMap()); - config.set("configpath", mkConfigContext.getConfigFileLocation().getConfigFilePath()); + config.set("configpath", moduleConfig.getConfigFilePath()); } catch (IOException e) { throw new ConfigurationException(Mk2ConfigReader.class + " could not read configuration for '"+ configurable.getModuleName() + "': "+e.getMessage(),e); } -- 1.7.10.4