[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17097912#comment-17097912 ] ASF subversion and git services commented on OFBIZ-11402: - Commit 45535e34cb6b2308960fb0e16d6731068225f773 in ofbiz-framework's branch refs/heads/release17.12 from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=45535e3 ] Fixed: PartyProfileContent.js does not work (OFBIZ-11633) When you upload a content from the party profile page you don't see a progress bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong Mohammad Kathawala mentionned that it was removed with OFBIZ-9299 It was also broken with OFBIZ-11402 Thanks: Mohammad for the track Conflicts handled by hand applications/party/template/party/profileblocks/Content.ftl framework/common/groovyScripts/CommonServices.groovy > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Nicolas Malin >Priority: Minor > Labels: groovy, mini-lang, refactoring > Fix For: Upcoming Branch > > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17097918#comment-17097918 ] ASF subversion and git services commented on OFBIZ-11402: - Commit f2191b2115b521e77557f97f1b7c42bfbea0f50b in ofbiz-framework's branch refs/heads/release18.12 from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=f2191b2 ] Fixed: PartyProfileContent.js does not work (OFBIZ-11633) When you upload a content from the party profile page you don't see a progress bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong Mohammad Kathawala mentionned that it was removed with OFBIZ-9299 It was also broken with OFBIZ-11402 Thanks: Mohammad for the track Conflicts removed framework/common/groovyScripts/CommonServices.groovy > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Nicolas Malin >Priority: Minor > Labels: groovy, mini-lang, refactoring > Fix For: Upcoming Branch > > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17097857#comment-17097857 ] ASF subversion and git services commented on OFBIZ-11402: - Commit 1efaa73ebb4fe3d5dc1f95ae9a5f985226fe8238 in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=1efaa73 ] Fixed: PartyProfileContent.js does not work (OFBIZ-11633) When you upload a content from the party profile page you don't see a progress bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong Mohammad Kathawala mentionned that it was removed with OFBIZ-9299 It was also broken with OFBIZ-11402 Thanks: Mohammad for the track > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Nicolas Malin >Priority: Minor > Labels: groovy, mini-lang, refactoring > Fix For: Upcoming Branch > > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17083129#comment-17083129 ] ASF subversion and git services commented on OFBIZ-11402: - Commit e0c8a1f4b0374a490d6dcebb79650106c45719c8 in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=e0c8a1f ] Fixed: 'FindJob' generates an error (OFBIZ-11590) This is due to OFBIZ-11402. Handling a converter for java.time.ZoneRegion is complicated. Adding a toString() is enough. Also 2 automated formatting while at it... > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Nicolas Malin >Priority: Minor > Labels: groovy, mini-lang, refactoring > Fix For: Upcoming Branch > > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17055935#comment-17055935 ] ASF subversion and git services commented on OFBIZ-11402: - Commit 930f4af7a223ed210415b43c04134008d41c1a82 in ofbiz-framework's branch refs/heads/trunk from Nicolas Malin [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=930f4af ] Improved: Convert CommonServices.xml from mini lang to groovy (OFBIZ-11402) Thanks to Wiebke Pätzold for providing the patch > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Nicolas Malin >Priority: Minor > Labels: groovy, mini-lang, refactoring > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17055740#comment-17055740 ] Wiebke Pätzold commented on OFBIZ-11402: Thanks [~nmalin] for your remarks. I updated the patch accordingly. > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Wiebke Pätzold >Priority: Minor > Labels: groovy, mini-lang, refactoring > Attachments: OFBIZ-11402.patch, OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17051902#comment-17051902 ] Nicolas Malin commented on OFBIZ-11402: --- Thanks [~wpaetzold] , my remarks : {code:java} UtilValidate.is[Not]Empty{code} are useless : * 'if (UtilValidate.isNotEmpty(parameters.purposeEnumId)) {' == 'if (parameters.purposeEnumId) {' * 'if (UtilValidate.isEmpty(parameters.defaultRoundingMode {' == 'if (!parameters.defaultRoundingMode) {' {code:java}if(parameters.uomId.equals(parameters.uomIdTo)){code} * can be replace by if '(parameters.uomId == parameters.uomIdTo)', .equals is useless in groovy {code:java} List uomConversions = from("UomConversionDated").where(condition).orderBy("-fromDate").cache().queryList() uomConversion = uomConversions.get(0) {code} * you can do : uomConversion = from("UomConversionDated").where(condition).orderBy("-fromDate").cache().queryFirst() {code:java} logVerbose("Uom conversion of ["+ parameters.originalValue + "] from ["+ parameters.uomId +"] to ["+ parameters.uomIdTo +"] using conversion factor ["+ uomConversion.conversionFactor +"], result is ["+ convertedValue +"]") {code} * You can GString to help readability {code:java} List geoAssoc = from("GeoAssoc") .where(geoId: parameters.geoId, geoAssocTypeId: parameters.geoAssocTypeId) .queryList() ... for (GenericValue geo : geoAssoc){ geoList << geo.geoIdTo } {code} * You can go fast : geoList = from("GeoAssoc").where(geoId: parameters.geoId, geoAssocTypeId: parameters.geoAssocTypeId).getFieldList('geoIdTo') {code:java} GenericValue uomConversion = from("UomConversion") .where(uomId: parameters.uomId, uomIdTo: parameters.uomIdTo) .queryOne() if (UtilValidate.isNotEmpty(uomConversion)){ exist = true } else { exist = false } result.exist = exist {code} * :) result.exist = from("UomConversion").where(uomId: parameters.uomId, uomIdTo: parameters.uomIdTo).queryCount() == 1 {code:java} EntityCondition condition = EntityCondition.makeCondition([ EntityCondition.makeCondition("uomId", parameters.uomId), EntityCondition.makeCondition("uomIdTo", parameters.uomIdTo) ]) if (UtilValidate.isNotEmpty(parameters.purposeEnumId)){ condition = EntityCondition.makeCondition([ EntityCondition.makeCondition("purposeEnumId", parameters.purposeEnumId), condition ]) } {code} * you can use directly a Map, EntityCondition is useless {code:java} if(UtilValidate.isNotEmpty(uomConversion.roundingMode)){ roundingMode = uomConversion.roundingMode } else { roundingMode = parameters.defaultRoundingMode } {code} * you can do: roundingMode = uomConversion.roundingMode ?: parameters.defaultRoundingMode > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Wiebke Pätzold >Priority: Minor > Labels: groovy, mini-lang, refactoring > Attachments: OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-11402) Convert CommonServices.xml from mini lang to groovy
[ https://issues.apache.org/jira/browse/OFBIZ-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17051398#comment-17051398 ] Wiebke Pätzold commented on OFBIZ-11402: I converted the remaining services from mini lang to Groovy. > Convert CommonServices.xml from mini lang to groovy > --- > > Key: OFBIZ-11402 > URL: https://issues.apache.org/jira/browse/OFBIZ-11402 > Project: OFBiz > Issue Type: Sub-task > Components: framework >Affects Versions: Trunk >Reporter: Michael Brohl >Assignee: Wiebke Pätzold >Priority: Minor > Labels: groovy, mini-lang, refactoring > Attachments: OFBIZ-11402.patch > > > With the work on OFBIZ-11291 and OFBIZ-11357 parts of CommonServices.xml were > converted to Groovy. We should convert the whole into Groovy now. -- This message was sent by Atlassian Jira (v8.3.4#803005)