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

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

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

Adrian Crum-3
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, [hidden email] 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) {
>
>

Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
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" <[hidden email]>

> 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, [hidden email] 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) {
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

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

Adrian Crum-3
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" <[hidden email]>
>> 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, [hidden email] 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) {
>>>
>>>

Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
They are just reversed

Jacques

From: "Adrian Crum" <[hidden email]>

> 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" <[hidden email]>
>>> 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, [hidden email] 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) {
>>>>
>>>>
>
Reply | Threaded
Open this post in threaded view
|

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

Adrian Crum-3
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" <[hidden email]>
>> 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" <[hidden email]>
>>>> 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, [hidden email] 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) {
>>>>>
>>>>>