svn commit: r608156 - 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: r608156 - 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 09:41:16 2008
New Revision: 608156

URL: http://svn.apache.org/viewvc?rev=608156&view=rev
Log:
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.

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=608156&r1=608155&r2=608156&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 09:41:16 2008
@@ -670,7 +670,6 @@
         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 @@
         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;
             }

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=608156&r1=608155&r2=608156&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 09:41:16 2008
@@ -31,7 +31,7 @@
             <set field="hasPermission" type="Boolean" value="true"/>
             <field-to-result field-name="hasPermission"/>
             <else>
-                <property-to-field resource="ExampleUiLabels" property="ExamplePermissionError" field-name="failMessage"/>
+                <property-to-field resource="ExampleUiLabels.xml" 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=608156&r1=608155&r2=608156&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 09:41:16 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" property="ExampleErrorNoExampleStatusValidChange"/></add-error>
+                    <add-error><fail-property resource="ExampleUiLabels.xml" 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=608156&r1=608155&r2=608156&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 09:41:16 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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" property="ExamplePermissionError"/></check-permission>
+        <check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels.xml" 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=608156&r1=608155&r2=608156&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/CommonScreens.xml Wed Jan  2 09:41:16 2008
@@ -24,8 +24,7 @@
         <section>
             <actions>
                 <!-- base/top/specific map first, then more common map added for shared labels -->
-                <!-- XML Properties - the preferred properties file format -->
-                <property-map resource="component://example/config/ExampleUiLabels.xml" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ExampleUiLabels.xml" 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=608156&r1=608155&r2=608156&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml Wed Jan  2 09:41:16 2008
@@ -93,7 +93,7 @@
                 <if-has-permission permission="EXAMPLE" action="_VIEW"/>
             </condition>
             <actions>
-                <property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ExampleUiLabels.xml" 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"/>