You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "amit kumar (JIRA)" <ji...@apache.org> on 2012/05/18 16:43:06 UTC
[jira] [Created] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
amit kumar created OFBIZ-4885:
---------------------------------
Summary: Support for closure, if and loop for inline groovy script in set filed of action tag.
Key: OFBIZ-4885
URL: https://issues.apache.org/jira/browse/OFBIZ-4885
Project: OFBiz
Issue Type: Improvement
Components: framework
Affects Versions: SVN trunk
Reporter: amit kumar
Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
<form>
<action>
<set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
</action>
</form>
But, we can not use closure, if or loop in this kind of inline groovy. like
<form>
<action>
<set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
</action>
</form>
The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "amit kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
amit kumar updated OFBIZ-4885:
------------------------------
Issue Type: Bug (was: Improvement)
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: amit kumar
> Labels: closure, groovy, inline
> Attachments: FlexibleStringExpander.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux updated OFBIZ-4885:
-----------------------------------
Attachment: OFBIZ-4885_Support for closure in inline groovy script.patch
This is interesting, but how would you handle multiple closures?
Also I refactored your patch:
* no tabs but 4 spaces
* path from root when creating patch
* I added a internalOpenBracket var
* better comment for action
** //Scan for internal brackets for closures
** instead of
** // Scan for matching closing bracket
I attach my patch as intended for inclusion, but we could have a try on expanding with multiple closures. Else if nobody is concerned I will commit as is... At least it adds a useful feature.
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Amit Kumar
> Labels: closure, groovy, inline, patch
> Attachments: OFBIZ-4885_Support for closure in inline groovy script.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "amit kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
amit kumar updated OFBIZ-4885:
------------------------------
Attachment: OFBIZ-4885_Support for closure in inline groovy script.patch
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: amit kumar
> Attachments: FlexibleStringExpander.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "amit kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
amit kumar updated OFBIZ-4885:
------------------------------
Issue Type: Improvement (was: Bug)
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: amit kumar
> Labels: closure, groovy, inline
> Attachments: FlexibleStringExpander.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-4885) Support for closure, if and loop
for inline groovy script in set filed of action tag.
Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419785#comment-13419785 ]
Jacques Le Roux commented on OFBIZ-4885:
----------------------------------------
Mmm, thinking about it I wonder ow this is handled in minilang now (after last overhaul)... The idea is to converge at term to have only one syntax in <actions> and minilang...
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Amit Kumar
> Labels: closure, groovy, inline, patch
> Attachments: OFBIZ-4885_Support for closure in inline groovy script.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux updated OFBIZ-4885:
-----------------------------------
Attachment: (was: FlexibleStringExpander.patch)
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Amit Kumar
> Labels: closure, groovy, inline, patch
> Attachments: OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "Amit Kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Kumar updated OFBIZ-4885:
------------------------------
Labels: closure groovy inline patch (was: closure groovy inline)
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Amit Kumar
> Labels: closure, groovy, inline, patch
> Attachments: FlexibleStringExpander.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-4885) Support for closure, if and loop
for inline groovy script in set filed of action tag.
Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419783#comment-13419783 ]
Jacques Le Roux commented on OFBIZ-4885:
----------------------------------------
Ha, last but not least: I only reviewed, not tested...
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Amit Kumar
> Labels: closure, groovy, inline, patch
> Attachments: OFBIZ-4885_Support for closure in inline groovy script.patch, OFBIZ-4885_Support for closure in inline groovy script.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OFBIZ-4885) Support for closure, if and loop for
inline groovy script in set filed of action tag.
Posted by "amit kumar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
amit kumar updated OFBIZ-4885:
------------------------------
Attachment: FlexibleStringExpander.patch
> Support for closure, if and loop for inline groovy script in set filed of action tag.
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-4885
> URL: https://issues.apache.org/jira/browse/OFBIZ-4885
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: amit kumar
> Attachments: FlexibleStringExpander.patch
>
>
> Currently, we can use inline groovy script in set field tag of action tag in screens and forms. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: someList?someList.size():0;}"/>
> </action>
> </form>
> But, we can not use closure, if or loop in this kind of inline groovy. like
> <form>
> <action>
> <set field="tempVar" value="${groovy: str=''; someList.each{str=str+it}}"/>
> </action>
> </form>
> The reason is that matching closing } braces for any opening { braces in the script are ignored and script does not get compiled if it contains any set of { and }.
> So, I have added a patch which makes it possible to use closure, if and loop by handling { and } braces occurs with in the script.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira