You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/09/25 06:09:21 UTC
svn commit: r818713 - in
/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay: EbayHelper.java
ImportOrdersFromEbay.java
Author: ashish
Date: Fri Sep 25 04:09:21 2009
New Revision: 818713
URL: http://svn.apache.org/viewvc?rev=818713&view=rev
Log:
Encouraging use of Generics.
Modified:
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java?rev=818713&r1=818712&r2=818713&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java Fri Sep 25 04:09:21 2009
@@ -183,14 +183,14 @@
public static boolean createPaymentFromPaymentPreferences(GenericDelegator delegator, LocalDispatcher dispatcher, GenericValue userLogin,
String orderId, String externalId, Timestamp orderDate, String partyIdFrom) {
- List paymentPreferences = null;
+ List<GenericValue> paymentPreferences = null;
try {
- Map paymentFields = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_RECEIVED",
+ Map<String, String> paymentFields = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_RECEIVED",
"paymentMethodTypeId", "EXT_EBAY");
paymentPreferences = delegator.findByAnd("OrderPaymentPreference", paymentFields);
if (UtilValidate.isNotEmpty(paymentPreferences)) {
- Iterator i = paymentPreferences.iterator();
+ Iterator<GenericValue> i = paymentPreferences.iterator();
while (i.hasNext()) {
GenericValue pref = (GenericValue) i.next();
boolean okay = createPayment(dispatcher, userLogin, pref, orderId, externalId, orderDate, partyIdFrom);
@@ -224,7 +224,7 @@
delegator.createOrStore(response);
// create the payment
- Map results = dispatcher.runSync("createPaymentFromPreference", UtilMisc.toMap("userLogin", userLogin,
+ Map<String, Object> results = dispatcher.runSync("createPaymentFromPreference", UtilMisc.toMap("userLogin", userLogin,
"orderPaymentPreferenceId", paymentPreference.get("orderPaymentPreferenceId"), "paymentFromId",
partyIdFrom, "paymentRefNum", externalId, "comments", "Payment receive via eBay"));
@@ -251,7 +251,7 @@
shipGroupSeqId = "_NA_";
}
- Map inputMap = UtilMisc.toMap("orderAdjustmentTypeId", orderAdjustmentTypeId, "orderId", orderId,
+ Map<String, Object> inputMap = UtilMisc.toMap("orderAdjustmentTypeId", orderAdjustmentTypeId, "orderId", orderId,
"orderItemSeqId", orderItemSeqId, "shipGroupSeqId", shipGroupSeqId, "amount",
new BigDecimal(amount));
if (sourcePercentage != 0) {
@@ -283,7 +283,7 @@
lastName = name;
}
- Map summaryResult = dispatcher.runSync("createPerson", UtilMisc.<String, Object> toMap("description",
+ Map<String, Object> summaryResult = dispatcher.runSync("createPerson", UtilMisc.<String, Object> toMap("description",
name, "firstName", firstName, "lastName", lastName, "userLogin", userLogin, "comments",
"Created via eBay"));
partyId = (String) summaryResult.get("partyId");
@@ -296,11 +296,11 @@
}
public static String createAddress(LocalDispatcher dispatcher, String partyId, GenericValue userLogin,
- String contactMechPurposeTypeId, Map address) {
+ String contactMechPurposeTypeId, Map<String, Object> address) {
Debug.logInfo("Creating postal address with input map: " + address, module);
String contactMechId = null;
try {
- Map context = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
context.put("partyId", partyId);
context.put("toName", (String) address.get("buyerName"));
context.put("address1", (String) address.get("shippingAddressStreet1"));
@@ -314,7 +314,7 @@
String city = (String) address.get("shippingAddressCityName");
correctCityStateCountry(dispatcher, context, city, state, country);
- Map summaryResult = dispatcher.runSync("createPartyPostalAddress", context);
+ Map<String, Object> summaryResult = dispatcher.runSync("createPartyPostalAddress", context);
contactMechId = (String) summaryResult.get("contactMechId");
// Set also as a billing address
context = FastMap.newInstance();
@@ -329,8 +329,7 @@
return contactMechId;
}
- public static void correctCityStateCountry(LocalDispatcher dispatcher, Map map, String city, String state,
- String country) {
+ public static void correctCityStateCountry(LocalDispatcher dispatcher, Map<String, Object> map, String city, String state, String country) {
try {
String geoCode = null;
Debug.logInfo("correctCityStateCountry params: " + city + ", " + state + ", " + country, module);
@@ -345,7 +344,7 @@
geoCode = country;
}
Debug.logInfo("GeoCode: " + geoCode, module);
- Map outMap = getCountryGeoId(dispatcher.getDelegator(), geoCode);
+ Map<String, Object> outMap = getCountryGeoId(dispatcher.getDelegator(), geoCode);
String geoId = (String) outMap.get("geoId");
if (UtilValidate.isEmpty(geoId)) {
geoId = "USA";
@@ -369,8 +368,8 @@
public static String createPartyPhone(LocalDispatcher dispatcher, String partyId, String phoneNumber,
GenericValue userLogin) {
- Map summaryResult = FastMap.newInstance();
- Map context = FastMap.newInstance();
+ Map<String, Object> summaryResult = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
String phoneContactMechId = null;
try {
@@ -387,8 +386,8 @@
}
public static String createPartyEmail(LocalDispatcher dispatcher, String partyId, String email, GenericValue userLogin) {
- Map context = FastMap.newInstance();
- Map summaryResult = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> summaryResult = FastMap.newInstance();
String emailContactMechId = null;
try {
@@ -415,8 +414,8 @@
public static void createEbayCustomer(LocalDispatcher dispatcher, String partyId, String ebayUserIdBuyer, String eias,
GenericValue userLogin) {
- Map context = FastMap.newInstance();
- Map summaryResult = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> summaryResult = FastMap.newInstance();
if (UtilValidate.isNotEmpty(eias)) {
try {
context.put("partyId", partyId);
@@ -443,7 +442,7 @@
}
}
- public static Map getCountryGeoId(GenericDelegator delegator, String geoCode) {
+ public static Map<String, Object> getCountryGeoId(GenericDelegator delegator, String geoCode) {
GenericValue geo = null;
try {
Debug.logInfo("geocode: " + geoCode, module);
@@ -467,22 +466,22 @@
return ServiceUtil.returnError(errMsg);
}
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("geoId", (String) geo.get("geoId"));
return result;
}
public static String setShippingAddressContactMech(LocalDispatcher dispatcher, GenericDelegator delegator,
- GenericValue party, GenericValue userLogin, Map context) {
+ GenericValue party, GenericValue userLogin, Map<String, Object> context) {
String contactMechId = null;
String partyId = (String) party.get("partyId");
// find all contact mechs for this party with a shipping location
// purpose.
- Collection shippingLocations = ContactHelper.getContactMechByPurpose(party, "SHIPPING_LOCATION", false);
+ Collection<GenericValue> shippingLocations = ContactHelper.getContactMechByPurpose(party, "SHIPPING_LOCATION", false);
// check them to see if one matches
- Iterator shippingLocationsIterator = shippingLocations.iterator();
+ Iterator<GenericValue> shippingLocationsIterator = shippingLocations.iterator();
while (shippingLocationsIterator.hasNext()) {
GenericValue shippingLocation = (GenericValue) shippingLocationsIterator.next();
contactMechId = shippingLocation.getString("contactMechId");
@@ -521,15 +520,15 @@
}
public static String setEmailContactMech(LocalDispatcher dispatcher, GenericDelegator delegator,
- GenericValue party, GenericValue userLogin, Map context) {
+ GenericValue party, GenericValue userLogin, Map<String, Object> context) {
String contactMechId = null;
String partyId = (String) party.get("partyId");
// find all contact mechs for this party with a email address purpose.
- Collection emailAddressContactMechs = ContactHelper.getContactMechByPurpose(party, "OTHER_EMAIL", false);
+ Collection<GenericValue> emailAddressContactMechs = ContactHelper.getContactMechByPurpose(party, "OTHER_EMAIL", false);
// check them to see if one matches
- Iterator emailAddressesContactMechsIterator = emailAddressContactMechs.iterator();
+ Iterator<GenericValue> emailAddressesContactMechsIterator = emailAddressContactMechs.iterator();
while (emailAddressesContactMechsIterator.hasNext()) {
GenericValue emailAddressContactMech = (GenericValue) emailAddressesContactMechsIterator.next();
contactMechId = emailAddressContactMech.getString("contactMechId");
@@ -546,15 +545,15 @@
}
public static String setPhoneContactMech(LocalDispatcher dispatcher, GenericDelegator delegator,
- GenericValue party, GenericValue userLogin, Map context) {
+ GenericValue party, GenericValue userLogin, Map<String, Object> context) {
String contactMechId = null;
String partyId = (String) party.get("partyId");
// find all contact mechs for this party with a telecom number purpose.
- Collection phoneNumbers = ContactHelper.getContactMechByPurpose(party, "PHONE_SHIPPING", false);
+ Collection<GenericValue> phoneNumbers = ContactHelper.getContactMechByPurpose(party, "PHONE_SHIPPING", false);
// check them to see if one matches
- Iterator phoneNumbersIterator = phoneNumbers.iterator();
+ Iterator<GenericValue> phoneNumbersIterator = phoneNumbers.iterator();
while (phoneNumbersIterator.hasNext()) {
GenericValue phoneNumberContactMech = (GenericValue) phoneNumbersIterator.next();
contactMechId = phoneNumberContactMech.getString("contactMechId");
@@ -584,7 +583,7 @@
String productId = "";
try {
// First try to get an exact match: title == internalName
- List products = delegator.findByAnd("Product", UtilMisc.toMap("internalName", title));
+ List<GenericValue> products = delegator.findByAnd("Product", UtilMisc.toMap("internalName", title));
if (UtilValidate.isNotEmpty(products) && products.size() == 1) {
productId = (String) ((GenericValue)products.get(0)).get("productId");
}
Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=818713&r1=818712&r2=818713&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Fri Sep 25 04:09:21 2009
@@ -22,13 +22,13 @@
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
@@ -44,9 +44,7 @@
import org.ofbiz.order.order.OrderChangeHelper;
import org.ofbiz.order.shoppingcart.CheckOutHelper;
import org.ofbiz.order.shoppingcart.ShoppingCart;
-import org.ofbiz.party.contact.ContactHelper;
import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceUtil;
@@ -58,11 +56,11 @@
private static final String resource = "EbayUiLabels";
private static final String module = ImportOrdersFromEbay.class.getName();
- public static Map importOrdersSearchFromEbay(DispatchContext dctx, Map context) {
+ public static Map<String, Object> importOrdersSearchFromEbay(DispatchContext dctx, Map<String, Object> context) {
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
- Map result = FastMap.newInstance();
+ Map<String, Object> result = FastMap.newInstance();
try {
Map<String, Object> eBayConfigResult = EbayHelper.buildEbayConfig(context, delegator);
StringBuffer sellerTransactionsItemsXml = new StringBuffer();
@@ -82,12 +80,12 @@
return result;
}
- public static Map importOrderFromEbay(DispatchContext dctx, Map context) {
+ public static Map<String, Object> importOrderFromEbay(DispatchContext dctx, Map<String, Object> context) {
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
- Map order = FastMap.newInstance();
- Map result = FastMap.newInstance();
+ Map<String, Object> order = FastMap.newInstance();
+ Map<String, Object> result = FastMap.newInstance();
try {
order.put("productStoreId", (String) context.get("productStoreId"));
order.put("userLogin", (GenericValue) context.get("userLogin"));
@@ -183,9 +181,9 @@
return ServiceUtil.returnSuccess();
}
- private static Map checkOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String response) {
+ private static Map<String, Object> checkOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map<String, Object> context, String response) {
StringBuffer errorMessage = new StringBuffer();
- List orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator, errorMessage);
+ List<Map<String, Object>> orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator, errorMessage);
if (orders == null) {
Debug.logError("Error :" + errorMessage.toString(), module);
return ServiceUtil.returnFailure(errorMessage.toString());
@@ -193,12 +191,12 @@
Debug.logError("No orders found", module);
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.noOrdersFound", locale));
} else {
- Iterator orderIter = orders.iterator();
+ Iterator<Map<String, Object>> orderIter = orders.iterator();
while (orderIter.hasNext()) {
- Map order = (Map)orderIter.next();
+ Map<String, Object> order = (Map<String, Object>) orderIter.next();
order.put("productStoreId", (String) context.get("productStoreId"));
order.put("userLogin", (GenericValue) context.get("userLogin"));
- Map error = createShoppingCart(delegator, dispatcher, locale, order, false);
+ Map<String, Object> error = createShoppingCart(delegator, dispatcher, locale, order, false);
String errorMsg = ServiceUtil.getErrorMessage(error);
if (UtilValidate.isNotEmpty(errorMsg)) {
order.put("errorMessage", errorMsg);
@@ -206,14 +204,14 @@
order.put("errorMessage", "");
}
}
- Map result = FastMap.newInstance();
+ Map<String, Object> result = FastMap.newInstance();
result.put("responseMessage", ModelService.RESPOND_SUCCESS);
result.put("orderList", orders);
return result;
}
}
- private static Map buildGetSellerTransactionsRequest(Map context, StringBuffer dataItemsXml, String token) {
+ private static Map<String, Object> buildGetSellerTransactionsRequest(Map<String, Object> context, StringBuffer dataItemsXml, String token) {
Locale locale = (Locale)context.get("locale");
String fromDate = (String)context.get("fromDate");
String thruDate = (String)context.get("thruDate");
@@ -251,7 +249,7 @@
return ServiceUtil.returnSuccess();
}
- public static Map buildCompleteSaleRequest(GenericDelegator delegator, Locale locale, String itemId, String transactionId, Map context, StringBuffer dataItemsXml, String token) {
+ public static Map<String, Object> buildCompleteSaleRequest(GenericDelegator delegator, Locale locale, String itemId, String transactionId, Map<String, Object> context, StringBuffer dataItemsXml, String token) {
String paid = (String)context.get("paid");
String shipped = (String)context.get("shipped");
@@ -304,15 +302,15 @@
return ServiceUtil.returnSuccess();
}
- private static Map readCompleteSaleResponse(String msg, Locale locale) {
+ private static Map<String, Object> readCompleteSaleResponse(String msg, Locale locale) {
try {
Document docResponse = UtilXml.readXmlDocument(msg, true);
Element elemResponse = docResponse.getDocumentElement();
String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure");
if (ack != null && "Failure".equals(ack)) {
String errorMessage = "";
- List errorList = UtilXml.childElementList(elemResponse, "Errors");
- Iterator errorElemIter = errorList.iterator();
+ List<? extends Element> errorList = UtilXml.childElementList(elemResponse, "Errors");
+ Iterator<? extends Element> errorElemIter = errorList.iterator();
while (errorElemIter.hasNext()) {
Element errorElement = (Element) errorElemIter.next();
errorMessage = UtilXml.childElementValue(errorElement, "ShortMessage", "");
@@ -325,17 +323,17 @@
return ServiceUtil.returnSuccess();
}
- private static List readResponseFromEbay(String msg, Locale locale, String productStoreId, GenericDelegator delegator, StringBuffer errorMessage) {
- List orders = null;
+ private static List<Map<String, Object>> readResponseFromEbay(String msg, Locale locale, String productStoreId, GenericDelegator delegator, StringBuffer errorMessage) {
+ List<Map<String, Object>> orders = null;
try {
Document docResponse = UtilXml.readXmlDocument(msg, true);
//Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module);
Element elemResponse = docResponse.getDocumentElement();
String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure");
- List paginationList = UtilXml.childElementList(elemResponse, "PaginationResult");
+ List<? extends Element> paginationList = UtilXml.childElementList(elemResponse, "PaginationResult");
int totalOrders = 0;
- Iterator paginationElemIter = paginationList.iterator();
+ Iterator<? extends Element> paginationElemIter = paginationList.iterator();
while (paginationElemIter.hasNext()) {
Element paginationElement = (Element) paginationElemIter.next();
String totalNumberOfEntries = UtilXml.childElementValue(paginationElement, "TotalNumberOfEntries", "0");
@@ -343,31 +341,31 @@
}
if (ack != null && "Success".equals(ack)) {
- orders = new ArrayList();
+ orders = FastList.newInstance();
if (totalOrders > 0) {
// retrieve transaction array
- List transactions = UtilXml.childElementList(elemResponse, "TransactionArray");
- Iterator transactionsElemIter = transactions.iterator();
+ List<? extends Element> transactions = UtilXml.childElementList(elemResponse, "TransactionArray");
+ Iterator<? extends Element> transactionsElemIter = transactions.iterator();
while (transactionsElemIter.hasNext()) {
Element transactionsElement = (Element) transactionsElemIter.next();
// retrieve transaction
- List transaction = UtilXml.childElementList(transactionsElement, "Transaction");
- Iterator transactionElemIter = transaction.iterator();
+ List<? extends Element> transaction = UtilXml.childElementList(transactionsElement, "Transaction");
+ Iterator<? extends Element> transactionElemIter = transaction.iterator();
while (transactionElemIter.hasNext()) {
- Map order = FastMap.newInstance();
+ Map<String, Object> order = FastMap.newInstance();
String itemId = "";
Element transactionElement = (Element) transactionElemIter.next();
- List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder");
+ List<? extends Element> containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder");
if (containingOrders != null && containingOrders.size() > 0) {
continue;
}
order.put("amountPaid", UtilXml.childElementValue(transactionElement, "AmountPaid", "0"));
// retrieve buyer
- List buyer = UtilXml.childElementList(transactionElement, "Buyer");
- Iterator buyerElemIter = buyer.iterator();
+ List<? extends Element> buyer = UtilXml.childElementList(transactionElement, "Buyer");
+ Iterator<? extends Element> buyerElemIter = buyer.iterator();
while (buyerElemIter.hasNext()) {
Element buyerElement = (Element)buyerElemIter.next();
order.put("emailBuyer", UtilXml.childElementValue(buyerElement, "Email", ""));
@@ -375,14 +373,14 @@
order.put("ebayUserIdBuyer", UtilXml.childElementValue(buyerElement, "UserID", ""));
// retrieve buyer information
- List buyerInfo = UtilXml.childElementList(buyerElement, "BuyerInfo");
- Iterator buyerInfoElemIter = buyerInfo.iterator();
+ List<? extends Element> buyerInfo = UtilXml.childElementList(buyerElement, "BuyerInfo");
+ Iterator<? extends Element> buyerInfoElemIter = buyerInfo.iterator();
while (buyerInfoElemIter.hasNext()) {
Element buyerInfoElement = (Element)buyerInfoElemIter.next();
// retrieve shipping address
- List shippingAddressInfo = UtilXml.childElementList(buyerInfoElement, "ShippingAddress");
- Iterator shippingAddressElemIter = shippingAddressInfo.iterator();
+ List<? extends Element> shippingAddressInfo = UtilXml.childElementList(buyerInfoElement, "ShippingAddress");
+ Iterator<? extends Element> shippingAddressElemIter = shippingAddressInfo.iterator();
while (shippingAddressElemIter.hasNext()) {
Element shippingAddressElement = (Element)shippingAddressElemIter.next();
order.put("buyerName", UtilXml.childElementValue(shippingAddressElement, "Name", ""));
@@ -400,8 +398,8 @@
}
// retrieve shipping details
- List shippingDetails = UtilXml.childElementList(transactionElement, "ShippingDetails");
- Iterator shippingDetailsElemIter = shippingDetails.iterator();
+ List<? extends Element> shippingDetails = UtilXml.childElementList(transactionElement, "ShippingDetails");
+ Iterator<? extends Element> shippingDetailsElemIter = shippingDetails.iterator();
while (shippingDetailsElemIter.hasNext()) {
Element shippingDetailsElement = (Element)shippingDetailsElemIter.next();
order.put("insuranceFee", UtilXml.childElementValue(shippingDetailsElement, "InsuranceFee", "0"));
@@ -409,8 +407,8 @@
order.put("insuranceWanted", UtilXml.childElementValue(shippingDetailsElement, "InsuranceWanted", "false"));
// retrieve sales Tax
- List salesTax = UtilXml.childElementList(shippingDetailsElement, "SalesTax");
- Iterator salesTaxElemIter = salesTax.iterator();
+ List<? extends Element> salesTax = UtilXml.childElementList(shippingDetailsElement, "SalesTax");
+ Iterator<? extends Element> salesTaxElemIter = salesTax.iterator();
while (salesTaxElemIter.hasNext()) {
Element salesTaxElement = (Element)salesTaxElemIter.next();
order.put("salesTaxAmount", UtilXml.childElementValue(salesTaxElement, "SalesTaxAmount", "0"));
@@ -420,13 +418,13 @@
}
// retrieve tax table
- List taxTable = UtilXml.childElementList(shippingDetailsElement, "TaxTable");
- Iterator taxTableElemIter = taxTable.iterator();
+ List<? extends Element> taxTable = UtilXml.childElementList(shippingDetailsElement, "TaxTable");
+ Iterator<? extends Element> taxTableElemIter = taxTable.iterator();
while (taxTableElemIter.hasNext()) {
Element taxTableElement = (Element)taxTableElemIter.next();
- List taxJurisdiction = UtilXml.childElementList(taxTableElement, "TaxJurisdiction");
- Iterator taxJurisdictionElemIter = taxJurisdiction.iterator();
+ List<? extends Element> taxJurisdiction = UtilXml.childElementList(taxTableElement, "TaxJurisdiction");
+ Iterator<? extends Element> taxJurisdictionElemIter = taxJurisdiction.iterator();
while (taxJurisdictionElemIter.hasNext()) {
Element taxJurisdictionElement = (Element)taxJurisdictionElemIter.next();
@@ -441,8 +439,8 @@
order.put("createdDate", UtilXml.childElementValue(transactionElement, "CreatedDate", ""));
// retrieve item
- List item = UtilXml.childElementList(transactionElement, "Item");
- Iterator itemElemIter = item.iterator();
+ List<? extends Element> item = UtilXml.childElementList(transactionElement, "Item");
+ Iterator<? extends Element> itemElemIter = item.iterator();
while (itemElemIter.hasNext()) {
Element itemElement = (Element)itemElemIter.next();
itemId = UtilXml.childElementValue(itemElement, "ItemID", "");
@@ -461,8 +459,8 @@
order.put("productId", productId);
// retrieve selling status
- List sellingStatus = UtilXml.childElementList(itemElement, "SellingStatus");
- Iterator sellingStatusitemElemIter = sellingStatus.iterator();
+ List<? extends Element> sellingStatus = UtilXml.childElementList(itemElement, "SellingStatus");
+ Iterator<? extends Element> sellingStatusitemElemIter = sellingStatus.iterator();
while (sellingStatusitemElemIter.hasNext()) {
Element sellingStatusElement = (Element)sellingStatusitemElemIter.next();
order.put("amount", UtilXml.childElementValue(sellingStatusElement, "CurrentPrice", "0"));
@@ -475,8 +473,8 @@
order.put("quantityPurchased", UtilXml.childElementValue(transactionElement, "QuantityPurchased", "0"));
// retrieve status
- List status = UtilXml.childElementList(transactionElement, "Status");
- Iterator statusElemIter = status.iterator();
+ List<? extends Element> status = UtilXml.childElementList(transactionElement, "Status");
+ Iterator<? extends Element> statusElemIter = status.iterator();
while (statusElemIter.hasNext()) {
Element statusElement = (Element)statusElemIter.next();
order.put("eBayPaymentStatus", UtilXml.childElementValue(statusElement, "eBayPaymentStatus", ""));
@@ -504,8 +502,8 @@
order.put("transactionPrice", UtilXml.childElementValue(transactionElement, "TransactionPrice", "0"));
// retrieve external transaction
- List externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction");
- Iterator externalTransactionElemIter = externalTransaction.iterator();
+ List<? extends Element> externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction");
+ Iterator<? extends Element> externalTransactionElemIter = externalTransaction.iterator();
while (externalTransactionElemIter.hasNext()) {
Element externalTransactionElement = (Element)externalTransactionElemIter.next();
order.put("externalTransactionID", UtilXml.childElementValue(externalTransactionElement, "ExternalTransactionID", ""));
@@ -515,8 +513,8 @@
}
// retrieve shipping service selected
- List shippingServiceSelected = UtilXml.childElementList(transactionElement, "ShippingServiceSelected");
- Iterator shippingServiceSelectedElemIter = shippingServiceSelected.iterator();
+ List<? extends Element> shippingServiceSelected = UtilXml.childElementList(transactionElement, "ShippingServiceSelected");
+ Iterator<? extends Element> shippingServiceSelectedElemIter = shippingServiceSelected.iterator();
while (shippingServiceSelectedElemIter.hasNext()) {
Element shippingServiceSelectedElement = (Element)shippingServiceSelectedElemIter.next();
order.put("shippingService", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingService", ""));
@@ -560,8 +558,8 @@
}
}
} else {
- List errorList = UtilXml.childElementList(elemResponse, "Errors");
- Iterator errorElemIter = errorList.iterator();
+ List<? extends Element> errorList = UtilXml.childElementList(elemResponse, "Errors");
+ Iterator<? extends Element> errorElemIter = errorList.iterator();
while (errorElemIter.hasNext()) {
Element errorElement = (Element) errorElemIter.next();
errorMessage.append(UtilXml.childElementValue(errorElement, "ShortMessage", ""));
@@ -573,7 +571,7 @@
return orders;
}
- private static Map createShoppingCart(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map parameters, boolean create) {
+ private static Map<String, Object> createShoppingCart(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map<String, Object> parameters, boolean create) {
try {
String productStoreId = (String) parameters.get("productStoreId");
GenericValue userLogin = (GenericValue) parameters.get("userLogin");
@@ -814,7 +812,7 @@
private static GenericValue externalOrderExists(GenericDelegator delegator, String externalId, String transactionId) throws GenericEntityException {
Debug.logInfo("Checking for existing externalId: " + externalId +" and transactionId: " + transactionId, module);
GenericValue orderHeader = null;
- List entities = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "transactionId", transactionId));
+ List<GenericValue> entities = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "transactionId", transactionId));
if (UtilValidate.isNotEmpty(entities)) {
orderHeader = EntityUtil.getFirst(entities);
}