Author: arunpatidar
Date: Sat Jul 8 18:43:54 2017 New Revision: 1801313 URL: http://svn.apache.org/viewvc?rev=1801313&view=rev Log: Improved: Use serviceUtil() in place of hard-coded error/success messages. (OFBIZ-9466) Thanks Pawan Verma for your contribution. Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderEvents.java ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderEvents.java?rev=1801313&r1=1801312&r2=1801313&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderEvents.java Sat Jul 8 18:43:54 2017 @@ -135,7 +135,7 @@ public class OrderEvents { resultMap = dispatcher.runSync("cancelOrderItem", contextMap); if (ServiceUtil.isError(resultMap)) { - String errorMessage = (String) resultMap.get("errorMessage"); + String errorMessage = ServiceUtil.getErrorMessage(resultMap); Debug.logError(errorMessage, module); request.setAttribute("_ERROR_MESSAGE_", errorMessage); return "error"; Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1801313&r1=1801312&r2=1801313&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java Sat Jul 8 18:43:54 2017 @@ -5760,7 +5760,7 @@ public class OrderServices { } if (ServiceUtil.isError(result)) { - String errMsg = UtilProperties.getMessage(resource, mainErrorMessage + result.get("errorMessage"), locale); + String errMsg = UtilProperties.getMessage(resource, mainErrorMessage + ServiceUtil.getErrorMessage(result), locale); return ServiceUtil.returnError(errMsg); } return result; Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java?rev=1801313&r1=1801312&r2=1801313&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java Sat Jul 8 18:43:54 2017 @@ -374,7 +374,7 @@ public class SubscriptionServices { } if (result != null && subscriptionId != null) { - Debug.logInfo("Service mentioned in serviceNameOnExpiry called with result: " + result.get("successMessage"), module); + Debug.logInfo("Service mentioned in serviceNameOnExpiry called with result: " + ServiceUtil.makeSuccessMessage(result, "", "", "", ""), module); } else if (result == null && subscriptionId != null) { Debug.logError("Subscription couldn't be expired for subscriptionId: " + subscriptionId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "ProductSubscriptionCouldntBeExpired", UtilMisc.toMap("subscriptionId", subscriptionId), locale)); Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java?rev=1801313&r1=1801312&r2=1801313&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java Sat Jul 8 18:43:54 2017 @@ -141,7 +141,7 @@ public final class EntityAutoEngine exte Debug.logError(e, "Error doing entity-auto operation for entity [" + modelEntity.getEntityName() + "] in service [" + modelService.name + "]: " + e.toString(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ServiceEntityAutoOperation", UtilMisc.toMap("entityName", modelEntity.getEntityName(), "serviceName", modelService.name,"errorString", e.toString()), locale)); } - result.put(ModelService.SUCCESS_MESSAGE, result.get("successMessage")); + result.put(ModelService.SUCCESS_MESSAGE, ServiceUtil.makeSuccessMessage(result, "", "", "", "")); return result; } |
Free forum by Nabble | Edit this page |