Author: adrianc
Date: Thu Feb 28 12:03:15 2008 New Revision: 632106 URL: http://svn.apache.org/viewvc?rev=632106&view=rev Log: Final fix for "resource not found" errors in mini-lang. Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java ofbiz/trunk/framework/minilang/config/DefaultMessages.xml Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java?rev=632106&r1=632105&r2=632106&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java (original) +++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java Thu Feb 28 12:03:15 2008 @@ -523,23 +523,12 @@ } catch (Exception e) { if (UtilValidate.isNotEmpty(e.getMessage())) { Debug.log(e.getMessage(), module); + } else { + Debug.log("Exception thrown: " + e.getClass().getName(), module); } properties = null; } } - if (UtilValidate.isEmpty(properties) && !resource.endsWith(".xml")) { - url = resolvePropertiesUrl(resource + ".xml", locale); - if (url != null) { - try { - properties = new ExtendedProperties(url, locale); - } catch (Exception e) { - if (UtilValidate.isNotEmpty(e.getMessage())) { - Debug.log(e.getMessage(), module); - } - properties = null; - } - } - } if (UtilValidate.isNotEmpty(properties)) { Debug.logInfo("Loaded " + properties.size() + " properties for: " + resource + " (" + locale + ")", module); } @@ -703,11 +692,16 @@ if (url != null) { return url; } - // Check for XML properties file + // Check for Java XML properties file url = FlexibleLocation.resolveLocation(resourceName + ".xml"); if (url != null) { return url; } + // Check for Custom XML properties file + url = FlexibleLocation.resolveLocation(resource + ".xml"); + if (url != null) { + return url; + } url = FlexibleLocation.resolveLocation(resourceName); if (url != null) { return url; @@ -771,7 +765,10 @@ if (properties == null) { properties = new Properties(); } - properties.put(property.getAttribute("key"), UtilXml.elementValue(value)); + String valueString = UtilXml.elementValue(value); + if (valueString != null) { + properties.put(property.getAttribute("key"), valueString); + } } } return properties; Modified: ofbiz/trunk/framework/minilang/config/DefaultMessages.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/config/DefaultMessages.xml?rev=632106&r1=632105&r2=632106&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/config/DefaultMessages.xml (original) +++ ofbiz/trunk/framework/minilang/config/DefaultMessages.xml Thu Feb 28 12:03:15 2008 @@ -23,13 +23,13 @@ <value xml:lang="fr">Erreur : </value> </property> <property key="check.error.suffix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="check.message.prefix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="check.message.suffix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="service.default.message"> <value xml:lang="en">The action was performed successfully.</value> @@ -46,18 +46,18 @@ <value xml:lang="fr">Erreur : </value> </property> <property key="service.error.suffix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="service.message.prefix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="service.message.suffix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="service.success.prefix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> <property key="service.success.suffix"> - <value xml:lang="en"> </value> + <value xml:lang="en"></value> </property> </resource> |
Free forum by Nabble | Edit this page |