svn commit: r1832309 - in /ofbiz/ofbiz-framework/trunk/framework: entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java service/config/ServiceUiLabels.xml service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1832309 - in /ofbiz/ofbiz-framework/trunk/framework: entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java service/config/ServiceUiLabels.xml service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java

rishi
Author: rishi
Date: Sat May 26 13:00:56 2018
New Revision: 1832309

URL: http://svn.apache.org/viewvc?rev=1832309&view=rev
Log:
Improved: Generic message from entity-auto service can be enhanced. For example ProductStoreFacility Updated Successfully, we can have better success message as Product Store Facility Updated Successfully.
(OFBIZ-10409)
Thanks Suraj Khurana for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java
    ofbiz/ofbiz-framework/trunk/framework/service/config/ServiceUiLabels.xml
    ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java?rev=1832309&r1=1832308&r2=1832309&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelInfo.java Sat May 26 13:00:56 2018
@@ -45,7 +45,7 @@ public final class ModelInfo {
     public static ModelInfo createFromAttributes(ModelInfo defaultInfo, Element element) {
         String title = element.getAttribute("title").intern();
         if (title.isEmpty()) {
-            title = defaultInfo.getTitle();
+            title = element.getAttribute("entity-name").intern();
         }
         String description = StringUtil.internString(UtilXml.childElementValue(element, "description"));
         if (description == null || description.isEmpty()) {

Modified: ofbiz/ofbiz-framework/trunk/framework/service/config/ServiceUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/config/ServiceUiLabels.xml?rev=1832309&r1=1832308&r2=1832309&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/config/ServiceUiLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/config/ServiceUiLabels.xml Sat May 26 13:00:56 2018
@@ -20,15 +20,15 @@
 -->
 <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
     <property key="EntityCreatedSuccessfully">
-        <value xml:lang="en">${entityName} created successfully</value>
+        <value xml:lang="en">${label} created successfully</value>
     </property>
     <property key="EntityUpdatedSuccessfully">
-        <value xml:lang="en">${entityName} updated successfully</value>
+        <value xml:lang="en">${label} updated successfully</value>
     </property>
     <property key="EntityDeletedSuccessfully">
-        <value xml:lang="en">${entityName} deleted successfully</value>
+        <value xml:lang="en">${label} deleted successfully</value>
     </property>
     <property key="EntityExpiredSuccessfully">
-        <value xml:lang="en">${entityName} expired successfully</value>
+        <value xml:lang="en">${label} expired successfully</value>
     </property>
 </resource>
\ No newline at end of file

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=1832309&r1=1832308&r2=1832309&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 May 26 13:00:56 2018
@@ -355,7 +355,7 @@ public final class EntityAutoEngine exte
             }
         }
         newEntity.create();
-        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityCreatedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
+        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityCreatedSuccessfully", UtilMisc.toMap("label", modelEntity.getTitle()), locale));
         result.put("crudValue", newEntity);
         return result;
     }
@@ -468,7 +468,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));
+        result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage("ServiceUiLabels", "EntityUpdatedSuccessfully", UtilMisc.toMap("label", modelEntity.getTitle()), locale));
         return result;
     }
 
@@ -499,7 +499,7 @@ public final class EntityAutoEngine exte
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ServiceValueNotFoundForRemove", locale));
         }
         lookedUpValue.remove();
-        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityDeletedSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
+        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityDeletedSuccessfully", UtilMisc.toMap("label", modelEntity.getTitle()), locale));
         return result;
     }
 
@@ -573,7 +573,7 @@ public final class EntityAutoEngine exte
         if (Debug.infoOn()) {
             Debug.logInfo(" parameters OUT  : " + parameters, module);
         }
-        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityExpiredSuccessfully", UtilMisc.toMap("entityName", modelEntity.getEntityName()), locale));
+        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage("ServiceUiLabels", "EntityExpiredSuccessfully", UtilMisc.toMap("label", modelEntity.getTitle()), locale));
         return result;
     }
 }