You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2016/09/03 10:25:14 UTC

svn commit: r1759068 - in /ofbiz/trunk/framework/service: config/ServiceErrorUiLabels.xml src/main/java/org/apache/ofbiz/service/ServiceUtil.java

Author: deepak
Date: Sat Sep  3 10:25:14 2016
New Revision: 1759068

URL: http://svn.apache.org/viewvc?rev=1759068&view=rev
Log:
(OFBIZ-7998) Applied patch from jira issue
=====================================
Add UI labels for success / error messages in service component
=====================================
Thanks Tanmay for your contribution.

Modified:
    ofbiz/trunk/framework/service/config/ServiceErrorUiLabels.xml
    ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java

Modified: ofbiz/trunk/framework/service/config/ServiceErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/config/ServiceErrorUiLabels.xml?rev=1759068&r1=1759067&r2=1759068&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/config/ServiceErrorUiLabels.xml (original)
+++ ofbiz/trunk/framework/service/config/ServiceErrorUiLabels.xml Sat Sep  3 10:25:14 2016
@@ -104,6 +104,9 @@
         <value xml:lang="zh">进行实体自动操作时出错,实体 ${entityName}、服务 ${serviceName}:${errorString}</value>
         <value xml:lang="zh-TW">進行資料實體自動操作時出錯,資料實體 ${entityName}、服務 ${serviceName}:${errorString}</value>
     </property>
+    <property key="ServiceExceptionThrownWhileGettingServiceConfiguration">
+        <value xml:lang="en">Exception thrown while getting service configuration: ${errorString}</value>
+    </property>
     <property key="ServiceParameterValueNotValid">
         <value xml:lang="en">The ID value in the parameter ${parameterName} was not valid: ${errorDetails}</value>
         <value xml:lang="it">Il valore ID nel parametro ${parameterName} non è valido: ${errorDetails}</value>

Modified: ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java?rev=1759068&r1=1759067&r2=1759068&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java (original)
+++ ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java Sat Sep  3 10:25:14 2016
@@ -372,6 +372,7 @@ public final class ServiceUtil {
     }
 
     public static Map<String, Object> purgeOldJobs(DispatchContext dctx, Map<String, ? extends Object> context) {
+    	 Locale locale = (Locale)context.get("locale");
         Debug.logWarning("purgeOldJobs service invoked. This service is obsolete - the Job Scheduler will purge old jobs automatically.", module);
         String sendPool = null;
         Calendar cal = Calendar.getInstance();
@@ -381,7 +382,7 @@ public final class ServiceUtil {
             cal.add(Calendar.DAY_OF_YEAR, -daysToKeep);
         } catch (GenericConfigException e) {
             Debug.logWarning(e, "Exception thrown while getting service configuration: ", module);
-            return returnError("Exception thrown while getting service configuration: " + e);
+            return returnError(UtilProperties.getMessage(ServiceUtil.resource, "ServiceExceptionThrownWhileGettingServiceConfiguration", UtilMisc.toMap("errorString", e), locale));
         }
         Delegator delegator = dctx.getDelegator();