Allow ShoppingCartHelper.addToCart to be called from simple-method
------------------------------------------------------------------ Key: OFBIZ-400 URL: http://issues.apache.org/jira/browse/OFBIZ-400 Project: OFBiz (The Open for Business Project) Issue Type: Improvement Reporter: Chris Howe Priority: Minor Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=all ]
Chris Howe updated OFBIZ-400: ----------------------------- Attachment: ShoppingCartHelper.patch ShopingCartHelper.patch takes the third approach as it is the quickest. > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12446572 ]
Jacopo Cappellato commented on OFBIZ-400: ----------------------------------------- The patch is ok for me. However the existing method looks a bit odd: it takes objects as input parameters (e.g. a Double for the amount and price) and the only primitive variable is the one for quantity. So I'd prefer to modify the signature of the method instead of adding a new one as proposed by Chris (that however is the best practice in general). Then we'll have to patch the ShoppingCartEvents class (in two points) to reflect this change. > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12446637 ]
Jacques Le Roux commented on OFBIZ-400: --------------------------------------- I agree with Jacopo, seems more sound, this will have no more impacts than patching ShoppingCartEvents ? > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12446839 ]
David E. Jones commented on OFBIZ-400: -------------------------------------- This is a good topic, and something I've wanted to fix in the simple-method call-*-method operations to avoid having to create new method variations, which are a real mess. For this ShoppingCart method the reason we are using double for certain fields instead of Double to represent that they are required, whereas the Double ones can be null and so are optional. For now you could use a call-bsh snippet to call the method. The fix I'd like to do is to improve the reflection stuff in these operations to be able to pick out the primitive types and support them... > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=all ]
Chris Howe updated OFBIZ-400: ----------------------------- Attachment: CachedClassLoader.patch CachedClassLoader.patch adds the class objects for the representations of the primitive types to CachedClassLoader (not including void) This adds the functionality of primitive types to minilang since it checks the CachedClassLoader first. This approach may need to be added elsewhere as things may not check the the CachedClassLoader first. > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
Hi there,
I just translated the "OFBiz Basic Production Setup Guide" into Chinese. I hope Chinese people here who experienced in OFBiz can review my translation and figure out any mistakes in it. You can view it from: http://opencms-ofbiz.cvs.sourceforge.net/*checkout*/opencms-ofbiz/OFBiz-zh/docs/manual/OFBiz-manual-zh.pdf?revision=1.1 TIA, Shi Yusen/Beijing Langhua Ltd. |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=all ]
David E. Jones reassigned OFBIZ-400: ------------------------------------ Assignee: David E. Jones > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Assigned To: David E. Jones > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12451782 ]
David E. Jones commented on OFBIZ-400: -------------------------------------- Chris: this CachedClassLoader patch looks interesting, but I wasn't sure from your comments if this actually made it possible to call the addToCart method as-is using a simple-method call-object-method operation. Have you tried that and it is working, or is this CachedClassLoader change meant to be just a step in that direction? > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Assigned To: David E. Jones > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12451784 ]
Chris Howe commented on OFBIZ-400: ---------------------------------- it works using type="Double.TYPE" . I didn't try type="double.class", i would assume that should work as well though as they should return the same thing. > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Assigned To: David E. Jones > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12451788 ]
Chris Howe commented on OFBIZ-400: ---------------------------------- David, I just reread your comment. The part about needing to be added elsewhere was meant for other minilang operations. I know the <set/> function works differently with its conversions and such but disregards the primitive types. Both <call-object-method/> and <call-class-method/> check the CachedClassLoader > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Assigned To: David E. Jones > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-400?page=comments#action_12452560 ]
Chris Howe commented on OFBIZ-400: ---------------------------------- while the primitives work fine with this patch, I've been trying to access classes in other projects that run successfully using <call-bsh/> however when put it in a call-class-method it fails. That got me thinking ... if you enter type="Double.TYPE" that should resolve correctly without using the CachedClassLoader (it doesn't, but it should). So, there's a problem somewhere else. > Allow ShoppingCartHelper.addToCart to be called from simple-method > ------------------------------------------------------------------ > > Key: OFBIZ-400 > URL: http://issues.apache.org/jira/browse/OFBIZ-400 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Reporter: Chris Howe > Assigned To: David E. Jones > Priority: Minor > Attachments: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |