Author: deepak
Date: Sat Sep 3 12:32:04 2016 New Revision: 1759087 URL: http://svn.apache.org/viewvc?rev=1759087&view=rev Log: (OFBIZ-8009) Applied patch from jira issue ===================================== Add UI labels for success / error messages in ebaystore component ===================================== Thanks Tanmay for your contribution. Modified: ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java Modified: ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml?rev=1759087&r1=1759086&r2=1759087&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml Sat Sep 3 12:32:04 2016 @@ -91,6 +91,12 @@ <value xml:lang="zh">å¦æä½ æ·»å äºä¸ä¸ªæ°çä»»å¡ï¼ä½ å¿ é¡»æ·»å æå¡å称ã</value> <value xml:lang="zh-TW">å¦æä½ å¢å äºä¸åæ°çä»»å,ä½ å¿ é å¢å æåå稱.</value> </property> + <property key="EbayStoreBestOfferToEntityFailed"> + <value xml:lang="en">Store best offer to entity failed.</value> + </property> + <property key="EbayStoreBestOfferToEntitySuccessful"> + <value xml:lang="en">Store best offer to entity successful.</value> + </property> <property key="EbayStoreErrorFromDeleteContactStatus"> <value xml:lang="en">Error from deleteContactAlert service </value> <value xml:lang="it">Errore dal servizio deleteContactAlert </value> @@ -636,6 +642,9 @@ <value xml:lang="zh">ååºå·²å¯¼å ¥è®¢å</value> <value xml:lang="zh-TW">ååºå·²å¯å ¥è¨å®</value> </property> + <property key="EbayLoadEbayFeedbackSuccessful"> + <value xml:lang="en">Load eBay Feedback successful.</value> + </property> <property key="EbayNoOrderImported"> <value xml:lang="en">No orders imported found</value> <value xml:lang="zh">没ææ¾å°å·²å¯¼å ¥ç订å</value> @@ -646,6 +655,9 @@ <value xml:lang="zh">æå¼å表</value> <value xml:lang="zh-TW">æéæ¸ å®</value> </property> + <property key="EbayOrderCreatedSuccessfully"> + <value xml:lang="en">Order created successfully with ID (${orderId}) and eBay Order ID associated with this order is (${externalId}).</value> + </property> <property key="EbayReason"> <value xml:lang="en">Reason</value> <value xml:lang="zh">åå </value> Modified: ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java?rev=1759087&r1=1759086&r2=1759087&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java Sat Sep 3 12:32:04 2016 @@ -20,9 +20,11 @@ package org.apache.ofbiz.ebaystore; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import org.apache.ofbiz.base.util.UtilMisc; +import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; @@ -36,11 +38,12 @@ import org.apache.ofbiz.service.ServiceU public class EbayBestOfferAutoPref { public static final String module = EbayBestOfferAutoPref.class.getName(); - + public static final String resource = "EbayStoreUiLabels"; public static Map<String, Object> ebayBestOfferPrefCond(DispatchContext dctx, Map<String, ? extends Object> context) { Map<String, Object> result = new HashMap<String, Object>(); LocalDispatcher dispatcher = dctx.getDispatcher(); + Locale locale = (Locale)context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); Delegator delegator = dctx.getDelegator(); String productStoreId = (String) context.get("productStoreId"); @@ -188,15 +191,15 @@ public class EbayBestOfferAutoPref { } } catch (GenericServiceException e) { - String errorMessage = "Store best offer to entity failed."; + String errorMessage = UtilProperties.getMessage(resource, "EbayStoreBestOfferToEntityFailed", locale); result = ServiceUtil.returnError(errorMessage); return result; } catch (GenericEntityException e) { - String errorMessage = "Store best offer to entity failed."; + String errorMessage = UtilProperties.getMessage(resource, "EbayStoreBestOfferToEntityFailed", locale); result = ServiceUtil.returnError(errorMessage); return result; } - String successMsg = "Store best offer to entity successful."; + String successMsg = UtilProperties.getMessage(resource, "EbayStoreBestOfferToEntitySuccessful", locale); result = ServiceUtil.returnSuccess(successMsg); return result; } Modified: ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java?rev=1759087&r1=1759086&r2=1759087&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java Sat Sep 3 12:32:04 2016 @@ -19,6 +19,7 @@ package org.apache.ofbiz.ebaystore; import org.apache.ofbiz.base.util.UtilDateTime; +import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericValue; @@ -203,7 +204,7 @@ public class EbayFeedback { // TODO Auto-generated catch block e.printStackTrace(); } - String successMsg = "Load eBay Feedback successful."; + String successMsg = UtilProperties.getMessage(resource, "EbayLoadEbayFeedbackSuccessful", locale); result = ServiceUtil.returnSuccess(successMsg); return result; } Modified: ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java?rev=1759087&r1=1759086&r2=1759087&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java Sat Sep 3 12:32:04 2016 @@ -33,6 +33,7 @@ import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.GeneralException; import org.apache.ofbiz.base.util.UtilDateTime; import org.apache.ofbiz.base.util.UtilGenerics; +import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.ebay.EbayHelper; @@ -529,7 +530,7 @@ public class EbayStoreOrder { EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId); Debug.logInfo("Payment created.", module); } - result = ServiceUtil.returnFailure("Order created successfully with ID (" + orderId + ") & eBay Order ID associated with this order is (" + externalId + ")."); + result = ServiceUtil.returnFailure(UtilProperties.getMessage("EbayStoreUiLabels", "EbayOrderCreatedSuccessfully", UtilMisc.toMap("orderId", orderId, "externalId", externalId), locale)); } } catch (Exception e) { result = ServiceUtil.returnFailure(e.getMessage()); |
Free forum by Nabble | Edit this page |