Help with Version changes

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

Help with Version changes

MikeButler
Hi all

As a practical way of getting to know Ofbiz framework I am attempting to transfer a hot-deploy component from Ofbiz 12.10 to 13.07. Using Eclipse Luna I have so far reduced the build error count from 130 down to 3 but  I am missing some practical knowledge when using Maps.

cart.addProductPromoUse(productPromoUse.getString("productPromoId"), productPromoUse.getString("productPromoCodeId"), productPromoUse.getBigDecimal("totalDiscountAmount"), productPromoUse.getBigDecimal("quantityLeftInActions"));

Results in error:

 [javac17]   required: String,String,BigDecimal,BigDecimal,Map<ShoppingCartItem,BigDecimal>
 [javac17]   found: String,String,BigDecimal,BigDecimal
 [javac17]   reason: actual and formal argument lists differ in length      

That is to be expected as the function addProductPromoUse() in org.ofbiz.order.shoppingcart has changed  in version 13.07 to include the Map<ShoppingCartItem,BigDecimal> 
  
I have failed to add the missing Map item.  The autocomplete has no workable suggestion.  The closest I have come is adding ", productPromoUse.("ShoppingCartItem" )"  which results in "error  missing identifier" which I guess is a step forward.

Can annyone please help with what the final map item should actually be? and how to work it out?

Regards
Mike Butler 
Reply | Threaded
Open this post in threaded view
|

Re: Help with Version changes

Adrian Crum-3
Try using UtilGenerics.cast(...)

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 4/26/2015 11:57 AM, MikeButler wrote:

> Hi all
> As a practical way of getting to know Ofbiz framework I am attempting to transfer a hot-deploy component from Ofbiz 12.10 to 13.07. Using Eclipse Luna I have so far reduced the build error count from 130 down to 3 but  I am missing some practical knowledge when using Maps.
> cart.addProductPromoUse(productPromoUse.getString("productPromoId"), productPromoUse.getString("productPromoCodeId"), productPromoUse.getBigDecimal("totalDiscountAmount"), productPromoUse.getBigDecimal("quantityLeftInActions"));
> Results in error:
>   [javac17]   required: String,String,BigDecimal,BigDecimal,Map<ShoppingCartItem,BigDecimal> [javac17]   found: String,String,BigDecimal,BigDecimal [javac17]   reason: actual and formal argument lists differ in length
> That is to be expected as the function addProductPromoUse() in org.ofbiz.order.shoppingcart has changed  in version 13.07 to include the Map<ShoppingCartItem,BigDecimal>   I have failed to add the missing Map item.  The autocomplete has no workable suggestion.  The closest I have come is adding ", productPromoUse.("ShoppingCartItem" )"  which results in "error  missing identifier" which I guess is a step forward.
> Can annyone please help with what the final map item should actually be? and how to work it out?
> RegardsMike Butler    
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Help-with-Version-changes-tp4667486.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with Version changes

MikeButler
UtilGenerics.cast() - What do I cast to add the final missing Map<ShoppingCartItem,BigDecimal> reference to the above. With the final code I can work out why but as yet I cannot find the correct usage
Reply | Threaded
Open this post in threaded view
|

Re: Help with Version changes

Deepak Dixit-3
Hi MikeButler,

Please refer commit r#1554381 <http://markmail.org/message/sovtdnxlv45rnff3>

Thanks & Regards

Deepak Dixit


> On Apr 27, 2015, at 1:22 PM, MikeButler <[hidden email]> wrote:
>
> UtilGenerics.cast() - What do I cast to add the final missing
> Map<ShoppingCartItem,BigDecimal> reference to the above. With the final code
> I can work out why but as yet I cannot find the correct usage
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Help-with-Version-changes-tp4667486p4667554.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Help with Version changes

MikeButler
That provided the solution and the answer to the other questions. Just needed to add ", new
HashMap<ShoppingCartItem, BigDecimal>()"

Many thanks