You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@sandglass-software.com> on 2013/01/05 11:01:09 UTC

Re: svn commit: r1429234 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

Why were the label files changed in this commit? This commit makes the 
order component dependent on a special purpose component.

-Adrian

On 1/5/2013 8:34 AM, jleroux@apache.org wrote:
> Author: jleroux
> Date: Sat Jan  5 08:34:12 2013
> New Revision: 1429234
>
> URL: http://svn.apache.org/viewvc?rev=1429234&view=rev
> Log:
> A patch from Praveen Agrawal "Implementing Try-Catch while Adding UiLabel Resources" https://issues.apache.org/jira/browse/OFBIZ-5119
>
> In OrderServices.java in method 'sendOrderNotificationScreen (Line :2427) a try catch block must be there surrounding to Adding UiLabel resources to map. So that if any of the resource is not found then rest of the code does not fail.
>
> Modified:
>      ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>
> Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429234&r1=1429233&r2=1429234&view=diff
> ==============================================================================
> --- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
> +++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan  5 08:34:12 2013
> @@ -2425,9 +2425,14 @@ public class OrderServices {
>               locale = Locale.getDefault();
>           }
>   
> -        ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
> -        uiLabelMap.addBottomResourceBundle("OrderUiLabels");
> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
> +        ResourceBundleMapWrapper uiLabelMap = null;
> +        try {
> +            uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("CommonUiLabels", locale);
> +            uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
> +            uiLabelMap.addBottomResourceBundle("OrderUiLabels");
> +        } catch (IllegalArgumentException e) {
> +            Debug.logError(e, "Error adding resource bundle: " + e.toString(), module);
> +        }
>   
>           Map bodyParameters = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "uiLabelMap", uiLabelMap, "locale", locale);
>           if (placingParty!= null) {
>
>


Re: svn commit: r1429234 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/O rderServices.java

Posted by Adrian Crum <ad...@sandglass-software.com>.
Okay, now I see. Sorry.

-Adrian

On 1/5/2013 12:06 PM, Jacques Le Roux wrote:
> They are just reversed
>
> Jacques
>
> From: "Adrian Crum" <ad...@sandglass-software.com>
>> Please look again:
>>
>> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
>>
>> + uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
>>
>> -Adrian
>>
>> On 1/5/2013 11:26 AM, Jacques Le Roux wrote:
>>> Nope, they did not change, just a try-catch block around
>>> We could do better like was done with OFBIZ-3969 (see my comment in OFBIZ-5119), but it's enough for me today
>>>
>>> Jacques
>>>
>>> From: "Adrian Crum" <ad...@sandglass-software.com>
>>>> Why were the label files changed in this commit? This commit makes the
>>>> order component dependent on a special purpose component.
>>>>
>>>> -Adrian
>>>>
>>>> On 1/5/2013 8:34 AM, jleroux@apache.org wrote:
>>>>> Author: jleroux
>>>>> Date: Sat Jan  5 08:34:12 2013
>>>>> New Revision: 1429234
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=1429234&view=rev
>>>>> Log:
>>>>> A patch from Praveen Agrawal "Implementing Try-Catch while Adding UiLabel Resources" https://issues.apache.org/jira/browse/OFBIZ-5119
>>>>>
>>>>> In OrderServices.java in method 'sendOrderNotificationScreen (Line :2427) a try catch block must be there surrounding to Adding UiLabel resources to map. So that if any of the resource is not found then rest of the code does not fail.
>>>>>
>>>>> Modified:
>>>>>        ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>>>>
>>>>> Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429234&r1=1429233&r2=1429234&view=diff
>>>>> ==============================================================================
>>>>> --- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
>>>>> +++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan  5 08:34:12 2013
>>>>> @@ -2425,9 +2425,14 @@ public class OrderServices {
>>>>>                 locale = Locale.getDefault();
>>>>>             }
>>>>>     
>>>>> -        ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
>>>>> -        uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>>>> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
>>>>> +        ResourceBundleMapWrapper uiLabelMap = null;
>>>>> +        try {
>>>>> +            uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("CommonUiLabels", locale);
>>>>> +            uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
>>>>> +            uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>>>> +        } catch (IllegalArgumentException e) {
>>>>> +            Debug.logError(e, "Error adding resource bundle: " + e.toString(), module);
>>>>> +        }
>>>>>     
>>>>>             Map bodyParameters = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "uiLabelMap", uiLabelMap, "locale", locale);
>>>>>             if (placingParty!= null) {
>>>>>
>>>>>


Re: svn commit: r1429234 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/O rderServices.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
They are just reversed

Jacques

From: "Adrian Crum" <ad...@sandglass-software.com>
> Please look again:
> 
> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
> 
> + uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
> 
> -Adrian
> 
> On 1/5/2013 11:26 AM, Jacques Le Roux wrote:
>> Nope, they did not change, just a try-catch block around
>> We could do better like was done with OFBIZ-3969 (see my comment in OFBIZ-5119), but it's enough for me today
>>
>> Jacques
>>
>> From: "Adrian Crum" <ad...@sandglass-software.com>
>>> Why were the label files changed in this commit? This commit makes the
>>> order component dependent on a special purpose component.
>>>
>>> -Adrian
>>>
>>> On 1/5/2013 8:34 AM, jleroux@apache.org wrote:
>>>> Author: jleroux
>>>> Date: Sat Jan  5 08:34:12 2013
>>>> New Revision: 1429234
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1429234&view=rev
>>>> Log:
>>>> A patch from Praveen Agrawal "Implementing Try-Catch while Adding UiLabel Resources" https://issues.apache.org/jira/browse/OFBIZ-5119
>>>>
>>>> In OrderServices.java in method 'sendOrderNotificationScreen (Line :2427) a try catch block must be there surrounding to Adding UiLabel resources to map. So that if any of the resource is not found then rest of the code does not fail.
>>>>
>>>> Modified:
>>>>       ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>>>
>>>> Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>>> URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429234&r1=1429233&r2=1429234&view=diff
>>>> ==============================================================================
>>>> --- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
>>>> +++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan  5 08:34:12 2013
>>>> @@ -2425,9 +2425,14 @@ public class OrderServices {
>>>>                locale = Locale.getDefault();
>>>>            }
>>>>    
>>>> -        ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
>>>> -        uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>>> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
>>>> +        ResourceBundleMapWrapper uiLabelMap = null;
>>>> +        try {
>>>> +            uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("CommonUiLabels", locale);
>>>> +            uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
>>>> +            uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>>> +        } catch (IllegalArgumentException e) {
>>>> +            Debug.logError(e, "Error adding resource bundle: " + e.toString(), module);
>>>> +        }
>>>>    
>>>>            Map bodyParameters = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "uiLabelMap", uiLabelMap, "locale", locale);
>>>>            if (placingParty!= null) {
>>>>
>>>>
>

Re: svn commit: r1429234 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/O rderServices.java

Posted by Adrian Crum <ad...@sandglass-software.com>.
Please look again:

-        uiLabelMap.addBottomResourceBundle("CommonUiLabels");

+ uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");

-Adrian

On 1/5/2013 11:26 AM, Jacques Le Roux wrote:
> Nope, they did not change, just a try-catch block around
> We could do better like was done with OFBIZ-3969 (see my comment in OFBIZ-5119), but it's enough for me today
>
> Jacques
>
> From: "Adrian Crum" <ad...@sandglass-software.com>
>> Why were the label files changed in this commit? This commit makes the
>> order component dependent on a special purpose component.
>>
>> -Adrian
>>
>> On 1/5/2013 8:34 AM, jleroux@apache.org wrote:
>>> Author: jleroux
>>> Date: Sat Jan  5 08:34:12 2013
>>> New Revision: 1429234
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1429234&view=rev
>>> Log:
>>> A patch from Praveen Agrawal "Implementing Try-Catch while Adding UiLabel Resources" https://issues.apache.org/jira/browse/OFBIZ-5119
>>>
>>> In OrderServices.java in method 'sendOrderNotificationScreen (Line :2427) a try catch block must be there surrounding to Adding UiLabel resources to map. So that if any of the resource is not found then rest of the code does not fail.
>>>
>>> Modified:
>>>       ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>>
>>> Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429234&r1=1429233&r2=1429234&view=diff
>>> ==============================================================================
>>> --- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
>>> +++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan  5 08:34:12 2013
>>> @@ -2425,9 +2425,14 @@ public class OrderServices {
>>>                locale = Locale.getDefault();
>>>            }
>>>    
>>> -        ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
>>> -        uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
>>> +        ResourceBundleMapWrapper uiLabelMap = null;
>>> +        try {
>>> +            uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("CommonUiLabels", locale);
>>> +            uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
>>> +            uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>>> +        } catch (IllegalArgumentException e) {
>>> +            Debug.logError(e, "Error adding resource bundle: " + e.toString(), module);
>>> +        }
>>>    
>>>            Map bodyParameters = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "uiLabelMap", uiLabelMap, "locale", locale);
>>>            if (placingParty!= null) {
>>>
>>>


Re: svn commit: r1429234 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/O rderServices.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Nope, they did not change, just a try-catch block around
We could do better like was done with OFBIZ-3969 (see my comment in OFBIZ-5119), but it's enough for me today

Jacques

From: "Adrian Crum" <ad...@sandglass-software.com>
> Why were the label files changed in this commit? This commit makes the 
> order component dependent on a special purpose component.
> 
> -Adrian
> 
> On 1/5/2013 8:34 AM, jleroux@apache.org wrote:
>> Author: jleroux
>> Date: Sat Jan  5 08:34:12 2013
>> New Revision: 1429234
>>
>> URL: http://svn.apache.org/viewvc?rev=1429234&view=rev
>> Log:
>> A patch from Praveen Agrawal "Implementing Try-Catch while Adding UiLabel Resources" https://issues.apache.org/jira/browse/OFBIZ-5119
>>
>> In OrderServices.java in method 'sendOrderNotificationScreen (Line :2427) a try catch block must be there surrounding to Adding UiLabel resources to map. So that if any of the resource is not found then rest of the code does not fail.
>>
>> Modified:
>>      ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>>
>> Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>> URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429234&r1=1429233&r2=1429234&view=diff
>> ==============================================================================
>> --- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
>> +++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan  5 08:34:12 2013
>> @@ -2425,9 +2425,14 @@ public class OrderServices {
>>               locale = Locale.getDefault();
>>           }
>>   
>> -        ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("EcommerceUiLabels", locale);
>> -        uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>> -        uiLabelMap.addBottomResourceBundle("CommonUiLabels");
>> +        ResourceBundleMapWrapper uiLabelMap = null;
>> +        try {
>> +            uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("CommonUiLabels", locale);
>> +            uiLabelMap.addBottomResourceBundle("EcommerceUiLabels");
>> +            uiLabelMap.addBottomResourceBundle("OrderUiLabels");
>> +        } catch (IllegalArgumentException e) {
>> +            Debug.logError(e, "Error adding resource bundle: " + e.toString(), module);
>> +        }
>>   
>>           Map bodyParameters = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "uiLabelMap", uiLabelMap, "locale", locale);
>>           if (placingParty!= null) {
>>
>>
>