Author: jacopoc
Date: Fri Jul 20 01:08:16 2007 New Revision: 557918 URL: http://svn.apache.org/viewvc?view=rev&rev=557918 Log: New patch by Marco Risaliti (OFBIZ-1159) with new stuff for the eBay integration (still in progress). Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels_it.properties ofbiz/trunk/applications/order/config/OrderUiLabels.properties ofbiz/trunk/applications/order/config/OrderUiLabels_it.properties ofbiz/trunk/applications/order/servicedef/services.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ImportOrdersFromEbay.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml ofbiz/trunk/applications/order/webapp/ordermgr/order/OrderForms.xml ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties ofbiz/trunk/applications/product/config/productsExport.properties ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToEbay.java ofbiz/trunk/framework/common/config/CommonUiLabels_it.properties Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties (original) +++ ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties Fri Jul 20 01:08:16 2007 @@ -172,8 +172,6 @@ OrderPurchaseOrderNumber=Purchase Order Number OrderQtyCanceled=Qty Cancelled OrderQtyOrdered=Qty Ordered -OrderQtyPicked=Qty Picked -OrderQtyShipped=Qty Shipped OrderQuote=Quote OrderReason=Reason OrderRequestReturn=Request Return Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels_it.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels_it.properties (original) +++ ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels_it.properties Fri Jul 20 01:08:16 2007 @@ -164,8 +164,6 @@ OrderPurchaseOrderNumber=Numero Ordine Acquisto OrderQtyCanceled=Qnt Cancellata OrderQtyOrdered=Qnt Ordinata -OrderQtyPicked=Qnt Prelevata -OrderQtyShipped=Qnt Spedita OrderQuote=Preventivo OrderReason=Motivazione OrderRequestReturn=Motivazione Reso Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/config/OrderUiLabels.properties (original) +++ ofbiz/trunk/applications/order/config/OrderUiLabels.properties Fri Jul 20 01:08:16 2007 @@ -291,12 +291,16 @@ FacilityShippingAndHandling=Shipping and Handling FacilitySpecialInstructions=Special Instructions FacilityWaitEntireOrderReady=Please wait until the entire order is ready before shipping. +FormFieldTitle_amountPaid=Amount Paid FormFieldTitle_billToCustomerPartyId=Bill To Customer Party Id FormFieldTitle_billingAccountId=Billing Account Id +FormFieldTitle_buyerName=Buyer Name FormFieldTitle_carrierPartyId=Carrier Party Id FormFieldTitle_carrierRoleTypeId=Carrier Role Type Id FormFieldTitle_cartons=Cartons +FormFieldTitle_checkoutStatus=Checkout Status FormFieldTitle_city=City +FormFieldTitle_completeStatus=Payment Sent by Buyer FormFieldTitle_contactMechId=Contact Mech Id FormFieldTitle_countryGeoId=Country Geo Id FormFieldTitle_createdBy=Created By @@ -310,7 +314,10 @@ FormFieldTitle_custRequestTypeId=Cust Request Type Id FormFieldTitle_deleteLink=Delete Link FormFieldTitle_deliverableId=Deliverable Id +FormFieldTitle_eBayPaymentStatus=eBay Payment Status +FormFieldTitle_emailBuyer=Buyer Email FormFieldTitle_entryDate=Entry Date +FormFieldTitle_errorMessage=Error Message FormFieldTitle_estimatedBudget=Estimated Budget FormFieldTitle_estimatedReadyDate=Estimated Ready Date FormFieldTitle_externalId=External Id @@ -329,6 +336,7 @@ FormFieldTitle_lastModifiedByUserLogin=Last Modified By User Login FormFieldTitle_lastModifiedDate=Last Modified Date FormFieldTitle_lastOrderedDate=Last Ordered Date +FormFieldTitle_listingStatus=Listing Status FormFieldTitle_listName=List Name FormFieldTitle_maximumAmount=Maximum Amount FormFieldTitle_needsInventoryIssuance=Needs Inventory Issuance @@ -341,9 +349,11 @@ FormFieldTitle_orderTypeId=Order Type Id FormFieldTitle_ordersLink=Orders Link FormFieldTitle_originFacilityId=Origin Facility Id +FormFieldTitle_paidTime=Date/Time Payment Received FormFieldTitle_parentShoppingListId=Parent Shopping List Id FormFieldTitle_partyId=Party Id FormFieldTitle_paymentMethodId=Payment Method Id +FormFieldTitle_paymentMethodUsed=Payment Method Used FormFieldTitle_postalCode=Postal Code FormFieldTitle_priority=Priority FormFieldTitle_productFeatureId=Product Feature Id @@ -367,6 +377,9 @@ FormFieldTitle_sendTo=Send To FormFieldTitle_shipAfterDate=Ship After Date FormFieldTitle_shipByDate=Ship By Date +FormFieldTitle_shippingServiceCost=Shipping Service Cost +FormFieldTitle_shippedTime=Date/Time Shipment +FormFieldTitle_shippingTotalAdditionalCost=Shipping Additional Costs FormFieldTitle_shipmentMethodTypeId=Shipment Method Type Id FormFieldTitle_shoppingListId=Shopping List Id FormFieldTitle_shoppingListTypeId=Shopping List Type Id @@ -489,6 +502,7 @@ OrderHold=Hold Order OrderImage=Image OrderImportOrdersFromEbay=Import Orders From eBay +OrderImportOrdersSearchFromEbay=Search Orders To Import From eBay OrderImportEbayItem=Item Id OrderInProduction=In Production OrderInProgress=In Progress @@ -694,6 +708,8 @@ OrderPurchaseReportOptions=Order Purchase Report Options OrderPurchasedFrom=Purchased From OrderQty=Qty +OrderQtyPicked=Qty Picked +OrderQtyShipped=Qty Shipped OrderQuantity=Quantity OrderQuantityCancelled=Qty Cncld OrderQuantityInShipGroup=In Group @@ -968,10 +984,15 @@ ordersImportFromEbay.exceptionDuringBuildingGetEbayDetailsReques=Exception during building get eBay details request ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest=Exception during building get seller transactions request -ordersImportFromEbay.exceptionInImportFromEbay=Exception in importFromEbay +ordersImportFromEbay.exceptionInCreateShoppingCart=Exception in createShoppingCart +ordersImportFromEbay.exceptionInImportOrderFromEbay=Exception in importOrderFromEbay +ordersImportFromEbay.exceptionInImportOrdersSearchFromEbay=Exception in importOrdersSearchFromEbay ordersImportFromEbay.externalIdAlreadyExist=ExternalId Already Exists ordersImportFromEbay.externalIdNotAvailable=ExternalId Not Available +ordersImportFromEbay.noOrdersFound=No Orders Found +ordersImportFromEbay.paymentIsStillNotReceived=Before Import the order from eBay you have to receive the payment from the buyer ordersImportFromEbay.productIdNotAvailable=ProductId Not Available +ordersImportFromEbay.productStoreIdIsMandatory=ProductStoreId Is Mandatory # 0=productName, 1=productId product.no_longer_for_sale=Tried to order the Product {0} (productId: {1}). This product is no longer available for sale. Please remove from your order. Modified: ofbiz/trunk/applications/order/config/OrderUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels_it.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/config/OrderUiLabels_it.properties (original) +++ ofbiz/trunk/applications/order/config/OrderUiLabels_it.properties Fri Jul 20 01:08:16 2007 @@ -289,8 +289,8 @@ OrderAgent=Agente Ordine OrderAllowSplit=Permessa la Divisione OrderAmount=Importo -OrderAmountAlreadyCredited=Importo Già Accreditato -OrderAmountAlreadyRefunded=Importo Già Rimborsato +OrderAmountAlreadyCredited=Importo Gi\u00e0 Accreditato +OrderAmountAlreadyRefunded=Importo Gi\u00e0 Rimborsato OrderApproved=Approvato OrderApproveOrder=Approva Ordine(i) OrderApprovedProductRequirements=Approva Fabbisogni Prodotto @@ -373,6 +373,7 @@ OrderHold=Congela Ordine OrderImage = Immagine OrderImportOrdersFromEbay=Importa Ordini Da eBay +OrderImportOrdersSearchFromEbay=Ricerca Ordini Da Importare Da eBay OrderImportEbayItem=Numero Oggetto OrderInProduction = In Produzione OrderInProgress = In Corso @@ -570,7 +571,9 @@ OrderPurchaseOrder = Ordine Acquisto OrderPurchaseReportOptions=Opzioni Stampe Ordine Acquisto OrderQty=Qnt -OrderQuantity = Quantit\u00e0 +OrderQtyPicked=Qnt Prelevata +OrderQtyShipped=Qnt Spedita +OrderQuantity=Quantit\u00e0 OrderQuantityCancelled=Qnt Canc. OrderQuantitySold=Qnt Venduta OrderQuantityPurchase=Qnt Acquisto @@ -846,10 +849,15 @@ ordersImportFromEbay.exceptionDuringBuildingGetEbayDetailsReques=Eccezione durante la creazione della richiesta get eBay details ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest=Eccezione durante la creazione della richiesta get seller transactions -ordersImportFromEbay.exceptionInImportFromEbay=Eccezione in importFromEbay +ordersImportFromEbay.exceptionInCreateShoppingCart=Eccezione in createShoppingCart +ordersImportFromEbay.exceptionInImportOrderFromEbay=Eccezione in importOrderFromEbay +ordersImportFromEbay.exceptionInImportOrdersSearchFromEbay=Eccezione in importOrdersSearchFromEbay ordersImportFromEbay.externalIdAlreadyExist=Numero Ordine Esterno Gi\u00e0 Esistente ordersImportFromEbay.externalIdNotAvailable=Numero Ordine Esterno Non Disponibile +ordersImportFromEbay.noOrdersFound=Nessun Ordine Trovato +ordersImportFromEbay.paymentIsStillNotReceived=Prima di Importare l'ordine da eBay tu devi ricevere il pagamento dal compratore ordersImportFromEbay.productIdNotAvailable=Codice Prodotto Non Disponibile +ordersImportFromEbay.productStoreIdIsMandatory=Codice Negozio \u00e8 Obbligatorio # 0=productId product.not_found=Non \u00e8 possibile trovare il prodotto con codice [{0}], non possono essere acquisti. @@ -961,3 +969,16 @@ FormFieldTitle_unassignedRequirements=Fabbisogni non assegnati FormFieldTitle_requirementByDate=Fabbisogno Per Data FormFieldTitle_internalName=Nome interno +FormFieldTitle_shippingServiceCost=Costo Servizio Spedizione +FormFieldTitle_shippingTotalAdditionalCost=Costi Addizionali Spedizione +FormFieldTitle_amountPaid=Importo Pagato +FormFieldTitle_paidTime=Data/Ora Ricezione Pagamento +FormFieldTitle_shippedTime=Date/Ora Spedizione +FormFieldTitle_errorMessage=Messaggio di Errore +FormFieldTitle_paymentMethodUsed=Metodo Pagamento Scelto +FormFieldTitle_listingStatus=Stato dell'Asta +FormFieldTitle_eBayPaymentStatus=Stato Pagamento su eBay +FormFieldTitle_checkoutStatus=Stato Completamento Asta +FormFieldTitle_completeStatus=Pagamento Inviato dal Compratore +FormFieldTitle_buyerName=Nome Compratore +FormFieldTitle_emailBuyer=Email Compratore \ No newline at end of file Modified: ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services.xml Fri Jul 20 01:08:16 2007 @@ -761,12 +761,37 @@ </service> <!-- Import Orders Services --> - <service name="importFromEbay" engine="java" transaction-timeout="300" - location="org.ofbiz.order.order.ImportOrdersFromEbay" invoke="importFromEbay" auth="true"> - <description>Import Orders from eBay</description> + <service name="importOrdersSearchFromEbay" engine="java" transaction-timeout="300" + location="org.ofbiz.order.order.ImportOrdersFromEbay" invoke="importOrdersSearchFromEbay" auth="true"> + <description>Import Orders Search from eBay</description> <attribute type="String" mode="IN" name="productStoreId" optional="false"/> <attribute type="Timestamp" mode="IN" name="fromDate" optional="false"/> <attribute type="Timestamp" mode="IN" name="thruDate" optional="false"/> <attribute type="List" mode="OUT" name="orderList" optional="true"/> + </service> + + <service name="importOrderFromEbay" engine="java" transaction-timeout="300" + location="org.ofbiz.order.order.ImportOrdersFromEbay" invoke="importOrderFromEbay" auth="true"> + <description>Import Order from eBay</description> + <attribute type="String" mode="IN" name="orderSelected" optional="true"/> + <attribute type="String" mode="IN" name="productStoreId" optional="false"/> + <attribute type="String" mode="IN" name="externalId" optional="false"/> + <attribute type="String" mode="IN" name="createdDate" optional="false"/> + <attribute type="String" mode="IN" name="productId" optional="true"/> + <attribute type="String" mode="IN" name="quantityPurchased" optional="false"/> + <attribute type="String" mode="IN" name="transactionPrice" optional="false"/> + <attribute type="String" mode="IN" name="shippingServiceCost" optional="true"/> + <attribute type="String" mode="IN" name="shippingTotalAdditionalCost" optional="true"/> + <attribute type="String" mode="IN" name="amountPaid" optional="true"/> + <attribute type="String" mode="IN" name="paidTime" optional="true"/> + <attribute type="String" mode="IN" name="shippedTime" optional="true"/> + <attribute type="String" mode="IN" name="buyerName" optional="true"/> + <attribute type="String" mode="IN" name="emailBuyer" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressPhone" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressStreet1" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressPostalCode" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressCountry" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressStateOrProvince" optional="true"/> + <attribute type="String" mode="IN" name="shippingAddressCityName" optional="true"/> </service> </services> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ImportOrdersFromEbay.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ImportOrdersFromEbay.java?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ImportOrdersFromEbay.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ImportOrdersFromEbay.java Fri Jul 20 01:08:16 2007 @@ -45,6 +45,7 @@ import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.shoppingcart.CheckOutHelper; import org.ofbiz.order.shoppingcart.ShoppingCart; import org.ofbiz.service.DispatchContext; @@ -60,7 +61,7 @@ private static final String resource = "OrderUiLabels"; private static final String module = ImportOrdersFromEbay.class.getName(); - public static Map importFromEbay(DispatchContext dctx, Map context) { + public static Map importOrdersSearchFromEbay(DispatchContext dctx, Map context) { GenericDelegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); Locale locale = (Locale) context.get("locale"); @@ -80,6 +81,12 @@ // get the Token String token = UtilProperties.getPropertyValue(configString, "productsExport.eBay.token"); + // get the Compatibility Level + String compatibilityLevel = UtilProperties.getPropertyValue(configString, "productsExport.eBay.compatibilityLevel"); + + // get the Site ID + String siteID = UtilProperties.getPropertyValue(configString, "productsExport.eBay.siteID"); + // get the xmlGatewayUri String xmlGatewayUri = UtilProperties.getPropertyValue(configString, "productsExport.eBay.xmlGatewayUri"); @@ -87,24 +94,65 @@ StringBuffer sellerTransactionsItemsXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildGetEbayDetailsRequest(context, ebayDetailsItemsXml, token))) { - postItem(xmlGatewayUri, ebayDetailsItemsXml, devID, appID, certID, "GeteBayDetails"); + postItem(xmlGatewayUri, ebayDetailsItemsXml, devID, appID, certID, "GeteBayDetails", compatibilityLevel, siteID); if (!ServiceUtil.isFailure(buildGetSellerTransactionsRequest(context, sellerTransactionsItemsXml, token))) { - result = postItem(xmlGatewayUri, sellerTransactionsItemsXml, devID, appID, certID, "GetSellerTransactions"); - String success = (String)result.get("responseMessage"); - if (success != null && success.equals("success")) { - result = createOrders(delegator, dispatcher, locale, context, (String)result.get("successMessage"), true); + result = postItem(xmlGatewayUri, sellerTransactionsItemsXml, devID, appID, certID, "GetSellerTransactions", compatibilityLevel, siteID); + String success = (String)result.get(ModelService.SUCCESS_MESSAGE); + if (success != null) { + result = checkOrders(delegator, dispatcher, locale, context, success); } } } } catch (Exception e) { - Debug.logError("Exception in importFromEbay " + e, module); - return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportFromEbay", locale)); + Debug.logError("Exception in importOrdersSearchFromEbay " + e, module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportOrdersSearchFromEbay", locale)); } return result; } + public static Map importOrderFromEbay(DispatchContext dctx, Map context) { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + Locale locale = (Locale) context.get("locale"); + Map order = FastMap.newInstance(); + Map result = FastMap.newInstance(); + try { + String orderSelected = (String) context.get("orderSelected"); + if (UtilValidate.isNotEmpty(orderSelected) && "Y".equals(orderSelected)) { + order.put("productStoreId", (String) context.get("productStoreId")); + order.put("userLogin", (GenericValue) context.get("userLogin")); + order.put("externalId", (String) context.get("externalId")); + order.put("createdDate", (String) context.get("createdDate")); + order.put("productId", (String) context.get("productId")); + order.put("quantityPurchased", (String) context.get("quantityPurchased")); + order.put("transactionPrice", (String) context.get("transactionPrice")); + order.put("shippingServiceCost", (String) context.get("shippingServiceCost")); + order.put("shippingTotalAdditionalCost", (String) context.get("shippingTotalAdditionalCost")); + order.put("amountPaid", (String) context.get("amountPaid")); + order.put("paidTime", (String) context.get("paidTime")); + order.put("shippedTime", (String) context.get("shippedTime")); + + order.put("buyerName", (String) context.get("buyerName")); + order.put("emailBuyer", (String) context.get("emailBuyer")); + order.put("shippingAddressPhone", (String) context.get("shippingAddressPhone")); + order.put("shippingAddressStreet1", (String) context.get("shippingAddressStreet1")); + order.put("shippingAddressPostalCode", (String) context.get("shippingAddressPostalCode")); + order.put("shippingAddressCountry", (String) context.get("shippingAddressCountry")); + order.put("shippingAddressStateOrProvince", (String) context.get("shippingAddressStateOrProvince")); + order.put("shippingAddressCityName", (String) context.get("shippingAddressCityName")); + + result = createShoppingCart(delegator, dispatcher, locale, order, Boolean.TRUE); + } + } catch (Exception e) { + Debug.logError("Exception in importOrderFromEbay " + e, module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportOrderFromEbay", locale)); + } + + return result; + } + private static String toString(InputStream inputStream) throws IOException { String string; StringBuilder outputBuilder = new StringBuilder(); @@ -117,18 +165,19 @@ return outputBuilder.toString(); } - private static Map postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, String callName) throws IOException { + private static Map postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, + String callName, String compatibilityLevel, String siteID) throws IOException { HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); connection.setDoInput(true); connection.setDoOutput(true); connection.setRequestMethod("POST"); - connection.setRequestProperty("X-EBAY-API-COMPATIBILITY-LEVEL", "517"); + connection.setRequestProperty("X-EBAY-API-COMPATIBILITY-LEVEL", compatibilityLevel); connection.setRequestProperty("X-EBAY-API-DEV-NAME", devID); connection.setRequestProperty("X-EBAY-API-APP-NAME", appID); connection.setRequestProperty("X-EBAY-API-CERT-NAME", certID); connection.setRequestProperty("X-EBAY-API-CALL-NAME", callName); - connection.setRequestProperty("X-EBAY-API-SITEID", "0"); + connection.setRequestProperty("X-EBAY-API-SITEID", siteID); connection.setRequestProperty("Content-Type", "text/xml"); OutputStream outputStream = connection.getOutputStream(); @@ -150,27 +199,32 @@ return result; } - private static Map createOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String response, boolean onlyCheck) { + private static Map checkOrders(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String response) { if (response != null && response.length() > 0) { - List orders = readResponseFromEbay(response, locale); + List orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator); if (orders != null && orders.size() > 0) { - if (!onlyCheck) { - Iterator orderIter = orders.iterator(); - while (orderIter.hasNext()) { - createShoppingCart(delegator, dispatcher, locale, context, (Map)orderIter.next()); + Iterator orderIter = orders.iterator(); + while (orderIter.hasNext()) { + Map order = (Map)orderIter.next(); + order.put("productStoreId", (String) context.get("productStoreId")); + order.put("userLogin", (GenericValue) context.get("userLogin")); + Map error = createShoppingCart(delegator, dispatcher, locale, order, Boolean.FALSE); + String errorMsg = ServiceUtil.getErrorMessage(error); + if (errorMsg != null) { + order.put("errorMessage", errorMsg); } } Map result = FastMap.newInstance(); - result.put("responseMessage", "success"); + result.put("responseMessage", ModelService.RESPOND_SUCCESS); result.put("orderList", orders); return result; } else { - //TODO create a new property in resource - return ServiceUtil.returnFailure("No orders found"); + Debug.logError("No orders found", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.noOrdersFound", locale)); } } else { - //TODO create a new property in resource - return ServiceUtil.returnFailure("No orders found"); + Debug.logError("No orders found", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.noOrdersFound", locale)); } } @@ -219,9 +273,8 @@ UtilXml.addChildElementValue(requesterCredentialsElem, "eBayAuthToken", token, doc); } - private static List readResponseFromEbay(String msg, Locale locale) { + private static List readResponseFromEbay(String msg, Locale locale, String productStoreId, GenericDelegator delegator) { List orders = null; - Debug.logInfo(msg, module); try { Document docResponse = UtilXml.readXmlDocument(msg, true); Element elemResponse = docResponse.getDocumentElement(); @@ -250,6 +303,7 @@ Iterator transactionElemIter = transaction.iterator(); while (transactionElemIter.hasNext()) { Map order = FastMap.newInstance(); + String itemId = ""; Element transactionElement = (Element) transactionElemIter.next(); order.put("amountPaid", UtilXml.childElementValue(transactionElement, "AmountPaid", "0")); @@ -330,7 +384,7 @@ Iterator itemElemIter = item.iterator(); while (itemElemIter.hasNext()) { Element itemElement = (Element)itemElemIter.next(); - order.put("externalId", UtilXml.childElementValue(itemElement, "ItemID", "")); + itemId = UtilXml.childElementValue(itemElement, "ItemID", ""); order.put("paymentMethods", UtilXml.childElementValue(itemElement, "PaymentMethods", "")); order.put("quantity", UtilXml.childElementValue(itemElement, "Quantity", "0")); order.put("productId", UtilXml.childElementValue(itemElement, "SKU", "")); @@ -348,6 +402,9 @@ } } + // retrieve quantity purchased + order.put("quantityPurchased", UtilXml.childElementValue(transactionElement, "QuantityPurchased", "0")); + // retrieve status List status = UtilXml.childElementList(transactionElement, "Status"); Iterator statusElemIter = status.iterator(); @@ -360,6 +417,21 @@ order.put("buyerSelectedShipping", UtilXml.childElementValue(statusElement, "BuyerSelectedShipping", "")); } + // retrieve transactionId + String transactionId = UtilXml.childElementValue(transactionElement, "TransactionID", ""); + + // build the externalId + String externalId = buildExternalId(itemId, transactionId); + order.put("externalId", externalId); + + GenericValue orderExist = externalOrderExists(delegator, externalId); + if (orderExist != null) { + order.put("orderId", (String)orderExist.get("orderId")); + } + + // retrieve transaction price + order.put("transactionPrice", UtilXml.childElementValue(transactionElement, "TransactionPrice", "0")); + // retrieve external transaction List externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction"); Iterator externalTransactionElemIter = externalTransaction.iterator(); @@ -378,6 +450,30 @@ Element shippingServiceSelectedElement = (Element)shippingServiceSelectedElemIter.next(); order.put("shippingService", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingService", "")); order.put("shippingServiceCost", UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingServiceCost", "0")); + + String incuranceCost = UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingInsuranceCost", "0"); + String additionalCost = UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingServiceAdditionalCost", "0"); + String surchargeCost = UtilXml.childElementValue(shippingServiceSelectedElement, "ShippingSurcharge", "0"); + + double shippingInsuranceCost = 0; + double shippingServiceAdditionalCost = 0; + double shippingSurcharge = 0; + + if (UtilValidate.isNotEmpty(incuranceCost)) { + shippingInsuranceCost = new Double(incuranceCost).doubleValue(); + } + + if (UtilValidate.isNotEmpty(additionalCost)) { + shippingServiceAdditionalCost = new Double(additionalCost).doubleValue(); + } + + if (UtilValidate.isNotEmpty(surchargeCost)) { + shippingSurcharge = new Double(surchargeCost).doubleValue(); + } + + double shippingTotalAdditionalCost = shippingInsuranceCost + shippingServiceAdditionalCost + shippingSurcharge; + String totalAdditionalCost = new Double(shippingTotalAdditionalCost).toString(); + order.put("shippingTotalAdditionalCost", totalAdditionalCost); } // retrieve paid time @@ -385,29 +481,30 @@ // retrieve shipped time order.put("shippedTime", UtilXml.childElementValue(transactionElement, "ShippedTime", "")); + + order.put("productStoreId", productStoreId); orders.add(order); } } } } catch (Exception e) { - //TODO ServiceUtil.returnSuccess("Exception in readResponseFromEbay"); - ; + Debug.logError("Exception during read response from Ebay", module); } return orders; } - private static Map createShoppingCart(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, Map order) { + private static Map createShoppingCart(GenericDelegator delegator, LocalDispatcher dispatcher, Locale locale, Map parameters, boolean create) { try { - String productStoreId = (String)context.get("productStoreId"); - GenericValue userLogin = (GenericValue) context.get("userLogin"); + String productStoreId = (String) parameters.get("productStoreId"); + GenericValue userLogin = (GenericValue) parameters.get("userLogin"); String defaultCurrencyUomId = ""; String payToPartyId = ""; String facilityId = ""; // Product Store is mandatory if (productStoreId == null) { - ; //TODO error message has to be returned + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale)); } else { GenericValue productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); if (productStore != null) { @@ -415,18 +512,19 @@ payToPartyId = productStore.getString("payToPartyId"); facilityId = productStore.getString("inventoryFacilityId"); } else { - ; //TODO error message has to be returned + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale)); } } // create a new shopping cart ShoppingCart cart = new ShoppingCart(delegator, productStoreId, locale, defaultCurrencyUomId); - // set the external id with the eBay Item Id - String externalId = (String)order.get("externalId"); + // set the external id with the eBay Item Id + eBay Transacation Id + String externalId = (String) parameters.get("externalId"); + if (UtilValidate.isNotEmpty(externalId)) { - if (externalOrderExists(delegator, externalId)) { - return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.externalIdAlreadyExist", locale)); + if (externalOrderExists(delegator, externalId) != null && create) { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.externalIdAlreadyExist", locale)); } cart.setExternalId(externalId); } else { @@ -442,21 +540,21 @@ cart.setFacilityId(facilityId); } - String amountStr = (String)order.get("amountPaid"); + String amountStr = (String) parameters.get("amountPaid"); Double amountPaid = new Double(0); if (UtilValidate.isNotEmpty(amountStr)) { amountPaid = new Double(amountStr); } - // add the payment EXT_EBAY for the paid amount + // add the payment EXT_BAY for the paid amount cart.addPaymentAmount("EXT_EBAY", amountPaid, externalId, null, true, false, false); // set the order date with the eBay created date Timestamp orderDate = UtilDateTime.nowTimestamp(); - if (UtilValidate.isNotEmpty((String)order.get("createdDate"))) { + if (UtilValidate.isNotEmpty((String) parameters.get("createdDate"))) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); - Date createdDate = sdf.parse((String)order.get("createdDate")); + Date createdDate = sdf.parse((String) parameters.get("createdDate")); orderDate = new Timestamp(createdDate.getTime()); } cart.setOrderDate(orderDate); @@ -465,13 +563,19 @@ cart.addItemGroup("00001", null); // create the order item - String productId = (String)order.get("productId"); + String productId = (String) parameters.get("productId"); if (UtilValidate.isEmpty(productId)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productIdNotAvailable", locale)); } - Double unitPrice = new Double((String)order.get("amount")); - double quantity = new Double((String)order.get("quantitySold")).doubleValue(); + // Before import the order from eBay to OFBiz is mandatory that the payment has be received + String paidTime = (String) parameters.get("paidTime"); + if (UtilValidate.isEmpty(paidTime)) { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.paymentIsStillNotReceived", locale)); + } + + Double unitPrice = new Double((String) parameters.get("transactionPrice")); + double quantity = new Double((String) parameters.get("quantityPurchased")).doubleValue(); Double amount = new Double(quantity * unitPrice.doubleValue()); cart.addItemToEnd(productId, amount, quantity, unitPrice, null, null, null, "PRODUCT_ORDER_ITEM", dispatcher, Boolean.FALSE, Boolean.FALSE); @@ -480,35 +584,8 @@ cart.setBillFromVendorPartyId(payToPartyId); } - // set partyId to - String partyId = createCustomerParty(dispatcher, (String)order.get("buyerName"), userLogin); - String contactMechId = ""; - if (UtilValidate.isNotEmpty(partyId)) { - contactMechId = createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", order); - createPartyPhone(dispatcher, partyId, (String)order.get("shippingAddressPhone"), userLogin); - String emailBuyer = (String)order.get("emailBuyer"); - if (!(emailBuyer.equals("") || emailBuyer.equalsIgnoreCase("Invalid Request"))) { - createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); - } - } else { - partyId = "admin"; - } - - cart.setBillToCustomerPartyId(partyId); - cart.setPlacingCustomerPartyId(partyId); - cart.setShipToCustomerPartyId(partyId); - cart.setEndUserCustomerPartyId(partyId); - - cart.setCarrierPartyId("_NA_"); - cart.setShippingContactMechId(contactMechId); - - //TODO handle shipment method type - cart.setShipmentMethodTypeId("NO_SHIPPING"); - cart.setMaySplit(Boolean.FALSE); - cart.makeAllShipGroupInfos(); - - // Apply shipping costs - String shippingCost = (String)order.get("shippingServiceCost"); + // Apply shipping costs as order adjustment + String shippingCost = (String) parameters.get("shippingServiceCost"); if (UtilValidate.isNotEmpty(shippingCost)) { double shippingAmount = new Double(shippingCost).doubleValue(); if (shippingAmount > 0) { @@ -518,25 +595,67 @@ } } } + + // Apply additional shipping costs as order adjustment + String shippingTotalAdditionalCost = (String) parameters.get("shippingTotalAdditionalCost"); + if (UtilValidate.isNotEmpty(shippingTotalAdditionalCost)) { + double shippingAdditionalCost = new Double(shippingTotalAdditionalCost).doubleValue(); + if (shippingAdditionalCost > 0) { + GenericValue shippingAdjustment = madeOrderAdjustment(delegator, "MISCELLANEOUS_CHARGE", cart.getOrderId(), null, null, shippingAdditionalCost); + if (shippingAdjustment != null) { + cart.addAdjustment(shippingAdjustment); + } + } + } + + // order has to be created ? + if (create) { + // set partyId to + String partyId = createCustomerParty(dispatcher, (String) parameters.get("buyerName"), userLogin); + String contactMechId = ""; + if (UtilValidate.isNotEmpty(partyId)) { + contactMechId = createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", parameters); + createPartyPhone(dispatcher, partyId, (String) parameters.get("shippingAddressPhone"), userLogin); + String emailBuyer = (String) parameters.get("emailBuyer"); + if (!(emailBuyer.equals("") || emailBuyer.equalsIgnoreCase("Invalid Request"))) { + createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); + } + } else { + partyId = "admin"; + } + + cart.setBillToCustomerPartyId(partyId); + cart.setPlacingCustomerPartyId(partyId); + cart.setShipToCustomerPartyId(partyId); + cart.setEndUserCustomerPartyId(partyId); + + cart.setCarrierPartyId("_NA_"); + cart.setShippingContactMechId(contactMechId); - // create the order - CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); - Map orderCreate = checkout.createOrder(userLogin); - - String orderId = (String)orderCreate.get("orderId"); - - // approve the order - if (UtilValidate.isNotEmpty(orderId)) { - boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); - - // create the payment from the preference - if (approved) { - createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), partyId); + //TODO handle shipment method type + cart.setShipmentMethodTypeId("NO_SHIPPING"); + cart.setMaySplit(false); + cart.makeAllShipGroupInfos(); + + // create the order + CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); + Map orderCreate = checkout.createOrder(userLogin); + + String orderId = (String)orderCreate.get("orderId"); + + // approve the order + if (UtilValidate.isNotEmpty(orderId)) { + boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); + + // create the payment from the preference + if (approved) { + createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), partyId); + } } } } catch (Exception e) { - e.printStackTrace(); - //TODO handle exception error message + Debug.logError("Exception in createShoppingCart", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInCreateShoppingCart", locale)); } return ServiceUtil.returnSuccess(); } @@ -557,7 +676,7 @@ return false; } } - } catch (GenericEntityException e) { + } catch (Exception e) { Debug.logError(e, "Cannot get payment preferences for order #" + orderId, module); return false; } @@ -620,7 +739,8 @@ return orderAdjustment; } - public static String createCustomerParty(LocalDispatcher dispatcher, String name, GenericValue userLogin) { + public static String createCustomerParty(LocalDispatcher dispatcher, String name, GenericValue userLogin) + { String partyId = null; try { @@ -645,14 +765,14 @@ Debug.logVerbose("Created Customer Party: "+partyId, module); } } catch (Exception e) { - //TODO error calling the service createPerson - e.printStackTrace(); + Debug.logError(e, "Failed to createPerson", module); } return partyId; } public static String createAddress(LocalDispatcher dispatcher, String partyId, GenericValue userLogin, - String contactMechPurposeTypeId, Map address) { + String contactMechPurposeTypeId, Map address) + { String contactMechId = null; try { Map context = FastMap.newInstance(); @@ -670,13 +790,13 @@ Map summaryResult = dispatcher.runSync("createPartyPostalAddress",context); contactMechId = (String)summaryResult.get("contactMechId"); } catch (GenericServiceException e) { - //TODO error calling the service createPartyPostalAddress - e.printStackTrace(); + Debug.logError(e, "Failed to createAddress", module); } return contactMechId; } - private static void correctCityStateCountry(LocalDispatcher dispatcher, Map map, String city, String state, String country) { + private static void correctCityStateCountry(LocalDispatcher dispatcher, Map map, String city, String state, String country) + { try { Debug.logInfo("correctCityStateCountry params: " + city + ", " + state + ", " + country, module); String geoId = "USA"; @@ -697,12 +817,12 @@ } Debug.logInfo("State geoid: " + state, module); } catch (Exception e) { - Debug.logVerbose("Problem finding country bill code " + e.getMessage(),module); - //TODO handle error message + Debug.logError(e, "Failed to correctCityStateCountry", module); } } - public static String createPartyPhone(LocalDispatcher dispatcher, String partyId, String phoneNumber, GenericValue userLogin) { + public static String createPartyPhone(LocalDispatcher dispatcher, String partyId, String phoneNumber, GenericValue userLogin) + { Map summaryResult = FastMap.newInstance(); Map context = FastMap.newInstance(); String phoneContactMechId = null; @@ -714,19 +834,20 @@ summaryResult = dispatcher.runSync("createPartyTelecomNumber", context); phoneContactMechId = (String)summaryResult.get("contactMechId"); } catch (Exception e) { - Debug.logWarning("Phone number not found", module); - //TODO handle error message + Debug.logError(e, "Failed to createPartyPhone", module); } return phoneContactMechId; } - public static String createPartyEmail(LocalDispatcher dispatcher, String partyId, String email, GenericValue userLogin) { + public static String createPartyEmail(LocalDispatcher dispatcher, String partyId, String email, GenericValue userLogin) + { Map context = FastMap.newInstance(); Map summaryResult = FastMap.newInstance(); String emailContactMechId = null; try { - if (UtilValidate.isNotEmpty(email)) { + if (UtilValidate.isNotEmpty(email)) + { context.clear(); context.put("emailAddress", email); context.put("userLogin", userLogin); @@ -741,22 +862,25 @@ summaryResult = dispatcher.runSync("createPartyContactMech", context); } } catch (Exception e) { - Debug.logWarning("Email not found", module); - //TODO handle error message + Debug.logError(e, "Failed to createPartyEmail", module); } return emailContactMechId; } - public static Map getCountryGeoId(GenericDelegator delegator, String geoCode) { + public static Map getCountryGeoId(GenericDelegator delegator, String geoCode) + { GenericValue geo = null; try { Debug.logInfo("geocode: " + geoCode, module); List geoEntities = delegator.findByAnd("Geo", UtilMisc.toMap("geoCode", geoCode.toUpperCase(), "geoTypeId", "COUNTRY")); - if (geoEntities != null && geoEntities.size() > 0) { + if (geoEntities != null && geoEntities.size() > 0) + { geo = (GenericValue)geoEntities.get(0); Debug.logInfo("Found a geo entity " + geo, module); - } else { + } + else + { geo = delegator.makeValue("Geo", null); geo.set("geoId", geoCode + "_IMPORTED"); geo.set("geoTypeId", "COUNTRY"); @@ -777,9 +901,30 @@ return result; } - public static boolean externalOrderExists(GenericDelegator delegator, String externalId) throws GenericEntityException { + public static GenericValue externalOrderExists(GenericDelegator delegator, String externalId) throws GenericEntityException + { Debug.logInfo("Checking for existing externalOrderId: " + externalId, module); + GenericValue orderHeader = null; List entities = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId)); - return (entities != null && entities.size() > 0); + if (entities != null && entities.size() > 0) { + orderHeader = EntityUtil.getFirst(entities); + } + return orderHeader; + } + + public static String buildExternalId(String itemId, String transactionId) + { + StringBuffer str = new StringBuffer(); + if (itemId != null) { + str.append(itemId); + } + + if (transactionId != null) { + if (!("0".equals(transactionId))) { + str.append("_"); + } + str.append(transactionId); + } + return str.toString(); } -} +} \ No newline at end of file Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Fri Jul 20 01:08:16 2007 @@ -1497,9 +1497,16 @@ <response name="failure" type="view" value="ManageOrdersFromEbay"/> </request-map> - <request-map uri="ImportOrdersFromEbay"> + <request-map uri="ImportOrdersSearchFromEbay"> <security https="true" auth="true"/> - <event type="service" path="" invoke="importFromEbay"/> + <event type="service" path="" invoke="importOrdersSearchFromEbay"/> + <response name="success" type="view" value="ManageOrdersFromEbay"/> + <response name="failure" type="view" value="ManageOrdersFromEbay"/> + </request-map> + + <request-map uri="ImportOrderFromEbay"> + <security https="true" auth="true"/> + <event type="service-multi" path="" invoke="importOrderFromEbay"/> <response name="success" type="view" value="ManageOrdersFromEbay"/> <response name="failure" type="view" value="ManageOrdersFromEbay"/> </request-map> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/OrderForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/OrderForms.xml?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/order/OrderForms.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/order/OrderForms.xml Fri Jul 20 01:08:16 2007 @@ -118,7 +118,7 @@ </field> <field name="addButton" widget-style="smallSubmit"><submit button-type="button"/></field> </form> - <form name="ManageOrdersFromEbay" type="single" target="ImportOrdersFromEbay"> + <form name="ManageOrdersFromEbay" type="single" target="ImportOrdersSearchFromEbay"> <field name="productStoreId"> <drop-down> <entity-options entity-name="ProductStore" description="${storeName}" key-field-name="productStoreId"> @@ -128,26 +128,37 @@ </field> <field name="fromDate" title="${uiLabelMap.CommonFromDateTime}"><date-time/></field> <field name="thruDate" title="${uiLabelMap.CommonThruDateTime}"><date-time/></field> - <field name="submitButton" title="${uiLabelMap.OrderImportOrdersFromEbay}"><submit button-type="button"/></field> + <field name="submitButton" title="${uiLabelMap.OrderImportOrdersSearchFromEbay}"><submit button-type="button"/></field> </form> - <form name="ListOrdersFromEbay" type="list" list-name="orderList"> + <form name="ListOrdersFromEbay" type="multi" list-name="orderList" target="ImportOrderFromEbay"> + <field name="orderSelected" title="${uiLabelMap.CommonSelect}"><check/></field> + <field name="productStoreId"><hidden/></field> <field name="externalId" title="${uiLabelMap.OrderImportEbayItem}"><display/></field> - <field name="orderId"><display/></field> + <field name="orderId" use-when="orderId == null"><display/></field> + <field name="orderId" use-when="orderId != null"><hyperlink target="orderview?orderId=${orderId}" description="${orderId}"/></field> <field name="createdDate"><display/></field> <field name="productId"><display/></field> <field name="title"><display/></field> - <field name="quantitySold"><display/></field> - <field name="amount"><display/></field> + <field name="quantityPurchased" title="${uiLabelMap.OrderQuantitySold}"><display/></field> + <field name="transactionPrice" title="${uiLabelMap.OrderUnitPrice}"><display/></field> <field name="shippingServiceCost"><display/></field> + <field name="shippingTotalAdditionalCost"><display/></field> <field name="amountPaid"><display/></field> - <field name="shippingService"><display/></field> + <field name="paidTime"><display/></field> + <field name="shippedTime"><display/></field> + <field name="errorMessage"><display/></field> <field name="paymentMethodUsed"><display/></field> + <field name="listingStatus"><display/></field> <field name="eBayPaymentStatus"><display/></field> <field name="checkoutStatus"><display/></field> <field name="completeStatus"><display/></field> - <field name="paidTime"><display/></field> - <field name="shippedTime"><display/></field> <field name="buyerName"><display/></field> <field name="emailBuyer"><display/></field> + <field name="shippingAddressPhone"><hidden/></field> + <field name="shippingAddressStreet1"><hidden/></field> + <field name="shippingAddressPostalCode"><hidden/></field> + <field name="shippingAddressCountry"><hidden/></field> + <field name="shippingAddressStateOrProvince"><hidden/></field> + <field name="shippingAddressCityName"><hidden/></field><field name="submitButton" title="${uiLabelMap.OrderImportOrdersFromEbay}" widget-style="smallSubmit"><submit/></field> </form> </forms> Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml (original) +++ ofbiz/trunk/applications/order/widget/ordermgr/OrderViewScreens.xml Fri Jul 20 01:08:16 2007 @@ -316,16 +316,19 @@ <screen name="ManageOrdersFromEbay"> <section> <actions> - <set field="titleProperty" value="OrderImportOrdersFromEbay"/> + <set field="titleProperty" value="OrderImportOrdersSearchFromEbay"/> <set field="orderList" from-field="parameters.orderList"/> </actions> <widgets> <decorator-screen name="CommonOrderViewDecorator"> <decorator-section name="body"> <container> - <label style="head1">${uiLabelMap.OrderImportOrdersFromEbay}</label> + <label style="head1">${uiLabelMap.OrderImportOrdersSearchFromEbay}</label> </container> <include-form name="ManageOrdersFromEbay" location="component://order/webapp/ordermgr/order/OrderForms.xml"/> + <container> + <label style="head1">${uiLabelMap.OrderImportOrdersFromEbay}</label> + </container> <include-form name="ListOrdersFromEbay" location="component://order/webapp/ordermgr/order/OrderForms.xml"/> </decorator-section> </decorator-screen> Modified: ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties Fri Jul 20 01:08:16 2007 @@ -186,7 +186,7 @@ PageTitlePickingMoveStock=Prelievo : Muovi Giacenza PageTitlePickingViewStartedPicks=Prelievo : Mostra Inizio Prelievo PageTitleProductsExportToGoogle=Esportazioni Prodotti su Google Base -PageTitleProductsExportToeBay=Esportazioni Prodotti su eBay +PageTitleProductsExportToEbay=Esportazioni Prodotti su eBay PageTitleQuickAddProductVariants=Aggiunta Veloce Varianti Prodotto PageTitleSearchInventoryItems=Ricerca Righe Inventario PageTitleSearchResults=Risultati Ricerca Modified: ofbiz/trunk/applications/product/config/productsExport.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/productsExport.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/product/config/productsExport.properties (original) +++ ofbiz/trunk/applications/product/config/productsExport.properties Fri Jul 20 01:08:16 2007 @@ -19,8 +19,23 @@ #### # OFBiz Product Export Settings #### +# Google Product Search productsExport.google.developerKey= productsExport.google.authenticationUrl=https://www.google.com/accounts/ClientLogin productsExport.google.accountEmail= productsExport.google.accountPassword= -productsExport.google.postItemsUrl= http://www.google.com/base/feeds/items/batch +productsExport.google.postItemsUrl=http://www.google.com/base/feeds/items/batch + +# eBay +productsExport.eBay.devID= +productsExport.eBay.appID= +productsExport.eBay.certID= +productsExport.eBay.token= +productsExport.eBay.restToken= +productsExport.eBay.compatibilityLevel=517 +# 0=US +productsExport.eBay.siteID=0 +# sandbox +productsExport.eBay.xmlGatewayUri=https://api.sandbox.ebay.com/ws/api.dll +# production +#productsExport.eBay.xmlGatewayUri=https://api.ebay.com/ws/api.dll \ No newline at end of file Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToEbay.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToEbay.java?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToEbay.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToEbay.java Fri Jul 20 01:08:16 2007 @@ -209,6 +209,7 @@ UtilXml.addChildElementValue(itemElem, "Currency", "USD", itemDocument); UtilXml.addChildElementValue(itemElem, "SKU", prod.getString("productId"), itemDocument); UtilXml.addChildElementValue(itemElem, "Title", title, itemDocument); + UtilXml.addChildElementValue(itemElem, "Description", title, itemDocument); UtilXml.addChildElementValue(itemElem, "ListingDuration", "Days_1", itemDocument); UtilXml.addChildElementValue(itemElem, "Quantity", "3", itemDocument); UtilXml.addChildElementValue(itemElem, "PaymentMethods", "AmEx", itemDocument); Modified: ofbiz/trunk/framework/common/config/CommonUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels_it.properties?view=diff&rev=557918&r1=557917&r2=557918 ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels_it.properties (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels_it.properties Fri Jul 20 01:08:16 2007 @@ -184,6 +184,7 @@ CommonGotoParent=Torna al Padre CommonGroup=Gruppo CommonHeight=Altezza +CommonHeld=Congelati CommonHideFields=Nascondi Campi CommonHour=Ora CommonHourly=Orario |
Free forum by Nabble | Edit this page |