Author: jacopoc
Date: Fri Jul 8 17:37:36 2016 New Revision: 1751945 URL: http://svn.apache.org/viewvc?rev=1751945&view=rev Log: OFBIZ-7765 converted Minilang code that was using the deprecated "call-bsh" element to use the "script" element with Groovy. Thanks to Deepak Dixit for the work and the patch and to Nicolas Malin for the review and imporvement. Modified: ofbiz/trunk/applications/accounting/minilang/tax/TaxAuthorityServices.xml ofbiz/trunk/applications/accounting/minilang/test/InvoicePerShipmentTests.xml ofbiz/trunk/applications/commonext/minilang/setup/SetupEvents.xml ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml ofbiz/trunk/applications/order/minilang/order/OrderServices.xml ofbiz/trunk/applications/order/minilang/test/ShoppingCartTests.xml ofbiz/trunk/applications/party/minilang/customer/CustomerEvents.xml ofbiz/trunk/applications/party/minilang/user/UserEvents.xml ofbiz/trunk/applications/product/minilang/product/inventory/InventoryReserveServices.xml ofbiz/trunk/applications/product/minilang/product/test/GroupOrderTest.xml ofbiz/trunk/applications/product/minilang/product/test/ProductTagTest.xml ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml ofbiz/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml ofbiz/trunk/framework/common/minilang/CommonServices.xml ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/CustomerEvents.xml ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/QuickAnonCustomerEvents.xml ofbiz/trunk/specialpurpose/scrum/minilang/ScrumEvents.xml ofbiz/trunk/specialpurpose/webpos/minilang/CartEvents.xml Modified: ofbiz/trunk/applications/accounting/minilang/tax/TaxAuthorityServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/tax/TaxAuthorityServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/minilang/tax/TaxAuthorityServices.xml (original) +++ ofbiz/trunk/applications/accounting/minilang/tax/TaxAuthorityServices.xml Fri Jul 8 17:37:36 2016 @@ -84,11 +84,11 @@ under the License. </simple-method> <simple-method method-name="createCustomerTaxAuthInfo" short-description="Create a Customer PartyTaxAuthInfo"> - <call-bsh><![CDATA[ + <script>groovy: taxAuthPartyGeoIds = parameters.get("taxAuthPartyGeoIds"); parameters.put("taxAuthPartyId", taxAuthPartyGeoIds.substring(0, taxAuthPartyGeoIds.indexOf("::"))); parameters.put("taxAuthGeoId", taxAuthPartyGeoIds.substring(taxAuthPartyGeoIds.indexOf("::") + 2)); - ]]></call-bsh> + </script> <set-service-fields service-name="createPartyTaxAuthInfo" map="parameters" to-map="createPartyTaxAuthInfoMap"/> <call-service service-name="createPartyTaxAuthInfo" in-map-name="createPartyTaxAuthInfoMap" include-user-login="true"/> </simple-method> Modified: ofbiz/trunk/applications/accounting/minilang/test/InvoicePerShipmentTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/InvoicePerShipmentTests.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/minilang/test/InvoicePerShipmentTests.xml (original) +++ ofbiz/trunk/applications/accounting/minilang/test/InvoicePerShipmentTests.xml Fri Jul 8 17:37:36 2016 @@ -29,10 +29,10 @@ under the License. Step 4) Check invoice should not created. --> <!-- Step 1 --> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.base.util.UtilProperties; UtilProperties.setPropertyValueInMemory("accounting", "create.invoice.per.shipment", "N"); - ]]></call-bsh> + </script> <log level="info" message="===== >>> Set Accounting.properties / create.invoice.per.shipment = N"/> <!-- Step 2 --> <field-to-session field="nullField" session-name="orderMode"/> @@ -46,14 +46,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -64,22 +64,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-1000"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_COD"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> @@ -109,13 +109,13 @@ under the License. </entity-condition> <first-from-list entry="orderHeader" list="orderHeaders"/> <log level="info" message="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : ${orderHeader}"/> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.shipment.packing.PackingSession; packingSession = new PackingSession(dispatcher, userLogin); packingSession.setPrimaryOrderId(orderHeader.get("orderId")); packingSession.setPrimaryShipGroupSeqId("00001"); parameters.put("packingSession", packingSession); - ]]></call-bsh> + </script> <set field="packInput.orderId" from-field="orderHeader.orderId"/> <set field="packInput.shipGroupSeqId" value="00001"/> <set field="packInput.packingSession" from-field="parameters.packingSession"/> @@ -156,10 +156,10 @@ under the License. Step 4) Check invoice should created. --> <!-- Step 1 --> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.base.util.UtilProperties; UtilProperties.setPropertyValueInMemory("accounting", "create.invoice.per.shipment", "Y"); - ]]></call-bsh> + </script> <log level="info" message="===== >>> Set Accounting.properties / create.invoice.per.shipment = Y"/> <!-- Step 2 --> <field-to-session field="nullField" session-name="orderMode"/> @@ -173,14 +173,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -191,22 +191,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-1000"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_COD"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> @@ -235,13 +235,13 @@ under the License. <order-by field-name="-entryDate"/> </entity-condition> <first-from-list entry="orderHeader" list="orderHeaders"/> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.shipment.packing.PackingSession; packingSession = new PackingSession(dispatcher, userLogin); packingSession.setPrimaryOrderId(orderHeader.get("orderId")); packingSession.setPrimaryShipGroupSeqId("00001"); parameters.put("packingSession", packingSession); - ]]></call-bsh> + </script> <set field="packInput.orderId" from-field="orderHeader.orderId"/> <set field="packInput.shipGroupSeqId" value="00001"/> <set field="packInput.packingSession" from-field="parameters.packingSession"/> @@ -291,14 +291,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -309,22 +309,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-2644"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_COD"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> @@ -360,13 +360,13 @@ under the License. </call-service> <log level="info" message="===== >>> Service : updateOrderHeader / invoicePerShipment = N, Response = ${responseMessage}"/> <!-- Step 2 --> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.shipment.packing.PackingSession; packingSession = new PackingSession(dispatcher, userLogin); packingSession.setPrimaryOrderId(orderHeader.get("orderId")); packingSession.setPrimaryShipGroupSeqId("00001"); parameters.put("packingSession", packingSession); - ]]></call-bsh> + </script> <set field="packInput.orderId" from-field="orderHeader.orderId"/> <set field="packInput.shipGroupSeqId" value="00001"/> <set field="packInput.packingSession" from-field="parameters.packingSession"/> @@ -416,14 +416,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -434,22 +434,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-2644"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response = ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_COD"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> @@ -485,13 +485,13 @@ under the License. </call-service> <log level="info" message="===== >>> Service : updateOrderHeader / invoicePerShipment = Y, Response = ${responseMessage}"/> <!-- Step 2 --> - <call-bsh><![CDATA[ + <script>groovy: import org.ofbiz.shipment.packing.PackingSession; packingSession = new PackingSession(dispatcher, userLogin); packingSession.setPrimaryOrderId(orderHeader.get("orderId")); packingSession.setPrimaryShipGroupSeqId("00001"); parameters.put("packingSession", packingSession); - ]]></call-bsh> + </script> <set field="packInput.orderId" from-field="orderHeader.orderId"/> <set field="packInput.shipGroupSeqId" value="00001"/> <set field="packInput.packingSession" from-field="parameters.packingSession"/> Modified: ofbiz/trunk/applications/commonext/minilang/setup/SetupEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/minilang/setup/SetupEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/commonext/minilang/setup/SetupEvents.xml (original) +++ ofbiz/trunk/applications/commonext/minilang/setup/SetupEvents.xml Fri Jul 8 17:37:36 2016 @@ -287,14 +287,14 @@ </call-service> <entity-one entity-name="PartyGroup" value-field="partyGroup"/> - <call-bsh><![CDATA[ + <script>groovy: groupName = partyGroup.get("groupName"); if(groupName != null){ parameters.put("invoiceIdPrefix", groupName.toUpperCase().substring(0, 2)+"CI"); }else{ parameters.put("invoiceIdPrefix", "CI"); } - ]]></call-bsh> + </script> <set field="acctgPreferenceCtx.partyId" from-field="partyId"/> <set field="acctgPreferenceCtx.taxFormId" value="US_IRS_1120"/> Modified: ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml (original) +++ ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml Fri Jul 8 17:37:36 2016 @@ -292,7 +292,7 @@ under the License. <if> <condition><if-compare field="newEntity.statusId" operator="equals" value="CLPT_PENDING"/></condition> <then> - <call-bsh><![CDATA[newEntity.set("optInVerifyCode", Long.toString(Math.round(9999999999L * Math.random())))]]></call-bsh> + <script>groovy:newEntity.set("optInVerifyCode", Long.toString(Math.round(9999999999L * Math.random())))</script> </then> <else-if> <condition><if-compare field="newEntity.statusId" operator="equals" value="CLPT_ACCEPTED"/></condition> Modified: ofbiz/trunk/applications/order/minilang/order/OrderServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/order/OrderServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/order/minilang/order/OrderServices.xml (original) +++ ofbiz/trunk/applications/order/minilang/order/OrderServices.xml Fri Jul 8 17:37:36 2016 @@ -38,12 +38,12 @@ under the License. <if-not-empty field="monthsToInclude"> <now-timestamp field="nowTimestamp"/> <!-- TODO: Change this to use the <set-calendar> operation --> - <call-bsh><![CDATA[ + <script>groovy: calendar = com.ibm.icu.util.Calendar.getInstance(); calendar.setTimeInMillis(nowTimestamp.getTime()); calendar.add(com.ibm.icu.util.Calendar.MONTH, -monthsToInclude.intValue()); parameters.put("fromDate", new Timestamp(calendar.getTimeInMillis())); - ]]></call-bsh> + </script> <set from-field="nowTimestamp" field="parameters.thruDate"/> </if-not-empty> @@ -728,7 +728,7 @@ under the License. <!-- splitting shipmentMethod request parameter value that contains "@" symbol into "shipmentMethodTypeId", "carrierPartyId" and "carrierRoleTypeId". --> - <call-bsh><![CDATA[ + <script>groovy: shipmentMethod = parameters.get("shipmentMethod"); if(shipmentMethod != null){ arr = shipmentMethod.split( "@" ); @@ -736,7 +736,7 @@ under the License. parameters.put("carrierPartyId", arr[1]); parameters.put("carrierRoleTypeId", arr[2]); } - ]]></call-bsh> + </script> <set-nonpk-fields map="parameters" value-field="lookedUpValue"/> <set from-field="parameters.orderId" field="inputMap.orderId"/> @@ -1282,15 +1282,15 @@ under the License. <!-- shipmentMethod request parameter value contains "@" symbol between "shipmentMethodTypeId" and "carrierPartyId".This will be splitted in updateOrderItemShipGroup method --> - - <call-bsh><![CDATA[ + + <script>groovy: shipmentMethodAndAmount = parameters.get("shipmentMethodAndAmount"); if (shipmentMethodAndAmount != null) { parameters.put("shipmentMethod", shipmentMethodAndAmount.substring(0, shipmentMethodAndAmount.indexOf("*"))); parameters.put("amount", shipmentMethodAndAmount.substring(shipmentMethodAndAmount.indexOf("*")+1)); parameters.put("shipmentMethodTypeId", shipmentMethodAndAmount.substring(0, shipmentMethodAndAmount.indexOf("@"))); } - ]]></call-bsh> + </script> <set field="newAmount" from-field="parameters.amount" type="BigDecimal"/> <set field="shippingAmount" from-field="parameters.shippingAmount" type="BigDecimal"/> <property-to-field field="percentAllowed" resource="shipment" property="shipment.default.cost_actual_over_estimated_percent_allowed"/> Modified: ofbiz/trunk/applications/order/minilang/test/ShoppingCartTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/test/ShoppingCartTests.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/order/minilang/test/ShoppingCartTests.xml (original) +++ ofbiz/trunk/applications/order/minilang/test/ShoppingCartTests.xml Fri Jul 8 17:37:36 2016 @@ -50,10 +50,10 @@ under the License. <set field="productStoreId" value="9000" type="String"/> <set field="currencyUom" value="USD" type="String"/> - <call-bsh><![CDATA[ + <script>groovy: shoppingCart = new org.ofbiz.order.shoppingcart.ShoppingCart(delegator, productStoreId, locale, currencyUom); parameters.put("shoppingCart", shoppingCart); - ]]></call-bsh> + </script> <set field="orderTypeId" value="SALES_ORDER" type="String"/> <set field="paymentMethodTypeId" value="CREDIT_CARD" type="String"/> @@ -260,11 +260,11 @@ under the License. <call-object-method method-name="makeAllShipGroupInfos" obj-field="shoppingCart"/> <!-- Shopping Cart checkout and create order --> - <call-bsh><![CDATA[ + <script>groovy: checkOutHelper = new org.ofbiz.order.shoppingcart.CheckOutHelper(dispatcher, delegator, shoppingCart); java.util.Map orderMap = checkOutHelper.createOrder(userLogin); - parameters.put("orderMap", orderMap);]]> - </call-bsh> + parameters.put("orderMap", orderMap); + </script> <!-- Clear Shopping Cart --> <call-object-method method-name="clear" obj-field="shoppingCart"/> @@ -621,10 +621,10 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="DemoCustomer"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> Modified: ofbiz/trunk/applications/party/minilang/customer/CustomerEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/minilang/customer/CustomerEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/party/minilang/customer/CustomerEvents.xml (original) +++ ofbiz/trunk/applications/party/minilang/customer/CustomerEvents.xml Fri Jul 8 17:37:36 2016 @@ -76,12 +76,12 @@ under the License. <set field="newUserLogin.passwordHint" from-field="userLoginContext.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginContext.get("currentPassword"); String confirmPassword = (String) userLoginContext.get("currentPasswordVerify"); String passwordHint = (String) userLoginContext.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <!-- Create the Person --> <call-map-processor in-map-name="parameters" out-map-name="personContext"> Modified: ofbiz/trunk/applications/party/minilang/user/UserEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/minilang/user/UserEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/party/minilang/user/UserEvents.xml (original) +++ ofbiz/trunk/applications/party/minilang/user/UserEvents.xml Fri Jul 8 17:37:36 2016 @@ -107,12 +107,12 @@ under the License. <set field="newUserLogin.passwordHint" from-field="userLoginContext.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginContext.get("currentPassword"); String confirmPassword = (String) userLoginContext.get("currentPasswordVerify"); String passwordHint = (String) userLoginContext.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <else> <if-compare field="require_login" operator="equals" value="true"> <add-error><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></add-error> @@ -313,10 +313,10 @@ under the License. <if-not-empty field="newUserLogin"> <!-- If password encryption is enabled, encrpyt it now --> <set field="delegator" from-field="parameters.delegator" type="Object"/> - <call-bsh><![CDATA[ + <script>groovy: boolean useEncryption = "true".equals(org.ofbiz.entity.util.EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator)); if (useEncryption) { newUserLogin.set("currentPassword", org.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))); } - ]]></call-bsh> + </script> <!-- create the UserLogin manually to get around ordering and security constraints in the service --> <set field="newUserLogin.partyId" from-field="tempMap.partyId"/> Modified: ofbiz/trunk/applications/product/minilang/product/inventory/InventoryReserveServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/inventory/InventoryReserveServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/product/minilang/product/inventory/InventoryReserveServices.xml (original) +++ ofbiz/trunk/applications/product/minilang/product/inventory/InventoryReserveServices.xml Fri Jul 8 17:37:36 2016 @@ -194,13 +194,13 @@ under the License. </if-not-empty> </if-empty> <!-- TODO: Convert this to a <set-calendar> operation --> - <call-bsh><![CDATA[ + <script>groovy: java.sql.Timestamp orderDate = orderHeader.getTimestamp("orderDate"); com.ibm.icu.util.Calendar cal = com.ibm.icu.util.Calendar.getInstance(); cal.setTimeInMillis(orderDate.getTime()); cal.add(com.ibm.icu.util.Calendar.DAY_OF_YEAR, daysToShip.intValue()); return org.ofbiz.base.util.UtilMisc.toMap("promisedDatetime", new java.sql.Timestamp(cal.getTimeInMillis())); - ]]></call-bsh> + </script> <!-- create or update OrderItemShipGrpInvRes record --> <set from-field="parameters.orderId" field="reserveOisgirMap.orderId"/> @@ -262,13 +262,13 @@ under the License. </if-not-empty> </if-empty> <!-- TODO: Convert this to a <set-calendar> operation --> - <call-bsh><![CDATA[ + <script>groovy: java.sql.Timestamp orderDate = orderHeader.getTimestamp("orderDate"); com.ibm.icu.util.Calendar cal = com.ibm.icu.util.Calendar.getInstance(); cal.setTimeInMillis(orderDate.getTime()); cal.add(com.ibm.icu.util.Calendar.DAY_OF_YEAR, daysToShip.intValue()); return org.ofbiz.base.util.UtilMisc.toMap("promisedDatetime", new java.sql.Timestamp(cal.getTimeInMillis())); - ]]></call-bsh> + </script> <!-- create OrderItemShipGrpInvRes record --> <set from-field="parameters.orderId" field="reserveOisgirMap.orderId"/> @@ -504,13 +504,13 @@ under the License. <set field="daysToShip" value="30" type="Long"/> </if-empty> <!-- TODO: Convert this to a <set-calendar> operation --> - <call-bsh><![CDATA[ + <script>groovy: java.sql.Timestamp orderDate = orderHeader.getTimestamp("orderDate"); com.ibm.icu.util.Calendar cal = com.ibm.icu.util.Calendar.getInstance(); cal.setTimeInMillis(orderDate.getTime()); cal.add(com.ibm.icu.util.Calendar.DAY_OF_YEAR, daysToShip.intValue()); return org.ofbiz.base.util.UtilMisc.toMap("promisedDatetime", new java.sql.Timestamp(cal.getTimeInMillis())); - ]]></call-bsh> + </script> </simple-method> <simple-method method-name="reserveOrderItemInventory" short-description="Reserve Order Item Inventory"> Modified: ofbiz/trunk/applications/product/minilang/product/test/GroupOrderTest.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/test/GroupOrderTest.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/product/minilang/product/test/GroupOrderTest.xml (original) +++ ofbiz/trunk/applications/product/minilang/product/test/GroupOrderTest.xml Fri Jul 8 17:37:36 2016 @@ -61,14 +61,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -79,22 +79,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-1000"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_PAYPAL"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> @@ -183,14 +183,14 @@ under the License. <entity-one value-field="userLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="admin"/> </entity-one> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("orderMode", "SALES_ORDER"); request.setParameter("productStoreId", "9000"); request.setParameter("partyId", "DemoCustomer"); request.setParameter("currencyUom", "USD"); session = request.getSession(); session.setAttribute("userLogin", userLogin); - ]]></call-bsh> + </script> <call-class-method method-name="initializeOrderEntry" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -201,22 +201,22 @@ under the License. <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : setOrderCurrencyAgreementShipDates, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("add_product_id", "GZ-1001"); - ]]></call-bsh> + </script> <call-class-method method-name="addToCart" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> </call-class-method> <log level="info" message="===== >>> Event : addToCart, Response : ${result}"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("checkoutpage", "quick"); request.setParameter("shipping_contact_mech_id", "9015"); request.setParameter("shipping_method", "GROUND@UPS"); request.setParameter("checkOutPaymentId", "EXT_PAYPAL"); request.setParameter("is_gift", "false"); request.setParameter("may_split", "false"); - ]]></call-bsh> + </script> <field-to-request field="nullField" request-name="shoppingCart"/> <call-class-method method-name="setQuickCheckOutOptions" class-name="org.ofbiz.order.shoppingcart.CheckOutEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> Modified: ofbiz/trunk/applications/product/minilang/product/test/ProductTagTest.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/test/ProductTagTest.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/product/minilang/product/test/ProductTagTest.xml (original) +++ ofbiz/trunk/applications/product/minilang/product/test/ProductTagTest.xml Fri Jul 8 17:37:36 2016 @@ -37,10 +37,10 @@ under the License. <field-map field-name="userLoginId" value="system"/> </entity-one> <set field="request" from-field="parameters.request"/> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("productId", "GZ-1000"); request.setParameter("productTags", "test"); - ]]></call-bsh> + </script> <call-class-method method-name="addProductTags" class-name="org.ofbiz.product.product.ProductEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> @@ -74,10 +74,10 @@ under the License. <if-compare field="checkProductKeywordApprove.statusId" operator="equals" value="KW_APPROVED"/> </assert> <!-- Step 5 --> - <call-bsh><![CDATA[ + <script>groovy: request.setParameter("productId", "GZ-1000"); request.setParameter("productTags", "'rock and roll' t-shirt red"); - ]]></call-bsh> + </script> <call-class-method method-name="addProductTags" class-name="org.ofbiz.product.product.ProductEvents" ret-field="result"> <field field="request" type="javax.servlet.http.HttpServletRequest"/> <field field="response" type="javax.servlet.http.HttpServletResponse"/> Modified: ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml (original) +++ ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml Fri Jul 8 17:37:36 2016 @@ -1304,22 +1304,10 @@ under the License. </entity-one> <set field="productByProductIdMap[productId]" from-field="productValueTemp"/> - <!-- - <call-bsh><![CDATA[ - org.ofbiz.base.util.Debug.log("Added " + productId + " to product by product Map, now: " + productByProductIdMap.size()); - ]]></call-bsh> - --> - <clear-field field="picklistItemInfoTempList"/> <set field="picklistItemInfoTempList" from-field="picklistItemInfoListByProductIdMap[productId]"/> <set field="picklistItemInfoTempList[]" from-field="picklistItemInfo"/> <set field="picklistItemInfoListByProductIdMap[productId]" from-field="picklistItemInfoTempList"/> - - <!-- - <call-bsh><![CDATA[ - org.ofbiz.base.util.Debug.log("Added " + productId + " to pick item info list, now: " + picklistItemInfoListByProductIdMap.size()); - ]]></call-bsh> - --> <else> <!-- Uh oh, no productId, how did this happen? --> <log level="warning" message="No productId and no FacilityLocation, not showing in Picklist for PicklistItem: ${picklistItemInfo.picklistItem}"/> Modified: ofbiz/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml (original) +++ ofbiz/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml Fri Jul 8 17:37:36 2016 @@ -639,7 +639,7 @@ under the License. </if-not-empty> <if-empty field="shipment.estimatedShipCost"> - <call-bsh><![CDATA[ + <script>groovy: import java.math.BigDecimal; import org.ofbiz.order.order.OrderReadHelper; @@ -653,7 +653,7 @@ under the License. shippingAmount = shippingAmount.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, false, true)); //org.ofbiz.base.util.Debug.log("shippingAmmount=" + shippingAmount); shipment.put("estimatedShipCost", shippingAmount); - ]]></call-bsh> + </script> </if-empty> <!-- create a ShipmentRouteSegment with originFacilityId (if set on Shipment), destContactMechId, @@ -699,46 +699,46 @@ under the License. <string-to-list string="-fromDate" list="descendingFromDateOrder"/> <if-not-empty field="shipment.originFacilityId"> <if-empty field="shipment.originContactMechId"> - <call-bsh><![CDATA[ + <script>groovy: facilityContactMech = org.ofbiz.party.contact.ContactMechWorker.getFacilityContactMechByPurpose( delegator, shipment.get("originFacilityId"), org.ofbiz.base.util.UtilMisc.toList("SHIP_ORIG_LOCATION", "PRIMARY_LOCATION") ); if (facilityContactMech != null) { shipment.put("originContactMechId", facilityContactMech.get("contactMechId")); } - ]]></call-bsh> + </script> </if-empty> <if-empty field="shipment.originTelecomNumberId"> - <call-bsh><![CDATA[ + <script>groovy: facilityContactMech = org.ofbiz.party.contact.ContactMechWorker.getFacilityContactMechByPurpose( delegator, shipment.get("originFacilityId"), org.ofbiz.base.util.UtilMisc.toList("PHONE_SHIP_ORIG", "PRIMARY_PHONE") ); if (facilityContactMech != null) { shipment.put("originTelecomNumberId", facilityContactMech.get("contactMechId")); } - ]]></call-bsh> + </script> </if-empty> </if-not-empty> <if-not-empty field="shipment.destinationFacilityId"> <if-empty field="shipment.destinationContactMechId"> - <call-bsh><![CDATA[ + <script>groovy: facilityContactMech = org.ofbiz.party.contact.ContactMechWorker.getFacilityContactMechByPurpose( delegator, shipment.get("destinationFacilityId"), org.ofbiz.base.util.UtilMisc.toList("SHIPPING_LOCATION", "PRIMARY_LOCATION") ); if (facilityContactMech != null) { shipment.put("destinationContactMechId", facilityContactMech.get("contactMechId")); } - ]]></call-bsh> + </script> </if-empty> <if-empty field="shipment.destinationTelecomNumberId"> - <call-bsh><![CDATA[ + <script>groovy: facilityContactMech = org.ofbiz.party.contact.ContactMechWorker.getFacilityContactMechByPurpose( delegator, shipment.get("destinationFacilityId"), org.ofbiz.base.util.UtilMisc.toList("PHONE_SHIPPING", "PRIMARY_PHONE") ); if (facilityContactMech != null) { shipment.put("destinationTelecomNumberId", facilityContactMech.get("contactMechId")); } - ]]></call-bsh> + </script> </if-empty> </if-not-empty> Modified: ofbiz/trunk/framework/common/minilang/CommonServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/minilang/CommonServices.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/framework/common/minilang/CommonServices.xml (original) +++ ofbiz/trunk/framework/common/minilang/CommonServices.xml Fri Jul 8 17:37:36 2016 @@ -192,12 +192,12 @@ under the License. <field-to-result field="parameters.bytesRead" result-name="bytesRead"/> <call-object-method obj-field="uploadProgressListener" method-name="hasStarted" ret-field="parameters.hasStarted"/> <field-to-result field="parameters.hasStarted" result-name="hasStarted"/> - <call-bsh><![CDATA[ + <script>groovy: contentLength = parameters.get("contentLength"); bytesRead = parameters.get("bytesRead"); int readPercent = (bytesRead* 100)/contentLength; parameters.put("readPercent", readPercent); - ]]></call-bsh> + </script> <field-to-result field="parameters.readPercent" result-name="readPercent"/> <field-to-result field="parameters.hasStarted" result-name="hasStarted"/> </if-not-empty> Modified: ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/CustomerEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/CustomerEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/CustomerEvents.xml (original) +++ ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/CustomerEvents.xml Fri Jul 8 17:37:36 2016 @@ -87,12 +87,12 @@ under the License. <set from-field="userLoginContext.passwordHint" field="newUserLogin.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginContext.get("currentPassword"); String confirmPassword = (String) userLoginContext.get("currentPasswordVerify"); String passwordHint = (String) userLoginContext.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <!-- Create the Person --> <call-map-processor in-map-name="parameters" out-map-name="personContext"> @@ -383,10 +383,10 @@ under the License. <set from-field="tempMap.partyId" field="personLookup.partyId"/> <find-by-primary-key map="personLookup" value-field="personVo" entity-name="Person"/> <if-empty field="parameters.CLUB_NUMBER"> - <call-bsh><![CDATA[ + <script>groovy: clubId = org.ofbiz.party.party.PartyWorker.createClubId(delegator, "999", 13); parameters.put("CLUB_NUMBER", clubId); - ]]></call-bsh> + </script> </if-empty> <set from-field="parameters.CLUB_NUMBER" field="personVo.memberId"/> <store-value value-field="personVo"/> @@ -394,7 +394,7 @@ under the License. <!-- now finished, log in the user and set the cart's partyId to that of the newly created customer ... --> <if-compare field="allowPassword" operator="equals" value="Y"> - <call-bsh><![CDATA[ + <script>groovy: org.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin, request); org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response); session = request.getSession(); @@ -402,7 +402,7 @@ under the License. if (cart != null) { cart.setOrderPartyId(tempMap.get("partyId")); } - ]]></call-bsh> + </script> </if-compare> <!-- Associated to Product Store --> @@ -482,14 +482,14 @@ under the License. </call-object-method> <check-errors/> <if-not-empty field="cart"> - <call-bsh><![CDATA[ + <script>groovy: // clear out the login fields from the cart try { if (cart!=null) cart.setAutoUserLogin(null, dispatcher); } catch (CartItemModifyException e) { Debug.logError(e, module); } - ]]></call-bsh> + </script> </if-not-empty> <set from-field="tempMap.partyId" field="partyId"/> <if-not-empty field="partyId"> @@ -502,14 +502,14 @@ under the License. <call-object-method obj-field="cart" method-name="setOrderPartyId"> <field field="partyId"/> </call-object-method> - <call-bsh><![CDATA[ + <script>groovy: // clear out the login fields from the cart try { if (cart!=null) cart.setUserLogin(userLogin, dispatcher); } catch (CartItemModifyException e) { Debug.logError(e, module); } - ]]></call-bsh> + </script> <!-- call-object-method obj-field="cart" method-name="setUserLogin"> <field field="userLogin" type="org.ofbiz.entity.GenericValue"/> <field field="dispatcher" map-name="request" type="org.ofbiz.service.LocalDispatcher"/> @@ -818,13 +818,13 @@ under the License. </simple-method> <simple-method method-name="processShipOptions" short-description="Process Ship Options; to be called as a Request Event" login-required="false"> - <call-bsh><![CDATA[ + <script>groovy: shipmentMethod = parameters.get("shipping_method"); if(shipmentMethod != null){ parameters.put("shipmentMethodTypeId", shipmentMethod.substring(0, shipmentMethod.indexOf("@"))); parameters.put("carrierPartyId", shipmentMethod.substring(shipmentMethod.indexOf("@")+1)); } - ]]></call-bsh> + </script> <session-to-field field="cart" session-name="shoppingCart"/> <if-not-empty field="cart"> <set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/> @@ -923,12 +923,12 @@ under the License. <set field="newUserLogin.currentPassword" from-field="userLoginMap.currentPassword"/> <set field="newUserLogin.passwordHint" from-field="userLoginMap.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginMap.get("currentPassword"); String confirmPassword = (String) userLoginMap.get("currentPasswordVerify"); String passwordHint = (String) userLoginMap.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <check-errors/> <set-service-fields service-name="createUserLogin" map="userLoginMap" to-map="userLoginCtx"/> @@ -942,12 +942,10 @@ under the License. </entity-one> <!-- now finished, log in the user and set the cart's partyId --> - <call-bsh> - <![CDATA[ + <script>groovy: org.ofbiz.webapp.control.LoginWorker.doBasicLogin(userLogin, request); org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response); - ]]> - </call-bsh> + </script> <set field="parameters.userLogin" from-field="userLogin"/> <else> <if> @@ -984,13 +982,11 @@ under the License. <if-empty field="shoppingCart"> <session-to-field field="shoppingCart"/> </if-empty> - <call-bsh> - <![CDATA[ + <script>groovy: import org.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper; shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0); parameters.put("shippingEstWpr", shippingEstWpr); - ]]> - </call-bsh> + </script> <set field="shippingEstWpr" from-field="parameters.shippingEstWpr"/> <call-object-method obj-field="shippingEstWpr" method-name="getShippingMethods" ret-field="carrierShipmentMethodList"/> <call-object-method obj-field="shoppingCart" method-name="getShipmentMethodTypeId" ret-field="shipmentMethodTypeId"/> @@ -1030,7 +1026,7 @@ under the License. </simple-method> <simple-method method-name="setShippingOption" short-description="Set shipping method" login-required="false"> - <call-bsh><![CDATA[ + <script>groovy: shippingMethod = parameters.get("shipMethod"); if(shippingMethod != null) { shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@")); @@ -1044,7 +1040,7 @@ under the License. parameters.put("shipmentMethodTypeId", shipmentMethodTypeId); parameters.put("carrierPartyId", carrierPartyId); } - ]]></call-bsh> + </script> <set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/> <set field="carrierPartyId" from-field="parameters.carrierPartyId"/> <set field="productStoreShipMethId" from-field="parameters.productStoreShipMethId"/> @@ -1077,7 +1073,7 @@ under the License. <set field="delegator" from-field="parameters.delegator" type="Object"/> <set field="locale" from-field="parameters.locale" type="Object"/> - <call-bsh><![CDATA[ + <script>groovy: Map shipCost = org.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0); shippingTotal = shipCost.get("shippingTotal"); if (shippingTotal == null) { @@ -1096,7 +1092,7 @@ under the License. cartGrandTotal = org.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale); parameters.put("cartGrandTotal", cartGrandTotal); - ]]></call-bsh> + </script> <call-class-method method-name="doPromotions" class-name="org.ofbiz.order.shoppingcart.product.ProductPromoWorker"> <field field="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/> <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/> @@ -1252,12 +1248,10 @@ under the License. <result-to-field result-name="newUserLogin"/> </call-service> <set-current-user-login value-field="newUserLogin"/> - <call-bsh> - <![CDATA[ + <script>groovy: org.ofbiz.webapp.control.LoginWorker.doBasicLogin(newUserLogin, request); org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response); - ]]> - </call-bsh> + </script> <!-- disabledDateTime/disableForYears set time until a user login remains disabled --> <if-not-empty field="parameters.disabledDateTime"> <set field="disabledDateTime" from-field="parameters.disabledDateTime" type="Date"/> Modified: ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/QuickAnonCustomerEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/QuickAnonCustomerEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/QuickAnonCustomerEvents.xml (original) +++ ofbiz/trunk/specialpurpose/ecommerce/minilang/customer/QuickAnonCustomerEvents.xml Fri Jul 8 17:37:36 2016 @@ -85,12 +85,12 @@ under the License. <set field="newUserLogin.passwordHint" from-field="userLoginContext.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginContext.get("currentPassword"); String confirmPassword = (String) userLoginContext.get("currentPasswordVerify"); String passwordHint = (String) userLoginContext.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <else> <if-compare field="require_login" operator="equals" value="true"> <add-error><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></add-error> @@ -348,10 +348,10 @@ under the License. <if-not-empty field="newUserLogin"> <!-- If password encryption is enabled, encrpyt it now --> - <call-bsh><![CDATA[ + <script>groovy: boolean useEncryption = "true".equals(org.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt")); if (useEncryption) { newUserLogin.set("currentPassword", org.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))); } - ]]></call-bsh> + </script> <!-- create the UserLogin manually to get around ordering and security constraints in the service --> <set field="userLoginContext.partyId" from-field="partyId"/> <create-value value-field="newUserLogin"/> @@ -504,14 +504,14 @@ under the License. </call-object-method> <check-errors/> <if-not-empty field="cart"> - <call-bsh><![CDATA[ + <script>groovy: // clear out the login fields from the cart try { if (cart!=null) cart.setAutoUserLogin(null, dispatcher); } catch (CartItemModifyException e) { Debug.logError(e, module); } - ]]></call-bsh> + </script> </if-not-empty> <if-not-empty field="partyId"> <set field="lookupKeyValue.userLoginId" value="anonymous"/> @@ -523,14 +523,14 @@ under the License. <call-object-method obj-field="cart" method-name="setOrderPartyId"> <field field="partyId"/> </call-object-method> - <call-bsh><![CDATA[ + <script>groovy: // clear out the login fields from the cart try { if (cart!=null) cart.setUserLogin(userLogin, dispatcher); } catch (CartItemModifyException e) { Debug.logError(e, module); } - ]]></call-bsh> + </script> </if-not-empty> </if-not-empty> </if-not-empty> @@ -562,13 +562,13 @@ under the License. </simple-method> <simple-method method-name="processShipOptions" short-description="Process Ship Options; to be called as a Request Event" login-required="false"> - <call-bsh><![CDATA[ + <script>groovy: shipmentMethod = parameters.get("shipping_method"); if(shipmentMethod != null){ parameters.put("shipmentMethodTypeId", shipmentMethod.substring(0, shipmentMethod.indexOf("@"))); parameters.put("carrierPartyId", shipmentMethod.substring(shipmentMethod.indexOf("@")+1)); } - ]]></call-bsh> + </script> <session-to-field field="cart" session-name="shoppingCart"/> <if-not-empty field="cart"> <set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/> Modified: ofbiz/trunk/specialpurpose/scrum/minilang/ScrumEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/minilang/ScrumEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/minilang/ScrumEvents.xml (original) +++ ofbiz/trunk/specialpurpose/scrum/minilang/ScrumEvents.xml Fri Jul 8 17:37:36 2016 @@ -697,13 +697,13 @@ </if-compare> </iterate> <if-not-empty field="custRequestIndex"> - <call-bsh><![CDATA[ + <script>groovy: List indexList = custRequestIndex; Collections.sort(indexList); Collections.reverse(indexList); List uniqueCustRequestIndexList = indexList; return org.ofbiz.base.util.UtilMisc.toMap("uniqueCustRequestIndexList", uniqueCustRequestIndexList); - ]]></call-bsh> + </script> </if-not-empty> <if-not-empty field="uniqueCustRequestIndexList"> <iterate entry="custRequestIndexMap" list="uniqueCustRequestIndexList"> @@ -758,11 +758,11 @@ </loop> <else> <!-- get size --> - <call-bsh><![CDATA[ + <script>groovy: List custRequestSeq = custRequestListWithNewSeq; List custRequestSeqList = org.ofbiz.base.util.UtilMisc.sortMaps(custRequestSeq, org.ofbiz.base.util.UtilMisc.toList("custSequenceNum")); return org.ofbiz.base.util.UtilMisc.toMap("custRequestSeqList", custRequestSeqList); - ]]></call-bsh> + </script> <set field="custRequestListWithNewSeq" from-field="custRequestSeqList"/> <call-object-method method-name="size" obj-field="custRequestListWithNewSeq" ret-field="newCustCount"/> @@ -4215,17 +4215,17 @@ <set field="newUserLogin.passwordHint" from-field="userLoginContext.passwordHint"/> <!-- Check the password, etc for validity --> - <call-bsh><![CDATA[ + <script>groovy: String password = (String) userLoginContext.get("currentPassword"); String confirmPassword = (String) userLoginContext.get("currentPasswordVerify"); String passwordHint = (String) userLoginContext.get("passwordHint"); org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale); - ]]></call-bsh> + </script> <!-- If password encryption is enabled, encrpyt it now --> - <call-bsh><![CDATA[ + <script>groovy: boolean useEncryption = "true".equals(org.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt")); if (useEncryption) { newUserLogin.set("currentPassword", org.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))); } - ]]></call-bsh> + </script> <!-- create the UserLogin --> <set field="newUserLogin.partyId" from-field="tempMap.partyId"/> Modified: ofbiz/trunk/specialpurpose/webpos/minilang/CartEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/minilang/CartEvents.xml?rev=1751945&r1=1751944&r2=1751945&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/minilang/CartEvents.xml (original) +++ ofbiz/trunk/specialpurpose/webpos/minilang/CartEvents.xml Fri Jul 8 17:37:36 2016 @@ -189,8 +189,7 @@ under the License. <add-error><fail-property resource="WebPosUiLabels" property="WebPosCannotFindProduct"/></add-error> <check-errors/> <else> - <call-bsh> - <![CDATA[ + <script>groovy: webPosSession = org.ofbiz.webpos.WebPosEvents.getWebPosSession(request, null); if (webPosSession != null) { parameters.put("webPosSession", webPosSession); @@ -207,8 +206,7 @@ under the License. parameters.put("partyId", cart.getPartyId()); } } - ]]> - </call-bsh> + </script> <if-not-empty field="parameters.webPosSession"> <if-not-empty field="parameters.cart"> <set field="priceContext.product" from-field="product"/> @@ -339,13 +337,11 @@ under the License. <call-object-method obj-field="webPosSession" method-name="getCart" ret-field="shoppingCart"/> <check-errors/> <set field="dispatcher" from-field="parameters.dispatcher" type="Object"/> - <call-bsh> - <![CDATA[ + <script>groovy: import org.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper; shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0); parameters.put("shippingEstWpr", shippingEstWpr); - ]]> - </call-bsh> + </script> <set field="shippingEstWpr" from-field="parameters.shippingEstWpr"/> <call-object-method obj-field="shippingEstWpr" method-name="getShippingMethods" ret-field="carrierShipmentMethodList"/> <call-object-method obj-field="shoppingCart" method-name="getShipmentMethodTypeId" ret-field="shipmentMethodTypeId"/> @@ -395,8 +391,7 @@ under the License. <check-errors/> <call-object-method obj-field="webPosSession" method-name="getCurrentTransaction" ret-field="webPosTransaction"/> <check-errors/> - <call-bsh> - <![CDATA[ + <script>groovy: shippingMethod = parameters.get("shipMethod"); if(shippingMethod != null) { shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@")); @@ -410,8 +405,7 @@ under the License. parameters.put("shipmentMethodTypeId", shipmentMethodTypeId); parameters.put("carrierPartyId", carrierPartyId); } - ]]> - </call-bsh> + </script> <set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/> <set field="carrierPartyId" from-field="parameters.carrierPartyId"/> <set field="productStoreShipMethId" from-field="parameters.productStoreShipMethId"/> @@ -434,8 +428,7 @@ under the License. <set field="dispatcher" from-field="parameters.dispatcher" type="Object"/> <set field="delegator" from-field="parameters.delegator" type="Object"/> <set field="locale" from-field="parameters.locale" type="Object"/> - <call-bsh> - <![CDATA[ + <script>groovy: Map shipCost = org.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0); shippingTotal = shipCost.get("shippingTotal"); if (shippingTotal == null) { @@ -453,8 +446,7 @@ under the License. cartGrandTotal = org.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale); parameters.put("cartGrandTotal", cartGrandTotal); - ]]> - </call-bsh> + </script> <call-class-method method-name="doPromotions" class-name="org.ofbiz.order.shoppingcart.product.ProductPromoWorker"> <field field="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/> <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/> |
Free forum by Nabble | Edit this page |