From 987b444bdfceb44eea73f81ffde40c6fde90bb98 Mon Sep 17 00:00:00 2001 From: Adrian Crum Date: Wed, 2 Jan 2008 17:41:16 +0000 Subject: [PATCH] Fix for r607823. The OFBiz custom xml properties file format requires the file extension in the resource name. Detailed explanation in the dev mailing list. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@608156 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/base/org/ofbiz/base/util/UtilProperties.java | 5 ++--- .../org/ofbiz/example/ExamplePermissionServices.xml | 2 +- .../org/ofbiz/example/example/ExampleServices.xml | 2 +- .../ofbiz/example/feature/ExampleFeatureServices.xml | 12 ++++++------ framework/example/widget/example/CommonScreens.xml | 3 +-- .../example/widget/example/ExampleFeatureScreens.xml | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java b/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java index 4d69cc303b..b44dcf0b26 100644 --- a/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java +++ b/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java @@ -670,7 +670,6 @@ public class UtilProperties implements java.io.Serializable { if (UtilValidate.isEmpty(resource)) { throw new IllegalArgumentException("resource cannot be null or empty"); } - // This is for *.properties files only (not *.xml files) String resourceName = createResourceName(resource, locale); if (propertiesNotFound.contains(resourceName)) { return null; @@ -678,14 +677,14 @@ public class UtilProperties implements java.io.Serializable { URL url = null; try { // Check for complete URL first - if (resource.endsWith(".xml")) { + if (resource.endsWith(".xml") || resource.endsWith(".properties")) { url = FlexibleLocation.resolveLocation(resource); if (url != null) { return url; } } // Check for XML properties file next - url = FlexibleLocation.resolveLocation(resource + ".xml"); + url = FlexibleLocation.resolveLocation(resourceName + ".xml"); if (url != null) { return url; } diff --git a/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml b/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml index b1ca359653..7669749daa 100644 --- a/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml +++ b/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml @@ -31,7 +31,7 @@ under the License. - + diff --git a/framework/example/script/org/ofbiz/example/example/ExampleServices.xml b/framework/example/script/org/ofbiz/example/example/ExampleServices.xml index 36b163b9e8..b39dbce23f 100644 --- a/framework/example/script/org/ofbiz/example/example/ExampleServices.xml +++ b/framework/example/script/org/ofbiz/example/example/ExampleServices.xml @@ -46,7 +46,7 @@ under the License. - + diff --git a/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml b/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml index e1f2eb167b..00f789da79 100644 --- a/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml +++ b/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml @@ -23,7 +23,7 @@ under the License. - + @@ -33,7 +33,7 @@ under the License. - + @@ -41,7 +41,7 @@ under the License. - + @@ -50,7 +50,7 @@ under the License. - + @@ -61,7 +61,7 @@ under the License. - + @@ -69,7 +69,7 @@ under the License. - + diff --git a/framework/example/widget/example/CommonScreens.xml b/framework/example/widget/example/CommonScreens.xml index f4da7b9d32..19f9e72644 100644 --- a/framework/example/widget/example/CommonScreens.xml +++ b/framework/example/widget/example/CommonScreens.xml @@ -24,8 +24,7 @@ under the License.
- - + diff --git a/framework/example/widget/example/ExampleFeatureScreens.xml b/framework/example/widget/example/ExampleFeatureScreens.xml index 20dc2f0cc1..4d78a6501e 100644 --- a/framework/example/widget/example/ExampleFeatureScreens.xml +++ b/framework/example/widget/example/ExampleFeatureScreens.xml @@ -93,7 +93,7 @@ under the License. - +