No functional change, completes r179986 which was framework only, this is for

plugins
================================================================================
While checking there were no other cases like in OFBIZ-9432 
(missing path to class), to be consistent I removed the trailing semicolons in 
groovy scripts and made few formatting

================================================================================

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1800450 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-06-30 18:50:22 +00:00
parent ba62e11375
commit 32e7ea5781
4 changed files with 103 additions and 103 deletions
+47 -47
View File
@@ -88,10 +88,10 @@ under the License.
<!-- Check the password, etc for validity -->
<script>groovy:
String password = (String) userLoginContext.get("currentPassword");
String confirmPassword = (String) userLoginContext.get("currentPasswordVerify");
String passwordHint = (String) userLoginContext.get("passwordHint");
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
String password = (String) userLoginContext.get("currentPassword")
String confirmPassword = (String) userLoginContext.get("currentPasswordVerify")
String passwordHint = (String) userLoginContext.get("passwordHint")
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale)
</script>
<!-- Create the Person -->
@@ -384,8 +384,8 @@ under the License.
<find-by-primary-key entity-name="Person" map="personLookup" value-field="personVo"/>
<if-empty field="parameters.CLUB_NUMBER">
<script>groovy:
clubId = org.apache.ofbiz.party.party.PartyWorker.createClubId(delegator, "999", 13);
parameters.put("CLUB_NUMBER", clubId);
clubId = org.apache.ofbiz.party.party.PartyWorker.createClubId(delegator, "999", 13)
parameters.put("CLUB_NUMBER", clubId)
</script>
</if-empty>
<set from-field="parameters.CLUB_NUMBER" field="personVo.memberId"/>
@@ -395,12 +395,12 @@ 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">
<script>groovy:
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin, request);
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
session = request.getSession();
cart = session.getAttribute("shoppingCart");
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin, request)
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response)
session = request.getSession()
cart = session.getAttribute("shoppingCart")
if (cart != null) {
cart.setOrderPartyId(tempMap.get("partyId"));
cart.setOrderPartyId(tempMap.get("partyId"))
}
</script>
</if-compare>
@@ -819,10 +819,10 @@ under the License.
<simple-method method-name="processShipOptions" short-description="Process Ship Options; to be called as a Request Event" login-required="false">
<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));
shipmentMethod = parameters.get("shipping_method")
if (shipmentMethod != null) {
parameters.put("shipmentMethodTypeId", shipmentMethod.substring(0, shipmentMethod.indexOf("@")))
parameters.put("carrierPartyId", shipmentMethod.substring(shipmentMethod.indexOf("@")+1))
}
</script>
<session-to-field field="cart" session-name="shoppingCart"/>
@@ -924,10 +924,10 @@ under the License.
<set field="newUserLogin.passwordHint" from-field="userLoginMap.passwordHint"/>
<!-- Check the password, etc for validity -->
<script>groovy:
String password = (String) userLoginMap.get("currentPassword");
String confirmPassword = (String) userLoginMap.get("currentPasswordVerify");
String passwordHint = (String) userLoginMap.get("passwordHint");
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
String password = (String) userLoginMap.get("currentPassword")
String confirmPassword = (String) userLoginMap.get("currentPasswordVerify")
String passwordHint = (String) userLoginMap.get("passwordHint")
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale)
</script>
<check-errors/>
<set-service-fields service-name="createUserLogin" map="userLoginMap" to-map="userLoginCtx"/>
@@ -943,8 +943,8 @@ under the License.
<!-- now finished, log in the user and set the cart's partyId -->
<script>groovy:
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(userLogin, request);
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(userLogin, request)
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response)
</script>
<set field="parameters.userLogin" from-field="userLogin"/>
<else>
@@ -983,9 +983,9 @@ under the License.
<session-to-field field="shoppingCart"/>
</if-empty>
<script>groovy:
import org.apache.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper;
shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0);
parameters.put("shippingEstWpr", shippingEstWpr);
import org.apache.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper
shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0)
parameters.put("shippingEstWpr", shippingEstWpr)
</script>
<set field="shippingEstWpr" from-field="parameters.shippingEstWpr"/>
<call-object-method obj-field="shippingEstWpr" method-name="getShippingMethods" ret-field="carrierShipmentMethodList"/>
@@ -1027,18 +1027,18 @@ under the License.
<simple-method method-name="setShippingOption" short-description="Set shipping method" login-required="false">
<script>groovy:
shippingMethod = parameters.get("shipMethod");
if(shippingMethod != null) {
shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@"));
shippingMethod = parameters.get("shipMethod")
if (shippingMethod != null) {
shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@"))
if (shippingMethod.indexOf(":") != -1) {
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1, shippingMethod.indexOf(":"));
productStoreShipMethId = shippingMethod.substring(shippingMethod.indexOf(":")+1);
parameters.put("productStoreShipMethId", productStoreShipMethId);
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1, shippingMethod.indexOf(":"))
productStoreShipMethId = shippingMethod.substring(shippingMethod.indexOf(":") + 1)
parameters.put("productStoreShipMethId", productStoreShipMethId)
} else {
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1);
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@") + 1)
}
parameters.put("shipmentMethodTypeId", shipmentMethodTypeId);
parameters.put("carrierPartyId", carrierPartyId);
parameters.put("shipmentMethodTypeId", shipmentMethodTypeId)
parameters.put("carrierPartyId", carrierPartyId)
}
</script>
<set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/>
@@ -1074,24 +1074,24 @@ under the License.
<set field="locale" from-field="parameters.locale" type="Object"/>
<script>groovy:
Map shipCost = org.apache.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0);
shippingTotal = shipCost.get("shippingTotal");
Map shipCost = org.apache.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0)
shippingTotal = shipCost.get("shippingTotal")
if (shippingTotal == null) {
shippingTotal = java.math.BigDecimal.ZERO;
shippingTotal = java.math.BigDecimal.ZERO
}
shoppingCart.setItemShipGroupEstimate(shippingTotal, 0);
parameters.put("shippingTotal", org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shippingTotal, isoCode, locale));
shoppingCart.setItemShipGroupEstimate(shippingTotal, 0)
parameters.put("shippingTotal", org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shippingTotal, isoCode, locale))
checkOutHelper = new org.apache.ofbiz.order.shoppingcart.CheckOutHelper(dispatcher, delegator, shoppingCart);
checkOutHelper = new org.apache.ofbiz.order.shoppingcart.CheckOutHelper(dispatcher, delegator, shoppingCart)
// Calculate and add the tax adjustments
checkOutHelper.calcAndAddTax();
checkOutHelper.calcAndAddTax()
salesTax = shoppingCart.getTotalSalesTax();
totalSalesTax = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(salesTax, isoCode, locale);
parameters.put("totalSalesTax", totalSalesTax);
salesTax = shoppingCart.getTotalSalesTax()
totalSalesTax = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(salesTax, isoCode, locale)
parameters.put("totalSalesTax", totalSalesTax)
cartGrandTotal = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale);
parameters.put("cartGrandTotal", cartGrandTotal);
cartGrandTotal = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale)
parameters.put("cartGrandTotal", cartGrandTotal)
</script>
<call-class-method method-name="doPromotions" class-name="org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker">
<field field="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart"/>
@@ -1249,8 +1249,8 @@ under the License.
</call-service>
<set-current-user-login value-field="newUserLogin"/>
<script>groovy:
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(newUserLogin, request);
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
org.apache.ofbiz.webapp.control.LoginWorker.doBasicLogin(newUserLogin, request)
org.apache.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response)
</script>
<!-- disabledDateTime/disableForYears set time until a user login remains disabled -->
<if-not-empty field="parameters.disabledDateTime">
@@ -86,10 +86,10 @@ under the License.
<!-- Check the password, etc for validity -->
<script>groovy:
String password = (String) userLoginContext.get("currentPassword");
String confirmPassword = (String) userLoginContext.get("currentPasswordVerify");
String passwordHint = (String) userLoginContext.get("passwordHint");
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
String password = (String) userLoginContext.get("currentPassword")
String confirmPassword = (String) userLoginContext.get("currentPasswordVerify")
String passwordHint = (String) userLoginContext.get("passwordHint")
org.apache.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale)
</script>
<else>
<if-compare field="require_login" operator="equals" value="true">
@@ -349,8 +349,8 @@ under the License.
<if-not-empty field="newUserLogin">
<!-- If password encryption is enabled, encrpyt it now -->
<script>groovy:
boolean useEncryption = "true".equals(org.apache.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt"));
if (useEncryption) { newUserLogin.set("currentPassword", org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))); }
boolean useEncryption = "true".equals(org.apache.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt"))
if (useEncryption) { newUserLogin.set("currentPassword", org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))) }
</script>
<!-- create the UserLogin manually to get around ordering and security constraints in the service -->
<set field="userLoginContext.partyId" from-field="partyId"/>
@@ -563,10 +563,10 @@ under the License.
<simple-method method-name="processShipOptions" short-description="Process Ship Options; to be called as a Request Event" login-required="false">
<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));
shipmentMethod = parameters.get("shipping_method")
if (shipmentMethod != null) {
parameters.put("shipmentMethodTypeId", shipmentMethod.substring(0, shipmentMethod.indexOf("@")))
parameters.put("carrierPartyId", shipmentMethod.substring(shipmentMethod.indexOf("@")+1))
}
</script>
<session-to-field field="cart" session-name="shoppingCart"/>