Author: deepak
Date: Sat Sep 3 11:09:48 2016
New Revision: 1759077
URL: http://svn.apache.org/viewvc?rev=1759077&view=rev
Log:
(OFBIZ-7987) Applied patch from jira issue
=====================================
Add UI labels for success / error messages in content component
=====================================
Thanks Tanmay for your contribution.
Modified:
ofbiz/trunk/applications/content/config/ContentErrorUiLabels.xml
ofbiz/trunk/applications/content/config/ContentUiLabels.xml
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
Modified: ofbiz/trunk/applications/content/config/ContentErrorUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentErrorUiLabels.xml?rev=1759077&r1=1759076&r2=1759077&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/content/config/ContentErrorUiLabels.xml Sat Sep 3
11:09:48 2016
@@ -54,6 +54,12 @@
<value xml:lang="zh">ä½ æ²¡æè¶³å¤çæé ${updateMode} ç®å½
(éè¦CONTENTMGR_${updateMode} æ CONTENTMGR_ADMIN)ã</value>
<value xml:lang="zh-TW">æ¨æ²æè¶³å¤ çæ¬é ${updateMode} ç®é
(éè¦CONTENTMGR_${updateMode} æ CONTENTMGR_ADMIN).</value>
</property>
+ <property key="ContentNoOrderHeaderFound">
+ <value xml:lang="en">No OrderHeader found for orderId:
${orderId}</value>
+ </property>
+ <property key="ContentNoProductContentFound">
+ <value xml:lang="en">No ProductContent found for productId:
${productId}</value>
+ </property>
<property key="ContentSearchNotIndexed">
<value xml:lang="en">Cannot find content search document. Please index
all content.</value>
<value xml:lang="fr">Les contenus ne sont pas encore indexés, aucun
résultat possible.</value>
@@ -315,5 +321,4 @@
<value xml:lang="fr">Aucun répertoire racine fourni. Veuillez
indiquer le chemin dans le champ objectInfo de la ressource de donnée</value>
<value xml:lang="zh">没ææä¾æ
¹ç®å½ï¼è¯·å¨æ°æ®èµæºå¯¹è±¡ä¿¡æ¯æ°æ®é¡¹ä¸å¡«åè·¯å¾</value>
</property>
-
</resource>
Modified: ofbiz/trunk/applications/content/config/ContentUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentUiLabels.xml?rev=1759077&r1=1759076&r2=1759077&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentUiLabels.xml (original)
+++ ofbiz/trunk/applications/content/config/ContentUiLabels.xml Sat Sep 3
11:09:48 2016
@@ -1094,6 +1094,9 @@
<value xml:lang="zh">å
³èå°è¿ä¸ªæ°æ®èµæºçå
容记å½</value>
<value xml:lang="zh-TW">çµåå°éåè³æè³æºçå
§å®¹è¨é</value>
</property>
+ <property key="ContentConvertDocumentsTreeSuccessful">
+ <value xml:lang="en">Convert Documents Tree Successful. Total :
${counterLine} rows</value>
+ </property>
<property key="ContentCreateContentAssocMethodError">
<value xml:lang="en">Not 2 out of ContentId/To/From</value>
<value xml:lang="fr">Not 2 out of ContentId/To/From</value>
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java?rev=1759077&r1=1759076&r2=1759077&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
Sat Sep 3 11:09:48 2016
@@ -1353,6 +1353,7 @@ public class ContentManagementServices {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productId");
Integer qty = (Integer) context.get("quantity");
@@ -1382,7 +1383,7 @@ public class ContentManagementServices {
return ServiceUtil.returnError(e.toString());
}
if (productContent == null) {
- String msg = "No ProductContent found for productId:" + productId;
+ String msg = UtilProperties.getMessage(resource,
"ContentNoProductContentFound", UtilMisc.toMap("productId", productId), locale);
Debug.logError(msg, module);
return ServiceUtil.returnError(msg);
}
@@ -1405,6 +1406,7 @@ public class ContentManagementServices {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
LocalDispatcher dispatcher = dctx.getDispatcher();
String orderId = (String) context.get("orderId");
@@ -1425,7 +1427,7 @@ public class ContentManagementServices {
}
orderHeader =
EntityQuery.use(delegator).from("OrderHeader").where("orderId",
orderId).queryOne();
if (orderHeader == null) {
- String msg = "No OrderHeader found for orderId:" + orderId;
+ String msg = UtilProperties.getMessage(resource,
"ContentNoOrderHeaderFound", UtilMisc.toMap("orderId", orderId), locale);
return ServiceUtil.returnError(msg);
}
Timestamp orderCreatedDate = (Timestamp)
orderHeader.get("orderDate");
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java?rev=1759077&r1=1759076&r2=1759077&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
Sat Sep 3 11:09:48 2016
@@ -23,6 +23,7 @@ import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Locale;
import java.util.List;
import java.util.Map;
@@ -30,6 +31,7 @@ import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.base.util.UtilValidate;
+import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
@@ -66,6 +68,7 @@ In order ta make this service active add
public static Map<String, Object> convertTree(DispatchContext dctx,
Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
+ Locale locale = (Locale) context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String file = (String) context.get("file");
String errMsg = "", sucMsg= "";
@@ -220,7 +223,7 @@ In order ta make this service active add
recordCount++;
}
}//end line
- sucMsg = "Convert Documents Tree Successful.<br/>Total
: " + counterLine + " rows";
+ sucMsg = UtilProperties.getMessage("ContentUiLabels",
"ContentConvertDocumentsTreeSuccessful", UtilMisc.toMap("counterLine",
counterLine), locale);
}
}
}