From notifications-return-16082-archive-asf-public=cust-asf.ponee.io@ofbiz.apache.org Thu Jan 18 21:50:08 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 18ADA180654 for ; Thu, 18 Jan 2018 21:50:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 08585160C2B; Thu, 18 Jan 2018 20:50:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4F533160C26 for ; Thu, 18 Jan 2018 21:50:07 +0100 (CET) Received: (qmail 40368 invoked by uid 500); 18 Jan 2018 20:50:06 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 40359 invoked by uid 99); 18 Jan 2018 20:50:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2018 20:50:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CC6ED1A7422 for ; Thu, 18 Jan 2018 20:50:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.711 X-Spam-Level: X-Spam-Status: No, score=-100.711 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id alUWR3vrArpe for ; Thu, 18 Jan 2018 20:50:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A89885F58C for ; Thu, 18 Jan 2018 20:50:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id ED79DE00A3 for ; Thu, 18 Jan 2018 20:50:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id DD79921312 for ; Thu, 18 Jan 2018 20:50:00 +0000 (UTC) Date: Thu, 18 Jan 2018 20:50:00 +0000 (UTC) From: "Nicolas Malin (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OFBIZ-10031) Convert CategoryServices.xml mini lang to groovy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OFBIZ-10031?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D163= 31203#comment-16331203 ]=20 Nicolas Malin commented on OFBIZ-10031: --------------------------------------- Hi Dennis, nice staff After a first review, I seem we can improve some following code : {code:java} =C2=A0GenericValue lookedUpValue =3D delegator.makeValidValue("ProductCateg= ory", parameters) lookedUpValue =3D from("ProductCategory") .where(lookedUpValue.getFields(lookedUpValue.getModelEntity().getPkFieldNam= es())) .queryOne(){code} by=20 {code:java}lookedUpValue =3D from("ProductCategory").where(parameters).quer= yOne(){code} ---- {code:java} GenericValue newEntity =3D delegator.makeValidValue("ProductCategoryRol= e", parameters){code} by{code:java} GenericValue newEntity =3D makeValue("ProductCategoryRole", parameters) {code} ---- {code:java} Map callCreateProductMap =3D dispatcher.dispatchContext.makeValidContext("c= reateProduct", ModelService.IN_PARAM, parameters) if (!callCreateProductMap.productTypeId) { callCreateProductMap.productTypeId =3D "FINISHED_GOOD" } Map cPRes =3D run service: "createProduct", with: callCreateProductMap{= code} by {code:java}if (!callCreateProductMap.parameters) { parameters.productTypeId =3D "FINISHED_GOOD" } Map cPRes =3D run service: "createProduct", with: parameters{code} ---- I will check if we can improve the groovy context to simplify this {code:ja= va}Security security =3D dispatcher.dispatchContext.security{code} > Convert CategoryServices.xml mini lang to groovy > ------------------------------------------------ > > Key: OFBIZ-10031 > URL: https://issues.apache.org/jira/browse/OFBIZ-10031 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: Trunk > Reporter: Dennis Balkir > Assignee: Nicolas Malin > Priority: Minor > Attachments: OFBIZ-10031_org.apache.ofbiz.product.category.Catego= ryServices_convert.patch > > > Migration of the CategoryServices.xml to Groovy -- This message was sent by Atlassian JIRA (v7.6.3#76005)