Author: rishi
Date: Sat Sep 23 11:23:39 2017 New Revision: 1809397 URL: http://svn.apache.org/viewvc?rev=1809397&view=rev Log: Fixed: Can enter empty content for product facility (OFBIZ-8323). Port changes from trunk revision 1808833. A Generic Issue with EntityAutoEngine in which success message is appended to result after invoking create, update, delete, expire methods. Now engine would return success or error from invoking method and won't prepare the message its own. Thanks to Lalit Dashora for your contribution. Modified: ofbiz/branches/release16.11/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java Modified: ofbiz/branches/release16.11/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java?rev=1809397&r1=1809396&r2=1809397&view=diff ============================================================================== --- ofbiz/branches/release16.11/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java (original) +++ ofbiz/branches/release16.11/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java Sat Sep 23 11:23:39 2017 @@ -148,7 +148,6 @@ public final class EntityAutoEngine exte private static Map<String, Object> invokeCreate(DispatchContext dctx, Map<String, Object> parameters, ModelService modelService, ModelEntity modelEntity, boolean allPksInOnly, List<String> pkFieldNameOutOnly) throws GeneralException { Locale locale = (Locale) parameters.get("locale"); - Map<String, Object> result = ServiceUtil.returnSuccess(); GenericValue newEntity = dctx.getDelegator().makeValue(modelEntity.getEntityName()); @@ -360,6 +359,7 @@ public final class EntityAutoEngine exte } } newEntity.create(); + Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityCreatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale)); result.put("crudValue", newEntity); return result; } @@ -472,6 +472,7 @@ public final class EntityAutoEngine exte lookedUpValue.store(); result.put("crudValue", lookedUpValue); + result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityUpdatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale)); return result; } @@ -502,7 +503,8 @@ public final class EntityAutoEngine exte return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ServiceValueNotFoundForRemove", locale)); } lookedUpValue.remove(); - return ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityDeletedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale)); + return result; } /** @@ -566,6 +568,7 @@ public final class EntityAutoEngine exte } if (Debug.infoOn()) Debug.logInfo(" parameters OUT : " + parameters, module); - return ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityExpiredSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale)); + return result; } } |
Free forum by Nabble | Edit this page |