[jira] Commented: (OFBIZ-400) Allow ShoppingCartHelper.addToCart to be called from simple-method

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

[jira] Commented: (OFBIZ-400) Allow ShoppingCartHelper.addToCart to be called from simple-method

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466667 ]

Chris Howe commented on OFBIZ-400:
----------------------------------

David:

Thanks for taking care of this.  The reason why I had opted for .class and .TYPE was because it was the original solution that I had found while googling.  However, I would prefer a different keyword though to avoid possible confusion on the case sensitivity.  

I see myself using this more with external jars that I'd like to treat as a black box, so I would prefer the method fail with an "invalid class type" then fail with "method not found" error for the logs to cover a typo between Boolean and boolean. Perhaps adding the suffix "Primitive" to it   ie "intPrimitive", "booleanPrimitive", etc.

If you disagree and there isn't any feedback in the next day or so feel free to close this as the distinction is rather trivial, but would be nice not to be hunting down the wrong error.  For Reference, this is Rev 498921

The part regarding the shopping cart was for a custom app and that's been taken care of for a while now and not really of much use back in the community project.

Thanks for finding the time to look into this.  There are a lot of integrations that rather novice people can accomplish if they look into simple-methods instead of learning java.

One somewhat related quick question though, shouldn't call-*method be catching all exceptions and leaving it to the simple-method to check errors afterwards?  With the asterisk click to dial integration I was sending an invalid channel and it was failing to a white screen instead of continuing on.  Didn't seem like the correct behavior.

> Allow ShoppingCartHelper.addToCart to be called from simple-method
> ------------------------------------------------------------------
>
>                 Key: OFBIZ-400
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-400
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>            Reporter: Chris Howe
>         Assigned To: David E. Jones
>            Priority: Minor
>         Attachments: CachedClassLoader.patch, CachedClassLoader.patch, ShoppingCartHelper.patch
>
>
> To my knowledge a primitive type double cannot be sent from <call-object-method> in minilang.  So to allow ShoppingCartHelper.addToCart to be usable from minilang there are three possible solutions.
> 1)Change minilang to pass primitive type double (if there is a way to do this already, disregard this issue)
> 2)Change addToCart to accept Double quantity instead of double quantity
> 3)Create additional method that accepts Double quantity and then passes that to the current addToCart with a quantity.doubleValue()

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.