Author: mrisaliti
Date: Fri Jan 7 18:28:39 2011
New Revision: 1056444
URL: http://svn.apache.org/viewvc?rev=1056444&view=rev
Log:
Internationalization of ServiceUtil.returnSuccess, ServiceUtil.returnFailure,
ServiceUtil.returnError (OFBIZ-4091)
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
Fri Jan 7 18:28:39 2011
@@ -56,7 +56,8 @@ import org.ofbiz.service.ServiceUtil;
public class ProductUtilServices {
public static final String module = ProductUtilServices.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resource = "ProductUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
/** First expire all ProductAssocs for all disc variants, then disc all
virtuals that have all expired variant ProductAssocs */
public static Map<String, Object>
discVirtualsWithDiscVariants(DispatchContext dctx, Map<String, ? extends
Object> context) {
@@ -120,7 +121,7 @@ public class ProductUtilServices {
eli.close();
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_discVirtualsWithDiscVariants",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_discVirtualsWithDiscVariants",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -161,7 +162,7 @@ public class ProductUtilServices {
Debug.logInfo("Completed - Removed category members for " +
numSoFar + " sales discontinued products.", module);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_removeCategoryMembersOfDiscProducts",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_removeCategoryMembersOfDiscProducts",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -210,7 +211,7 @@ public class ProductUtilServices {
Debug.logInfo("Completed - Removed category members for " +
numSoFar + " products with duplicate category members.", module);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_removeDuplicateOpenEndedCategoryMembers",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_removeDuplicateOpenEndedCategoryMembers",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -313,12 +314,12 @@ public class ProductUtilServices {
Debug.logInfo("Found virtual products with one valid variant: " +
numWithOneValid + ", with one variant only: " + numWithOneOnly, module);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
} catch (GenericServiceException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -349,14 +350,14 @@ public class ProductUtilServices {
List<GenericValue> paList =
EntityUtil.filterByDate(delegator.findByAnd("ProductAssoc",
UtilMisc.toMap("productId", productId, "productAssocTypeId",
"PRODUCT_VARIANT")));
if (paList.size() > 1) {
Map<String, String> messageMap = UtilMisc.toMap("productId",
productId);
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.found_more_than_one_valid_variant_for_virtual_ID",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.found_more_than_one_valid_variant_for_virtual_ID",
messageMap, locale);
Debug.logInfo(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
if (paList.size() == 0) {
Map<String, String> messageMap = UtilMisc.toMap("productId",
productId);
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.did_not_find_any_valid_variants_for_virtual_ID",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.did_not_find_any_valid_variants_for_virtual_ID",
messageMap, locale);
Debug.logInfo(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -428,11 +429,12 @@ public class ProductUtilServices {
}
if (test) {
- return ServiceUtil.returnError("Test mode - returning error to
get a rollback");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductMergeVirtualWithSingleVariant", locale));
}
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_makeStandAloneFromSingleVariantVirtuals",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -539,7 +541,7 @@ public class ProductUtilServices {
Debug.logInfo("Completed - Image URLs set for " + numSoFar + "
products.", module);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_setAllProductImageNames",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_setAllProductImageNames",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -571,7 +573,7 @@ public class ProductUtilServices {
Debug.logInfo("Completed - Image URLs set for " + numSoFar + "
products.", module);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.entity_error_running_clearAllVirtualProductImageNames",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.entity_error_running_clearAllVirtualProductImageNames",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -633,7 +635,7 @@ while (allCatIter.hasNext()) {
attachProductFeaturesToCategory(productCategoryId,
productFeatureTypeIdsToInclude, productFeatureTypeIdsToExclude, delegator,
doSubCategories, nowTimestamp);
} catch (GenericEntityException e) {
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.toString());
- errMsg =
UtilProperties.getMessage(resource,"productutilservices.error_in_attachProductFeaturesToCategory",
messageMap, locale);
+ errMsg =
UtilProperties.getMessage(resourceError,"productutilservices.error_in_attachProductFeaturesToCategory",
messageMap, locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductServices.java
Fri Jan 7 18:28:39 2011
@@ -24,6 +24,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
@@ -34,6 +35,7 @@ import org.apache.poi.hssf.usermodel.HSS
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
@@ -44,7 +46,8 @@ import org.ofbiz.service.ServiceUtil;
public class ImportProductServices {
public static String module = ImportProductServices.class.getName();
-
+ public static final String resource = "ProductUiLabels";
+
/**
* This method is responsible to import spreadsheet data into "Product" and
* "InventoryItem" entities into database. The method uses the
@@ -60,6 +63,7 @@ public class ImportProductServices {
*/
public static Map<String, Object>
productImportFromSpreadsheet(DispatchContext dctx, Map<String, ? extends
Object> context) {
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
// System.getProperty("user.dir") returns the path upto ofbiz home
// directory
String path = System.getProperty("user.dir") + "/spreadsheet";
@@ -77,14 +81,17 @@ public class ImportProductServices {
}
}
} else {
- return ServiceUtil.returnError("Directory not found or can not
be read");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductImportDirectoryNotFound", locale));
}
} else {
- return ServiceUtil.returnError("No path specified, doing nothing");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductImportPathNotSpecified", locale));
}
if (fileItems.size() < 1) {
- return ServiceUtil.returnError("No spreadsheet exists in" + path);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductImportPathNoSpreadsheetExists", locale) +
path);
}
for (File item: fileItems) {
@@ -98,7 +105,8 @@ public class ImportProductServices {
wb = new HSSFWorkbook(fs);
} catch (IOException e) {
Debug.logError("Unable to read or create workbook from file",
module);
- return ServiceUtil.returnError("Unable to read or create
workbook from file");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductImportCannotCreateWorkbookFromFile",
locale));
}
// get first sheet
@@ -148,7 +156,8 @@ public class ImportProductServices {
delegator.create(inventoryItemGV);
} catch (GenericEntityException e) {
Debug.logError("Cannot store product", module);
- return ServiceUtil.returnError("Cannot store product");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductImportCannotStoreProduct",
locale));
}
}
}
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
Fri Jan 7 18:28:39 2011
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
import java.sql.Timestamp;
import com.ibm.icu.util.Calendar;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
@@ -29,6 +30,7 @@ import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
@@ -47,7 +49,9 @@ import org.ofbiz.common.uom.UomWorker;
public class SubscriptionServices {
public static final String module = SubscriptionServices.class.getName();
-
+ public static final String resource = "ProductUiLabels";
+ public static final String resourceOrderError = "OrderErrorUiLabels";
+
public static Map<String, Object>
processExtendSubscription(DispatchContext dctx, Map<String, ? extends Object>
context) {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -61,6 +65,7 @@ public class SubscriptionServices {
Integer useTime = (Integer) context.get("useTime");
String useTimeUomId = (String) context.get("useTimeUomId");
String alwaysCreateNewRecordStr = (String)
context.get("alwaysCreateNewRecord");
+ Locale locale = (Locale) context.get("locale");
boolean alwaysCreateNewRecord = !"N".equals(alwaysCreateNewRecordStr);
GenericValue lastSubscription = null;
@@ -134,7 +139,10 @@ public class SubscriptionServices {
Map<String, Object> updateSubscriptionResult =
dispatcher.runSync("updateSubscription", updateSubscriptionMap);
result.put("subscriptionId",
updateSubscriptionMap.get("subscriptionId"));
if (ServiceUtil.isError(updateSubscriptionResult)) {
- return ServiceUtil.returnError("Error processing
subscription update with ID [" + updateSubscriptionMap.get("subscriptionId") +
"]", null, null, updateSubscriptionResult);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionUpdateError",
+ UtilMisc.toMap("subscriptionId",
updateSubscriptionMap.get("subscriptionId")), locale),
+ null, null, updateSubscriptionResult);
}
} else {
Map<String, Object> createPartyRoleMap = FastMap.newInstance();
@@ -144,7 +152,10 @@ public class SubscriptionServices {
createPartyRoleMap.put("userLogin", userLogin);
Map<String, Object> createPartyRoleResult =
dispatcher.runSync("createPartyRole", createPartyRoleMap);
if (ServiceUtil.isError(createPartyRoleResult)) {
- return ServiceUtil.returnError("Error creating new
PartyRole while processing subscription update with resource ID [" +
subscriptionResourceId + "]", null, null, createPartyRoleResult);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionPartyRoleCreationError",
+ UtilMisc.toMap("subscriptionResourceId",
subscriptionResourceId), locale),
+ null, null, createPartyRoleResult);
}
}
Map<String, Object> createSubscriptionMap =
dctx.getModelService("createSubscription").makeValid(newSubscription,
ModelService.IN_PARAM);
@@ -152,7 +163,10 @@ public class SubscriptionServices {
Map<String, Object> createSubscriptionResult =
dispatcher.runSync("createSubscription", createSubscriptionMap);
if (ServiceUtil.isError(createSubscriptionResult)) {
- return ServiceUtil.returnError("Error creating
subscription while processing with resource ID [" + subscriptionResourceId +
"]", null, null, createSubscriptionResult);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionCreateError",
+ UtilMisc.toMap("subscriptionResourceId",
subscriptionResourceId), locale),
+ null, null, createSubscriptionResult);
}
result.put("subscriptionId",
createSubscriptionResult.get("subscriptionId"));
}
@@ -169,6 +183,7 @@ public class SubscriptionServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productId");
Integer qty = (Integer) context.get("quantity");
+ Locale locale = (Locale) context.get("locale");
if (qty == null) {
qty = Integer.valueOf(1);
}
@@ -183,9 +198,10 @@ public class SubscriptionServices {
productSubscriptionResourceList =
EntityUtil.filterByDate(productSubscriptionResourceList, orderCreatedDate,
"purchaseFromDate", "purchaseThruDate", true);
if (productSubscriptionResourceList.size() == 0) {
- String msg = "No ProductSubscriptionResource found for
productId: " + productId;
- Debug.logError(msg, module);
- return ServiceUtil.returnError(msg);
+ Debug.logError("No ProductSubscriptionResource found for
productId: " + productId, module);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionResourceNotFound",
+ UtilMisc.toMap("productId", productId), locale));
}
for (GenericValue productSubscriptionResource:
productSubscriptionResourceList) {
@@ -206,7 +222,10 @@ public class SubscriptionServices {
Map<String, Object> ctx =
dctx.getModelService("processExtendSubscription").makeValid(subContext,
ModelService.IN_PARAM);
Map<String, Object> processExtendSubscriptionResult =
dispatcher.runSync("processExtendSubscription", ctx);
if (ServiceUtil.isError(processExtendSubscriptionResult)) {
- return ServiceUtil.returnError("Error processing
subscriptions for Product with ID [" + productId + "]", null, null,
processExtendSubscriptionResult);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionByProductError",
+ UtilMisc.toMap("productId", productId), locale),
+ null, null, processExtendSubscriptionResult);
}
}
} catch (GenericEntityException e) {
@@ -222,6 +241,7 @@ public class SubscriptionServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> subContext = UtilMisc.makeMapWritable(context);
String orderId = (String) context.get("orderId");
+ Locale locale = (Locale) context.get("locale");
Debug.logInfo("In processExtendSubscriptionByOrder service with
orderId: " + orderId, module);
@@ -233,13 +253,15 @@ public class SubscriptionServices {
String partyId = (String) orderRole.get("partyId");
subContext.put("partyId", partyId);
} else {
- String msg = "No OrderRole found for orderId:" + orderId;
- return ServiceUtil.returnFailure(msg);
+ return
ServiceUtil.returnFailure(UtilProperties.getMessage(resourceOrderError,
+ "OrderErrorCannotGetOrderRoleEntity",
+ UtilMisc.toMap("itemMsgInfo", orderId), locale));
}
orderHeader = delegator.findByPrimaryKey("OrderHeader",
UtilMisc.toMap("orderId", orderId));
if (orderHeader == null) {
- String msg = "No OrderHeader found for orderId:" + orderId;
- return ServiceUtil.returnError(msg);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError,
+ "OrderErrorNoValidOrderHeaderFoundForOrderId",
+ UtilMisc.toMap("orderId", orderId), locale));
}
Timestamp orderCreatedDate = (Timestamp)
orderHeader.get("orderDate");
subContext.put("orderCreatedDate", orderCreatedDate);
@@ -262,7 +284,9 @@ public class SubscriptionServices {
Map<String, Object> ctx =
dctx.getModelService("processExtendSubscriptionByProduct").makeValid(subContext,
ModelService.IN_PARAM);
Map<String, Object> thisResult =
dispatcher.runSync("processExtendSubscriptionByProduct", ctx);
if (ServiceUtil.isError(thisResult)) {
- return ServiceUtil.returnError("Error processing
subscriptions for Order with ID [" + orderId + "]", null, null, thisResult);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductSubscriptionByOrderError",
+ UtilMisc.toMap("orderId", orderId), locale),
null, null, thisResult);
}
}
}
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
Fri Jan 7 18:28:39 2011
@@ -19,11 +19,14 @@
package org.ofbiz.shipment.packing;
import java.math.BigDecimal;
+import java.util.Locale;
import java.util.Map;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
@@ -31,6 +34,7 @@ import org.ofbiz.service.ServiceUtil;
public class PackingServices {
public static final String module = PackingServices.class.getName();
+ public static final String resource = "ProductUiLabels";
public static Map<String, Object> addPackLine(DispatchContext dctx,
Map<String, ? extends Object> context) {
PackingSession session = (PackingSession)
context.get("packingSession");
@@ -92,6 +96,7 @@ public class PackingServices {
String orderId = (String) context.get("orderId");
String shipGroupSeqId = (String) context.get("shipGroupSeqId");
Boolean updateQuantity = (Boolean) context.get("updateQuantity");
+ Locale locale = (Locale) context.get("locale");
if (updateQuantity == null) {
updateQuantity = Boolean.FALSE;
}
@@ -146,7 +151,8 @@ public class PackingServices {
// check to make sure there is at least one package
if (packages == null || packages.length == 0) {
- return ServiceUtil.returnError("No packages defined for
processing.");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductPackBulkNoPackagesDefined", locale));
}
// process the quantity array
@@ -156,7 +162,8 @@ public class PackingServices {
quantities[p] = qtyInfo.get(rowKey + ":" +
packages[p]);
}
if (quantities.length != packages.length) {
- return ServiceUtil.returnError("Packages and
quantities do not match.");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+
"ProductPackBulkPackagesAndQuantitiesDoNotMatch", locale));
}
} else {
quantities = new String[] { qtyStr };
@@ -228,6 +235,7 @@ public class PackingServices {
String inventoryItemId = (String) context.get("inventoryItemId");
String productId = (String) context.get("productId");
Integer packageSeqId = (Integer) context.get("packageSeqId");
+ Locale locale = (Locale) context.get("locale");
PackingSessionLine line = session.findLine(orderId, orderItemSeqId,
shipGroupSeqId,
productId, inventoryItemId, packageSeqId.intValue());
@@ -236,7 +244,8 @@ public class PackingServices {
if (line != null) {
session.clearLine(line);
} else {
- return ServiceUtil.returnError("Packing line item not found;
cannot clear.");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductPackLineNotFound", locale));
}
return ServiceUtil.returnSuccess();
@@ -272,7 +281,8 @@ public class PackingServices {
public static Map<String, Object> completePack(DispatchContext dctx,
Map<String, ? extends Object> context) {
PackingSession session = (PackingSession)
context.get("packingSession");
-
+ Locale locale = (Locale) context.get("locale");
+
// set the instructions -- will clear out previous if now null
String instructions = (String) context.get("handlingInstructions");
String pickerPartyId = (String) context.get("pickerPartyId");
@@ -300,9 +310,11 @@ public class PackingServices {
Map<String, Object> resp;
if ("EMPTY".equals(shipmentId)) {
- resp = ServiceUtil.returnError("No items currently set to be
shipped. Cannot complete!");
+ resp = ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductPackCompleteNoItems", locale));
} else {
- resp = ServiceUtil.returnSuccess("Shipment #" + shipmentId + "
created and marked as PACKED.");
+ resp =
ServiceUtil.returnSuccess(UtilProperties.getMessage(resource,
+ "ProductPackComplete", UtilMisc.toMap("shipmentId",
shipmentId), locale));
}
resp.put("shipmentId", shipmentId);
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
Fri Jan 7 18:28:39 2011
@@ -68,18 +68,20 @@ public class ShipmentServices {
public static Map<String, Object> createShipmentEstimate(DispatchContext
dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
List<GenericValue> storeAll = FastList.newInstance();
-
String productStoreShipMethId =
(String)context.get("productStoreShipMethId");
GenericValue productStoreShipMeth = null;
try {
productStoreShipMeth =
delegator.findByPrimaryKey("ProductStoreShipmentMeth",
UtilMisc.toMap("productStoreShipMethId", productStoreShipMethId));
} catch (GenericEntityException e) {
- return ServiceUtil.returnError("Problem retrieving
ProductStoreShipmentMeth entry with id [" + productStoreShipMethId + "]: " +
e.toString());
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductStoreShipmentMethodCannotRetrieve",
+ UtilMisc.toMap("productStoreShipMethId",
productStoreShipMethId,
+ "errorString", e.toString()), locale));
}
-
// Create the basic entity.
GenericValue estimate = delegator.makeValue("ShipmentCostEstimate");
@@ -141,6 +143,7 @@ public class ShipmentServices {
public static Map<String, Object> removeShipmentEstimate(DispatchContext
dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
String shipmentCostEstimateId = (String)
context.get("shipmentCostEstimateId");
+ Locale locale = (Locale) context.get("locale");
GenericValue estimate = null;
@@ -149,7 +152,9 @@ public class ShipmentServices {
estimate.remove();
} catch (GenericEntityException e) {
Debug.logError(e, module);
- return ServiceUtil.returnError("Problem removing entity or related
entities (" + e.toString() + ")");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentCostEstimateRemoveError",
+ UtilMisc.toMap("errorString", e.toString()), locale));
}
/* Commented out this code because QuantityBreak may be used by other
records
try {
@@ -240,6 +245,7 @@ public class ShipmentServices {
BigDecimal shippableQuantity = (BigDecimal)
context.get("shippableQuantity");
BigDecimal shippableWeight = (BigDecimal)
context.get("shippableWeight");
BigDecimal initialEstimateAmt = (BigDecimal)
context.get("initialEstimateAmt");
+ Locale locale = (Locale) context.get("locale");
if (shippableTotal == null) {
shippableTotal = BigDecimal.ZERO;
@@ -270,7 +276,8 @@ public class ShipmentServices {
estimates = delegator.findList("ShipmentCostEstimate",
estFieldsCond, null, null, null, true);
} catch (GenericEntityException e) {
Debug.logError(e, module);
- return ServiceUtil.returnError("Unable to locate estimates from
database");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentCostEstimateCannotRetrieve", locale));
}
if (estimates == null || estimates.size() < 1) {
if (initialEstimateAmt.compareTo(BigDecimal.ZERO) == 0) {
@@ -288,7 +295,8 @@ public class ShipmentServices {
try {
shipAddress = delegator.findByPrimaryKey("PostalAddress",
UtilMisc.toMap("contactMechId", shippingContactMechId));
} catch (GenericEntityException e) {
- return ServiceUtil.returnFailure("Cannot get shipping address
entity");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentCostEstimateCannotGetShippingAddress",
locale));
}
if (shippingContactMechId != null) {
@@ -296,7 +304,8 @@ public class ShipmentServices {
shipAddress = delegator.findByPrimaryKey("PostalAddress",
UtilMisc.toMap("contactMechId", shippingContactMechId));
} catch (GenericEntityException e) {
Debug.logError(e, module);
- return ServiceUtil.returnError("Cannot get shipping address
entity");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentCostEstimateCannotGetShippingAddress",
locale));
}
} else if (shippingPostalCode != null) {
String countryGeoId = null;
@@ -414,7 +423,10 @@ public class ShipmentServices {
}
if (estimateList.size() < 1) {
- return ServiceUtil.returnFailure("No shipping estimate found for
carrier [" + carrierPartyId + "] and shipment method type [" +
shipmentMethodTypeId +"]");
+ return
ServiceUtil.returnFailure(UtilProperties.getMessage(resource,
+ "ProductShipmentCostEstimateCannotFoundForCarrier",
+ UtilMisc.toMap("carrierPartyId", carrierPartyId,
+ "shipmentMethodTypeId", shipmentMethodTypeId),
locale));
}
// make the shippable item size/feature objects
@@ -609,6 +621,7 @@ public class ShipmentServices {
public static Map<String, Object>
fillShipmentStagingTables(DispatchContext dctx, Map<String, ? extends Object>
context) {
Delegator delegator = dctx.getDelegator();
String shipmentId = (String) context.get("shipmentId");
+ Locale locale = (Locale) context.get("locale");
GenericValue shipment = null;
if (shipmentId != null) {
@@ -620,7 +633,8 @@ public class ShipmentServices {
}
}
if (shipment == null) {
- return ServiceUtil.returnError("No shipment found!");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentNotFoundId", locale));
}
String shipmentStatusId = shipment.getString("statusId");
@@ -633,7 +647,8 @@ public class ShipmentServices {
return ServiceUtil.returnError(e.getMessage());
}
if (address == null) {
- return ServiceUtil.returnError("No address found for
shipment!");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentNoAddressFound", locale));
}
List<GenericValue> packages = null;
@@ -645,7 +660,8 @@ public class ShipmentServices {
}
if (UtilValidate.isEmpty(packages)) {
- return ServiceUtil.returnError("No packages are available for
shipping!");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentNoPackagesAvailable", locale));
}
List<GenericValue> routeSegs = null;
@@ -713,7 +729,7 @@ public class ShipmentServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
GenericValue userLogin = (GenericValue) context.get("userLogin");
-
+ Locale locale = (Locale) context.get("locale");
List<String> orderBy = UtilMisc.toList("shipmentId",
"shipmentPackageSeqId", "voidIndicator");
Map<String, String> shipmentMap = FastMap.newInstance();
@@ -776,7 +792,10 @@ public class ShipmentServices {
}
if (pkg == null) {
- return ServiceUtil.returnError("Package not found! - "
+ pkgCtx);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentPackageNotFound",
+ UtilMisc.toMap("shipmentPackageSeqId",
packageSeqId,
+ "shipmentId",shipmentId), locale));
}
pkg.set("weight", pkgInfo.get("packageWeight"));
@@ -948,23 +967,26 @@ public class ShipmentServices {
Debug.logError(se, module);
return ServiceUtil.returnError(se.getMessage());
}
- return ServiceUtil.returnSuccess("Intentional error at end to keep
from committing.");
+ return ServiceUtil.returnSuccess();
}
public static Map<String, Object>
duplicateShipmentRouteSegment(DispatchContext dctx, Map<String, ? extends
Object> context) {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
-
String shipmentId = (String) context.get("shipmentId");
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
+ Locale locale = (Locale) context.get("locale");
Map<String, Object> results = ServiceUtil.returnSuccess();
try {
GenericValue shipmentRouteSeg =
delegator.findByPrimaryKey("ShipmentRouteSegment", UtilMisc.toMap("shipmentId",
shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId));
if (shipmentRouteSeg == null) {
- return ServiceUtil.returnError("Shipment Route Segment not
found for shipment [" + shipmentId + "] route segment [" +
shipmentRouteSegmentId + "]");
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentRouteSegmentNotFound",
+ UtilMisc.toMap("shipmentId", shipmentId,
+ "shipmentRouteSegmentId",
shipmentRouteSegmentId), locale));
}
Map<String, Object> params = UtilMisc.<String,
Object>toMap("shipmentId", shipmentId, "carrierPartyId",
shipmentRouteSeg.getString("carrierPartyId"), "shipmentMethodTypeId",
shipmentRouteSeg.getString("shipmentMethodTypeId"),
@@ -1120,7 +1142,8 @@ public class ShipmentServices {
String shipmentId = (String) context.get("shipmentId");
String sendTo = (String) context.get("sendTo");
String screenUri = (String) context.get("screenUri");
-
+ Locale localePar = (Locale) context.get("locale");
+
// prepare the shipment information
Map<String, Object> sendMap = FastMap.newInstance();
GenericValue shipment = null ;
@@ -1138,7 +1161,10 @@ public class ShipmentServices {
Debug.logError(e, "Problem getting the ProductStoreEmailSetting
for productStoreId =" + orderHeader.get("productStoreId") + " and emailType =
PRDS_ODR_SHIP_COMPLT", module);
}
if (productStoreEmail == null) {
- return ServiceUtil.returnFailure("No valid email setting for store
with productStoreId =" + orderHeader.get("productStoreId") + " and emailType =
PRDS_ODR_SHIP_COMPLT");
+ return
ServiceUtil.returnFailure(UtilProperties.getMessage(resource,
+ "ProductProductStoreEmailSettingsNotValid",
+ UtilMisc.toMap("productStoreId",
orderHeader.get("productStoreId"),
+ "emailType", "PRDS_ODR_SHIP_COMPLT"), localePar));
}
// the override screenUri
if (UtilValidate.isEmpty(screenUri)) {
@@ -1157,7 +1183,8 @@ public class ShipmentServices {
emailString = email.getString("infoString");
}
if (UtilValidate.isEmpty(emailString)) {
- return ServiceUtil.returnError("No sendTo email address found");
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductProductStoreEmailSettingsNoSendToFound",
localePar));
}
Locale locale = PartyWorker.findPartyLastLocale(partyId, delegator);
@@ -1189,34 +1216,41 @@ public class ShipmentServices {
sendResp = dispatcher.runSync("sendMailFromScreen", sendMap);
} catch (Exception e) {
Debug.logError(e, "Problem sending mail", module);
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", locale));
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", localePar));
}
// check for errors
if (sendResp != null && ServiceUtil.isError(sendResp)) {
sendResp.put("emailType", "PRDS_ODR_SHIP_COMPLT");
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", locale), null, null, sendResp);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderProblemSendingEmail", localePar), null, null, sendResp);
}
return sendResp;
}
- public static Map<String, Object>
getShipmentGatewayConfigFromShipment(Delegator delegator, String shipmentId) {
+ public static Map<String, Object>
getShipmentGatewayConfigFromShipment(Delegator delegator, String shipmentId,
Locale locale) {
Map<String, Object> shipmentGatewayConfig =
ServiceUtil.returnSuccess();
try {
GenericValue shipment = delegator.findOne("Shipment",
UtilMisc.toMap("shipmentId", shipmentId), false);
if (shipment == null) {
- return ServiceUtil.returnError("Shipment not found with ID " +
shipmentId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentNotFoundId", locale) + shipmentId);
}
GenericValue primaryOrderHeader =
shipment.getRelatedOne("PrimaryOrderHeader");
if (primaryOrderHeader == null) {
- return ServiceUtil.returnError("Cannot found primary order
header for shipment with ID " + shipmentId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductShipmentPrimaryOrderHeaderNotFound",
+ UtilMisc.toMap("shipmentId", shipmentId), locale));
}
String productStoreId =
primaryOrderHeader.getString("productStoreId");
if (UtilValidate.isEmpty(productStoreId)) {
- return ServiceUtil.returnError("Cannot found productStoreId
for shipment with ID " + shipmentId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+
"ProductShipmentPrimaryOrderHeaderProductStoreNotFound",
+ UtilMisc.toMap("productStoreId", productStoreId,
"shipmentId", shipmentId), locale));
}
GenericValue primaryOrderItemShipGroup =
shipment.getRelatedOne("PrimaryOrderItemShipGroup");
if (primaryOrderItemShipGroup == null) {
- return ServiceUtil.returnError("Cannot found primary order
item ship group for shipment with ID " + shipmentId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+
"ProductShipmentPrimaryOrderHeaderItemShipGroupNotFound",
+ UtilMisc.toMap("shipmentId", shipmentId), locale));
}
String shipmentMethodTypeId =
primaryOrderItemShipGroup.getString("shipmentMethodTypeId");
String carrierPartyId =
primaryOrderItemShipGroup.getString("carrierPartyId");
@@ -1233,10 +1267,14 @@ public class ShipmentServices {
shipmentGatewayConfig.put("shipmentGatewayConfigId",
productStoreShipmentMeth.getString("shipmentGatewayConfigId"));
shipmentGatewayConfig.put("configProps",
productStoreShipmentMeth.getString("configProps"));
} else {
- return ServiceUtil.returnError("Cannot found product store
shipment meth for shipment with ID " + shipmentId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "ProductStoreShipmentMethodNotFound",
+ UtilMisc.toMap("shipmentId", shipmentId), locale));
}
} catch (Exception e) {
- return ServiceUtil.returnError("Error in
getShipmentGatewayConfigFromShipment : " + e.getMessage());
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "FacilityShipmentGatewayConfigFromShipmentError",
+ UtilMisc.toMap("errorString", e.getMessage()), locale));
}
return shipmentGatewayConfig;
}
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
Fri Jan 7 18:28:39 2011
@@ -512,7 +512,7 @@ public class DhlServices {
String shipmentId = (String) context.get("shipmentId");
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
Fri Jan 7 18:28:39 2011
@@ -413,7 +413,7 @@ public class FedexServices {
String shipmentId = (String) context.get("shipmentId");
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
Fri Jan 7 18:28:39 2011
@@ -102,7 +102,7 @@ public class UpsServices {
String shipmentId = (String) context.get("shipmentId");
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -826,7 +826,7 @@ public class UpsServices {
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
Locale locale = (Locale) context.get("locale");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -1263,7 +1263,7 @@ public class UpsServices {
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
Locale locale = (Locale) context.get("locale");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -1468,7 +1468,7 @@ public class UpsServices {
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
Locale locale = (Locale) context.get("locale");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -2390,7 +2390,7 @@ public class UpsServices {
Locale locale = (Locale) context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -2787,7 +2787,7 @@ public class UpsServices {
String productStoreId = (String) context.get("productStoreId");
List<Map<String, Object>> shippingRates = FastList.newInstance();
GenericValue shipmentRouteSegment = null;
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=1056444&r1=1056443&r2=1056444&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
Fri Jan 7 18:28:39 2011
@@ -926,7 +926,7 @@ public class UspsServices {
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
Locale locale = (Locale) context.get("locale");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {
@@ -1229,7 +1229,7 @@ public class UspsServices {
String shipmentRouteSegmentId = (String)
context.get("shipmentRouteSegmentId");
Locale locale = (Locale) context.get("locale");
- Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId);
+ Map<String, Object> shipmentGatewayConfig =
ShipmentServices.getShipmentGatewayConfigFromShipment(delegator, shipmentId,
locale);
String shipmentGatewayConfigId = (String)
shipmentGatewayConfig.get("shipmentGatewayConfigId");
String resource = (String) shipmentGatewayConfig.get("configProps");
if (UtilValidate.isEmpty(shipmentGatewayConfigId) &&
UtilValidate.isEmpty(resource)) {