[jira] Created: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

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

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601344#action_12601344 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Converted EditProductPriceRules.bsh/FindProductPriceRule.bsh to groovy into trunk rev. 661944.

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601345#action_12601345 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Converted EditProductPromoCode.bsh to groovy into trunk rev. 661945.

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601346#action_12601346 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Converted EditProductStoreRoles.bsh/EditProductStoreSurveys.bsh to groovy into trunk rev. 661946.

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601347#action_12601347 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Converted EditKeywordThesaurus.bsh/EditProductStoreSurveys.bsh to groovy into trunk rev. 661951.

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601350#action_12601350 ]

Scott Gray commented on OFBIZ-1801:
-----------------------------------

Hi Marco

Just a couple of things I wanted to point out:
1.  You don't need to enclose the map keys in quotes, groovy always assumes a string unless you explicitly state otherwise
['productId' : productId] can just be [productId : productId]
2. When a map/list/string is coerced to a boolean, empty and null both return false anything else returns true
if (productPriceRules && productPriceRules.size()) can just be (productPriceRules)
Note: an exception to this is that for numbers zero is considered false
3. delegator, security, locale and dispatcher are all available by default so their declarations can be removed from the scripts
4. EntityExpr is deprecated, you should use EntityCondition.makeCondition instead

Thanks for your help


> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601352#action_12601352 ]

Scott Gray commented on OFBIZ-1801:
-----------------------------------

Oops I meant:
if (productPriceRules && productPriceRules.size() > 0) can just be (productPriceRules)

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603358#action_12603358 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Hi Scott,

thanks for your suggestions I made into trunk rev. 664118/664478.
Could you please take a look if I made some mistake or forgot something ?

Thanks in advance
Marco

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603552#action_12603552 ]

Scott Gray commented on OFBIZ-1801:
-----------------------------------

Hi Marco

Everything looks pretty good but I went through and made a few changes in rev. 664687, have a look through them and let me know if you have any questions.


> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603652#action_12603652 ]

Marco Risaliti commented on OFBIZ-1801:
---------------------------------------

Hi Scott,

many thanks to review these groovy scripts and I have understood your changes.
Very interesting the use of iterator and the testing of not null object into groovy.

Thanks a lot
Marco

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1801) Conversion of some bean shell scripts to groovy

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Risaliti closed OFBIZ-1801.
---------------------------------

    Resolution: Fixed

Now that most of the bean shell scripts has been converted to groovy this issue can be closed.

> Conversion of some bean shell scripts to groovy
> -----------------------------------------------
>
>                 Key: OFBIZ-1801
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1801
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Marco Risaliti
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: ApplyFeaturesFromCategory.groovy, ApplyFeaturesFromGroup.groovy, EditProductAssoc.groovy, EditProductContent.groovy, EditProductContentContent.groovy, EditProductInventoryItems.groovy, EditProductQuickAdmin.groovy, QuickAddVariants.groovy
>
>
> I have tried to convert some bsh script of product screens and seems to me groovy is very more faster/readable and easy to write.
> I upload here some new scripts that has to be tested.
> I will upload later a patch for ProductScreens.xml for using the new groovy scripts.
> Thanks
> Marco

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

12