[jira] [Commented] (OFBIZ-11436) Convert ProductContentServices.xml mini lang to groovy

2020-03-10 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on OFBIZ-11436:
-

Commit 43b44f53e0897935a194db7c1ee56f2ebcbd8300 in ofbiz-framework's branch 
refs/heads/trunk from Nicolas Malin
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=43b44f5 ]

Improved: Convert ProductContentServices.xml mini lang to groovy
(OFBIZ-11436)

Thanks to Sebastian Berg for providing the patch


> Convert ProductContentServices.xml mini lang to groovy
> --
>
> Key: OFBIZ-11436
> URL: https://issues.apache.org/jira/browse/OFBIZ-11436
> Project: OFBiz
>  Issue Type: Sub-task
>  Components: product
>Affects Versions: Trunk
>Reporter: Sebastian Berg
>Assignee: Sebastian Berg
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: 
> OFBIZ-11436-ProductContentServices.xml-minilang-to-groovy.patch, 
> OFBIZ-11436-ProductContentServices.xml-minilang-to-groovy.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-11436) Convert ProductContentServices.xml mini lang to groovy

2020-03-09 Thread Sebastian Berg (Jira)


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

Sebastian Berg commented on OFBIZ-11436:


Thanks [~nmalin] for the feedback. I updated the patch accordingly.

> Convert ProductContentServices.xml mini lang to groovy
> --
>
> Key: OFBIZ-11436
> URL: https://issues.apache.org/jira/browse/OFBIZ-11436
> Project: OFBiz
>  Issue Type: Sub-task
>  Components: product
>Affects Versions: Trunk
>Reporter: Sebastian Berg
>Assignee: Sebastian Berg
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: 
> OFBIZ-11436-ProductContentServices.xml-minilang-to-groovy.patch, 
> OFBIZ-11436-ProductContentServices.xml-minilang-to-groovy.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-11436) Convert ProductContentServices.xml mini lang to groovy

2020-03-05 Thread Nicolas Malin (Jira)


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

Nicolas Malin commented on OFBIZ-11436:
---

Thanks [~sberg] for you patch, my remarks :
{code:java}
UtilValidate.is[Not]Empty{code}
are useless :
 * 'if (UtilValidate.isNotEmpty(parameters.metaDescription)) {' == 'if 
(parameters.metaDescription) {'
 * 'if (UtilValidate.isEmpty(updateProductPromoContentMap.thruDate)) {' == 'if 
(!updateProductPromoContentMap.thruDate) {'

 

 
{code:java}
  Map updateContent = parameters
 run service:"updateContent", with: updateContent
{code}
 
 * You can write directly 'run service:"updateContent", with: parameters'

 
{code:java}
.where([dataResourceId: productContent.dataResourceId]){code}
 * [ ] are useless you can also do : .where(dataResourceId: 
productContent.dataResourceId)

 
{code:java}
productContents = from("ProductContentAndInfo").where([productId: 
parameters.productId, productContentTypeId: "PAGE_TITLE"]).queryList()
if (UtilValidate.isNotEmpty(productContents)) {
GenericValue productContent = productContents.get(0){code}
You can replace by a direct GenericValue resolution :

 
{code:java}
GenericValue productContent = from("ProductContentAndInfo").where(productId: 
parameters.productId, productContentTypeId: "PAGE_TITLE").queryFirst()
if (productContent) { ...{code}

> Convert ProductContentServices.xml mini lang to groovy
> --
>
> Key: OFBIZ-11436
> URL: https://issues.apache.org/jira/browse/OFBIZ-11436
> Project: OFBiz
>  Issue Type: Sub-task
>  Components: product
>Affects Versions: Trunk
>Reporter: Sebastian Berg
>Assignee: Sebastian Berg
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: 
> OFBIZ-11436-ProductContentServices.xml-minilang-to-groovy.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)