svn commit: r608315 - in /ofbiz/trunk/framework: base/src/base/org/ofbiz/base/util/ example/script/org/ofbiz/example/ example/script/org/ofbiz/example/example/ example/script/org/ofbiz/example/feature/ example/widget/example/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r608315 - in /ofbiz/trunk/framework: base/src/base/org/ofbiz/base/util/ example/script/org/ofbiz/example/ example/script/org/ofbiz/example/example/ example/script/org/ofbiz/example/feature/ example/widget/example/

adrianc
Author: adrianc
Date: Wed Jan  2 18:50:58 2008
New Revision: 608315

URL: http://svn.apache.org/viewvc?rev=608315&view=rev
Log:
Fixed properties file resolver in new UtilProperties code.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilProperties.java
    ofbiz/trunk/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml
    ofbiz/trunk/framework/example/script/org/ofbiz/example/example/ExampleServices.xml
    ofbiz/trunk/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml
    ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
    ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.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=608315&r1=608314&r2=608315&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 Wed Jan  2 18:50:58 2008
@@ -56,7 +56,7 @@
  * <p>The locale-specific class of properties files can be in any one of three
  * formats: the standard text-based key=value format (*.properties file), the Java
  * XML properties format, and the OFBiz-specific XML file format
- * (see the <a href="#toProperties(java.io.InputStream,%20java.util.Locale,%20java.util.Properties)">toProperties</a>
+ * (see the <a href="#xmlToProperties(java.io.InputStream,%20java.util.Locale,%20java.util.Properties)">xmlToProperties</a>
  * method).</p>
  */
 @SuppressWarnings("serial")
@@ -477,7 +477,14 @@
         ResourceBundle bundle = null;
         try {
             bundle = UtilResourceBundle.getBundle(resource, locale, (ClassLoader) null);
-        } catch (MissingResourceException e) {
+        } catch (MissingResourceException e) {}
+        if (bundle == null && !resource.endsWith(".xml")) {
+            try {
+                // Try custom XML format
+                bundle = UtilResourceBundle.getBundle(resource + ".xml", locale, (ClassLoader) null);
+            } catch (MissingResourceException e) {}
+        }
+        if (bundle == null) {
             String resourceCacheKey = resource + "_" + locale.toString();
             if (!resourceNotFoundMessagesShown.contains(resourceCacheKey)) {
                 resourceNotFoundMessagesShown.add(resourceCacheKey);

Modified: ofbiz/trunk/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml?rev=608315&r1=608314&r2=608315&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml (original)
+++ ofbiz/trunk/framework/example/script/org/ofbiz/example/ExamplePermissionServices.xml Wed Jan  2 18:50:58 2008
@@ -31,7 +31,7 @@
             <set field="hasPermission" type="Boolean" value="true"/>
             <field-to-result field-name="hasPermission"/>
             <else>
-                <property-to-field resource="ExampleUiLabels.xml" property="ExamplePermissionError" field-name="failMessage"/>
+                <property-to-field resource="ExampleUiLabels" property="ExamplePermissionError" field-name="failMessage"/>
                 <set field="hasPermission" type="Boolean" value="false"/>
                 <field-to-result field-name="hasPermission"/>
                 <field-to-result field-name="failMessage"/>

Modified: ofbiz/trunk/framework/example/script/org/ofbiz/example/example/ExampleServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/script/org/ofbiz/example/example/ExampleServices.xml?rev=608315&r1=608314&r2=608315&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/script/org/ofbiz/example/example/ExampleServices.xml (original)
+++ ofbiz/trunk/framework/example/script/org/ofbiz/example/example/ExampleServices.xml Wed Jan  2 18:50:58 2008
@@ -46,7 +46,7 @@
                 </entity-one>
                 <if-empty field-name="statusValidChange">
                     <!-- no valid change record found? return an error... -->
-                    <add-error><fail-property resource="ExampleUiLabels.xml" property="ExampleErrorNoExampleStatusValidChange"/></add-error>
+                    <add-error><fail-property resource="ExampleUiLabels" property="ExampleErrorNoExampleStatusValidChange"/></add-error>
                     <check-errors/>
                 </if-empty>
             </if-not-empty>

Modified: ofbiz/trunk/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml?rev=608315&r1=608314&r2=608315&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml (original)
+++ ofbiz/trunk/framework/example/script/org/ofbiz/example/feature/ExampleFeatureServices.xml Wed Jan  2 18:50:58 2008
@@ -23,7 +23,7 @@
     <!-- ExampleFeature methods -->
     <simple-method method-name="createExampleFeature" short-description="create a ExampleFeature">
         <set value="_CREATE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <make-value entity-name="ExampleFeature" value-name="newEntity"/>
         <sequenced-id-to-env sequence-name="ExampleFeature" env-name="newEntity.exampleFeatureId"/> <!-- get the next sequenced ID -->
@@ -33,7 +33,7 @@
     </simple-method>  
     <simple-method method-name="updateExampleFeature" short-description="update a ExampleFeature">
         <set value="_UPDATE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <entity-one entity-name="ExampleFeature" value-name="lookedUpValue"/>
         <set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
@@ -41,7 +41,7 @@
     </simple-method>
     <simple-method method-name="deleteExampleFeature" short-description="delete a ExampleFeature">
         <set value="_DELETE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <entity-one entity-name="ExampleFeature" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
@@ -50,7 +50,7 @@
     <!-- ExampleFeatureAppl methods -->
     <simple-method method-name="createExampleFeatureAppl" short-description="create a ExampleFeatureAppl">
         <set value="_CREATE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <make-value entity-name="ExampleFeatureAppl" value-name="newEntity"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
@@ -61,7 +61,7 @@
     </simple-method>  
     <simple-method method-name="updateExampleFeatureAppl" short-description="update a ExampleFeatureAppl">
         <set value="_UPDATE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <entity-one entity-name="ExampleFeatureAppl" value-name="lookedUpValue"/>
         <set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
@@ -69,7 +69,7 @@
     </simple-method>
     <simple-method method-name="deleteExampleFeatureAppl" short-description="delete a ExampleFeatureAppl">
         <set value="_DELETE" field="securityAction"/>
-        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
         <check-errors/>
         <entity-one entity-name="ExampleFeatureAppl" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>

Modified: ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/CommonScreens.xml?rev=608315&r1=608314&r2=608315&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/CommonScreens.xml Wed Jan  2 18:50:58 2008
@@ -24,7 +24,7 @@
         <section>
             <actions>
                 <!-- base/top/specific map first, then more common map added for shared labels -->
-                <property-map resource="ExampleUiLabels.xml" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
 
                 <set field="layoutSettings.companyName" from-field="uiLabelMap.ExampleCompanyName" global="true"/>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml?rev=608315&r1=608314&r2=608315&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml Wed Jan  2 18:50:58 2008
@@ -93,7 +93,7 @@
                 <if-has-permission permission="EXAMPLE" action="_VIEW"/>
             </condition>
             <actions>
-                <property-map resource="ExampleUiLabels.xml" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="title" value="${uiLabelMap.PageTitleLookupExampleFeature}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>