Return-Path: Delivered-To: apmail-ofbiz-commits-archive@www.apache.org Received: (qmail 64884 invoked from network); 16 Feb 2010 11:09:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2010 11:09:40 -0000 Received: (qmail 62957 invoked by uid 500); 16 Feb 2010 11:09:40 -0000 Delivered-To: apmail-ofbiz-commits-archive@ofbiz.apache.org Received: (qmail 62896 invoked by uid 500); 16 Feb 2010 11:09:40 -0000 Mailing-List: contact commits-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list commits@ofbiz.apache.org Received: (qmail 62885 invoked by uid 99); 16 Feb 2010 11:09:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Feb 2010 11:09:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Feb 2010 11:09:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C32862388905; Tue, 16 Feb 2010 11:09:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r910474 - in /ofbiz/trunk/specialpurpose/ebaystore: config/ script/org/ofbiz/ebaystore/ servicedef/ src/org/ofbiz/ebaystore/ webapp/ebaystore/WEB-INF/ webapp/ebaystore/WEB-INF/actions/store/ widget/ Date: Tue, 16 Feb 2010 11:09:13 -0000 To: commits@ofbiz.apache.org From: hansbak@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100216110913.C32862388905@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hansbak Date: Tue Feb 16 11:09:12 2010 New Revision: 910474 URL: http://svn.apache.org/viewvc?rev=910474&view=rev Log: Ebaystore update: 1. function for open unpaid item dispute when items status is not unpaid or check out not complete. 2. when user select unpaid at the item the system will show section for add reason and explaination for dispute. Added: ofbiz/trunk/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/SoldAction.groovy Modified: ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreForms.xml ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreMenus.xml ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreScreens.xml Modified: ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml?rev=910474&r1=910473&r2=910474&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml Tue Feb 16 11:09:12 2010 @@ -196,6 +196,9 @@ Fixed Price + + Open unpaid item dispute + Require eBay Inventory Added: ofbiz/trunk/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml?rev=910474&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml (added) +++ ofbiz/trunk/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml Tue Feb 16 11:09:12 2010 @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml?rev=910474&r1=910473&r2=910474&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml Tue Feb 16 11:09:12 2010 @@ -168,6 +168,8 @@ + + - Update EbayProductStoreInventory entity + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java?rev=910474&r1=910473&r2=910474&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java Tue Feb 16 11:09:12 2010 @@ -27,6 +27,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.util.Calendar; +import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -73,9 +74,12 @@ import com.ebay.sdk.SdkException; import com.ebay.sdk.SdkSoapException; import com.ebay.sdk.call.*; +import com.ebay.sdk.helper.ui.ControlTagItem; import com.ebay.soap.eBLBaseComponents.AbstractRequestType; import com.ebay.soap.eBLBaseComponents.DeleteSellingManagerTemplateRequestType; import com.ebay.soap.eBLBaseComponents.DeleteSellingManagerTemplateResponseType; +import com.ebay.soap.eBLBaseComponents.DisputeExplanationCodeType; +import com.ebay.soap.eBLBaseComponents.DisputeReasonCodeType; import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryRequestType; import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryResponseType; import com.ebay.soap.eBLBaseComponents.GetStoreOptionsRequestType; @@ -114,6 +118,8 @@ import com.ebay.soap.eBLBaseComponents.StoreThemeArrayType; import com.ebay.soap.eBLBaseComponents.StoreThemeType; import com.ebay.soap.eBLBaseComponents.StoreType; +import com.ebay.soap.eBLBaseComponents.SummaryFrequencyCodeType; +import com.ebay.soap.eBLBaseComponents.SummaryWindowPeriodCodeType; import com.ebay.soap.eBLBaseComponents.TaskStatusCodeType; import java.sql.Timestamp; @@ -1421,45 +1427,64 @@ GetSellingManagerSoldListingsCall sellingManagerSoldListings = new GetSellingManagerSoldListingsCall(apiContext); sellingManagerSoldListings.getSellingManagerSoldListings(); SellingManagerSoldOrderType[] sellingManagerSoldOrders = sellingManagerSoldListings.getReturnedSaleRecord(); - if(sellingManagerSoldOrders != null){ + if (sellingManagerSoldOrders != null) { int soldOrderLength = sellingManagerSoldOrders.length; - for(int i=0; i entry = FastMap.newInstance(); SellingManagerSoldTransactionType sellingManagerSoldTransaction = sellingManagerSoldTransactions[j]; entry.put("itemId",sellingManagerSoldTransaction.getItemID()); entry.put("title",sellingManagerSoldTransaction.getItemTitle()); - if(soldItems!=null){ - int soldItemsLength = soldItems.size(); - boolean checkStatus = false; - for(int check=0;check automaticEbayRelistSoldItems(DispatchContext dctx, Map context){ + public static Map automaticEbayRelistSoldItems(DispatchContext dctx, Map context) { Mapresult = FastMap.newInstance(); LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -1469,39 +1494,39 @@ MapserviceMap = FastMap.newInstance(); serviceMap.put("userLogin", userLogin); Liststores = delegator.findByAnd("ProductStore", UtilMisc.toMap()); - for(int storeCount=0;storeCountjobs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("authUserLoginId", eBayUserLoginId)); - if(jobs.size() != 0){ + if(jobs.size() != 0) { GenericValue job = jobs.get(0); Timestamp startDateTime = (Timestamp)job.get("startDateTime"); Timestamp finishDateTime = (Timestamp)job.get("finishDateTime"); //check can re-list items by eBay account setting boolean canRelistItems = false; Timestamp nowTime = UtilDateTime.nowTimestamp(); - if(startDateTime!=null&&finishDateTime!=null){ - if(startDateTime.before(nowTime) && finishDateTime.after(nowTime)){ + if(startDateTime!=null&&finishDateTime!=null) { + if(startDateTime.before(nowTime) && finishDateTime.after(nowTime)) { canRelistItems = true; } - }else if(startDateTime!=null&&finishDateTime==null){ - if(startDateTime.before(nowTime)){ + }else if(startDateTime!=null&&finishDateTime==null) { + if(startDateTime.before(nowTime)) { canRelistItems = true; } } - if(canRelistItems){ + if(canRelistItems) { //save sold items to OFbBiz product entity Map resultService = dispatcher.runSync("getEbaySoldItems", serviceMap); List soldItems = (List)resultService.get("soldItems"); - if(soldItems.size()!=0){ - for(int itemCount=0;itemCount activeItemMaps = FastList.newInstance(); - if(activeItems.size()!=0){ - for(int itemCount=0;itemCount inMap = FastMap.newInstance(); inMap.put("productStoreId", productStoreId); @@ -1544,7 +1569,7 @@ Map resultUser = dispatcher.runSync("getEbayStoreUser", inMap); String userID = (String)resultUser.get("userLoginId"); ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator); - for(int itemRelist=0;itemRelist getSellingInventory(DispatchContext dctx, Map context){ + public static Map getSellingInventory(DispatchContext dctx, Map context) { Locale locale = (Locale) context.get("locale"); Delegator delegator = dctx.getDelegator(); Map result = FastMap.newInstance(); GetSellingManagerInventoryRequestType req = new GetSellingManagerInventoryRequestType(); GetSellingManagerInventoryResponseType resp = null; - if(context.get("productStoreId") != null){ + if(context.get("productStoreId") != null) { GetSellingManagerInventoryCall call = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator)); try { Map ebayResp = FastMap.newInstance(); SellingManagerProductType[] returnedSellingManagerProductType = null; resp = (GetSellingManagerInventoryResponseType)call.execute(req); - if(resp != null && "SUCCESS".equals(resp.getAck().toString())){ + if(resp != null && "SUCCESS".equals(resp.getAck().toString())) { returnedSellingManagerProductType = resp.getSellingManagerProduct(); //result = ServiceUtil.returnSuccess("load store data success.."); - for (int i=0;i 0){ - for (int j=0;j 0) { + for (int j=0;j exportProductsFromEbayStore(DispatchContext dctx, Map context){ + public static Map exportProductsFromEbayStore(DispatchContext dctx, Map context) { Map result = FastMap.newInstance(); Locale locale = (Locale) context.get("locale"); Delegator delegator = dctx.getDelegator(); @@ -1753,4 +1778,79 @@ } return result; } + public static DisputeExplanationCodeType getEbayDisputeExplanationCodeType(String disputeExplanationCode) { + DisputeExplanationCodeType disputeExplanationCodeType = null; + if (disputeExplanationCode != null) { + if (disputeExplanationCode.equals("BUYER_HAS_NOT_RESPONDED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_HAS_NOT_RESPONDED; + } else if (disputeExplanationCode.equals("BUYER_REFUSED_TO_PAY")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_REFUSED_TO_PAY; + } else if (disputeExplanationCode.equals("BUYER_RETURNED_ITEM_FOR_REFUND")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_RETURNED_ITEM_FOR_REFUND; + } else if (disputeExplanationCode.equals("UNABLE_TO_RESOLVE_TERMS")) { + disputeExplanationCodeType = DisputeExplanationCodeType.UNABLE_TO_RESOLVE_TERMS; + } else if (disputeExplanationCode.equals("BUYER_PURCHASING_MISTAKE")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_PURCHASING_MISTAKE; + } else if (disputeExplanationCode.equals("SHIP_COUNTRY_NOT_SUPPORTED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.SHIP_COUNTRY_NOT_SUPPORTED; + } else if (disputeExplanationCode.equals("SHIPPING_ADDRESS_NOT_CONFIRMED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.SHIPPING_ADDRESS_NOT_CONFIRMED; + } else if (disputeExplanationCode.equals("PAYMENT_METHOD_NOT_SUPPORTED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.PAYMENT_METHOD_NOT_SUPPORTED; + } else if (disputeExplanationCode.equals("BUYER_NO_LONGER_REGISTERED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED; + } else if (disputeExplanationCode.equals("BUYER_NO_LONGER_REGISTERED")) { + disputeExplanationCodeType = DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED; + } else { + disputeExplanationCodeType = DisputeExplanationCodeType.OTHER_EXPLANATION; + } + }else{ + disputeExplanationCodeType = DisputeExplanationCodeType.OTHER_EXPLANATION; + } + return disputeExplanationCodeType; + } + public static DisputeReasonCodeType getEbayDisputeReasonCodeType(String disputeReasonCode) { + DisputeReasonCodeType disputeReasonCodeType = null; + if (disputeReasonCode != null) { + if (disputeReasonCode.equals("TRANSACTION_MUTUALLY_CANCELED")) { + disputeReasonCodeType = DisputeReasonCodeType.TRANSACTION_MUTUALLY_CANCELED; + } else if (disputeReasonCode.equals("BUYER_HAS_NOT_PAID")) { + disputeReasonCodeType = DisputeReasonCodeType.BUYER_HAS_NOT_PAID; + } + } + return disputeReasonCodeType; + } + public static Map addEbayDispute(DispatchContext dctx, Map context) { + Mapresult = FastMap.newInstance(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + GenericValue userLogin = (GenericValue) context.get("userLogin"); + Delegator delegator = dctx.getDelegator(); + Locale locale = (Locale) context.get("locale"); + String productStoreId = (String) context.get("productStoreId"); + List soldItems = FastList.newInstance(); + try { + String itemId = (String) context.get("itemId"); + String transactionId = (String) context.get("transactionId"); + DisputeReasonCodeType drct = EbayStore.getEbayDisputeReasonCodeType((String)context.get("disputeReasonCodeType")); + DisputeExplanationCodeType dect = EbayStore.getEbayDisputeExplanationCodeType((String) context.get("disputeExplanationCodeType")); + DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { + DetailLevelCodeType.RETURN_ALL, + DetailLevelCodeType.ITEM_RETURN_ATTRIBUTES, + DetailLevelCodeType.ITEM_RETURN_DESCRIPTION + }; + ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator); + AddDisputeCall api = new AddDisputeCall(apiContext); + api.setDetailLevel(detailLevels); + api.setItemID(itemId); + api.setTransactionID(transactionId); + api.setDisputeExplanation(dect); + api.setDisputeReason(drct); + + String disputeId = api.addDispute(); + result.put("disputeId", disputeId); + } catch (Exception e) { + return ServiceUtil.returnError(e.getMessage()); + } + return result; + } } \ No newline at end of file Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/SoldAction.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/SoldAction.groovy?rev=910474&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/SoldAction.groovy (added) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/SoldAction.groovy Tue Feb 16 11:09:12 2010 @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; +import javolution.util.FastList; +import javolution.util.FastMap; + +actionList = FastList.newInstance(); +hasAction = false; + +if (unpaidItemStatus == null && paidTime == null && checkoutStatus != "CheckoutComplete") { + inMap = FastMap.newInstance(); + inMap.put("action","openUnpaid"); + inMap.put("actionName","Open Unpaid"); + actionList.add(inMap); + hasAction = true; +} +context.actionList = actionList; +context.hasAction = hasAction; \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml?rev=910474&r1=910473&r2=910474&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml Tue Feb 16 11:09:12 2010 @@ -23,6 +23,7 @@ + eBay Component Site Configuration File @@ -102,7 +103,6 @@ - @@ -186,6 +186,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -197,13 +239,11 @@ - - - + @@ -215,5 +255,12 @@ + + + + + + + Modified: ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreForms.xml?rev=910474&r1=910473&r2=910474&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreForms.xml (original) +++ ofbiz/trunk/specialpurpose/ebaystore/widget/EbayStoreForms.xml Tue Feb 16 11:09:12 2010 @@ -154,4 +154,80 @@ + +
+ +