|
Author: hansbak
Date: Tue Jan 26 02:23:09 2010 New Revision: 903051 URL: http://svn.apache.org/viewvc?rev=903051&view=rev Log: Ebay component: add block out of stock function, screen, helpscreen Added: ofbiz/trunk/specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml Modified: ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml ofbiz/trunk/specialpurpose/ebay/data/EbayHelpData.xml ofbiz/trunk/specialpurpose/ebay/servicedef/services.xml ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayStore.java ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml Modified: ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/config/EbayUiLabels.xml Tue Jan 26 02:23:09 2010 @@ -709,4 +709,7 @@ <property key="EbaySoldLeaveFeedback"> <value xml:lang="en">Sold</value> </property> + <property key="EbayBlockItemOutOfStock"> + <value xml:lang="en">Block items out of stock</value> + </property> </resource> Modified: ofbiz/trunk/specialpurpose/ebay/data/EbayHelpData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/data/EbayHelpData.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/data/EbayHelpData.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/data/EbayHelpData.xml Tue Jan 26 02:23:09 2010 @@ -121,4 +121,9 @@ <Content contentId="EBAY_AutoPref" contentTypeId="DOCUMENT" contentName="EBay Automation Preferences" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_AutoPref" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>/> <ContentAssoc contentId="HELP_EBAY" contentIdTo="EBAY_AutoPref" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_AutomationPreferences"/> + <!-- block out of stock --> + <DataResource dataResourceId="EBAY_BlockItem" localeString="en" dataResourceTypeId="OFBIZ_FILE" + objectInfo="specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" /> + <Content contentId="EBAY_BlockItem" contentTypeId="DOCUMENT" contentName="Block item that out of stock on eBay" templateDataResourceId="HELP_TEMPL" dataResourceId="EBAY_BlockItem" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>/> + <ContentAssoc contentId="HELP_EBAY" contentIdTo="EBAY_BlockItem" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EBAY_blockItemOutOfStock"/> </entity-engine-xml> Added: ofbiz/trunk/specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml?rev=903051&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/data/helpdata/HELP_EBAY_BlockItemOutStock.xml Tue Jan 26 02:23:09 2010 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<section xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + version="5.0" xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" + xsi:schemaLocation="http://docbook.org/ns/docbook ../../../content/dtd/docbook.xsd" + xmlns="http://docbook.org/ns/docbook"> + <title>Block item that out of stock screen.</title> + <para> + The screen allow user to block items that out of stock on eBay inventory. + First you should input your store id and click on Block out of stock button to complete this function. + When you click Block out of stock button, this function will block your items on inventory that quantity is zero. + </para> + +</section> Modified: ofbiz/trunk/specialpurpose/ebay/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/servicedef/services.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/servicedef/services.xml Tue Jan 26 02:23:09 2010 @@ -322,4 +322,10 @@ <auto-attributes mode="IN" include="pk"/> <auto-attributes mode="IN" optional="true" include="nonpk"/> </service> + <!-- block out of stock items --> + <service name="getSellingInventory" engine="java" transaction-timeout="7200" + location="org.ofbiz.ebay.EbayStore" invoke="getSellingInventory" auth="true"> + <attribute name="productStoreId" mode="IN" type="String" optional="false"/> + <attribute name="itemBlocked" type="Map" mode="OUT" optional="true"/> + </service> </services> \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayStore.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayStore.java?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayStore.java (original) +++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayStore.java Tue Jan 26 02:23:09 2010 @@ -73,11 +73,20 @@ import com.ebay.sdk.SdkSoapException; import com.ebay.sdk.call.*; import com.ebay.soap.eBLBaseComponents.AbstractRequestType; +import com.ebay.soap.eBLBaseComponents.DeleteSellingManagerTemplateRequestType; +import com.ebay.soap.eBLBaseComponents.DeleteSellingManagerTemplateResponseType; +import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryRequestType; +import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryResponseType; import com.ebay.soap.eBLBaseComponents.GetStoreOptionsRequestType; import com.ebay.soap.eBLBaseComponents.GetStoreOptionsResponseType; import com.ebay.soap.eBLBaseComponents.GetStoreRequestType; import com.ebay.soap.eBLBaseComponents.GetStoreResponseType; import com.ebay.soap.eBLBaseComponents.MerchDisplayCodeType; +import com.ebay.soap.eBLBaseComponents.SellingManagerProductDetailsType; +import com.ebay.soap.eBLBaseComponents.SellingManagerProductInventoryStatusType; +import com.ebay.soap.eBLBaseComponents.SellingManagerProductType; +import com.ebay.soap.eBLBaseComponents.SellingManagerTemplateDetailsArrayType; +import com.ebay.soap.eBLBaseComponents.SellingManagerTemplateDetailsType; import com.ebay.soap.eBLBaseComponents.SetStoreRequestType; import com.ebay.soap.eBLBaseComponents.SetStoreResponseType; import com.ebay.soap.eBLBaseComponents.StoreColorSchemeType; @@ -1399,5 +1408,72 @@ } return ServiceUtil.returnSuccess(); } - + + /* ebay store block out of stock items */ + public static Map<String,Object> getSellingInventory(DispatchContext dctx, Map<String,Object> context){ + Locale locale = (Locale) context.get("locale"); + Delegator delegator = dctx.getDelegator(); + Map<String,Object> result = FastMap.newInstance(); + GetSellingManagerInventoryRequestType req = new GetSellingManagerInventoryRequestType(); + GetSellingManagerInventoryResponseType resp = null; + + if(context.get("productStoreId") != null){ + GetSellingManagerInventoryCall call = new GetSellingManagerInventoryCall(EbayHelper.getApiContext((String)context.get("productStoreId"), locale, delegator)); + + try { + Map<String,Object> ebayResp = FastMap.newInstance(); + SellingManagerProductType[] returnedSellingManagerProductType = null; + resp = (GetSellingManagerInventoryResponseType)call.execute(req); + if(resp != null && "SUCCESS".equals(resp.getAck().toString())){ + returnedSellingManagerProductType = resp.getSellingManagerProduct(); + //result = ServiceUtil.returnSuccess("load store data success.."); + for (int i=0;i<returnedSellingManagerProductType.length;i++){ + SellingManagerProductInventoryStatusType sellingProductInventory = returnedSellingManagerProductType[i].getSellingManagerProductInventoryStatus(); + SellingManagerProductDetailsType prodDetailType = returnedSellingManagerProductType[i].getSellingManagerProductDetails(); + Long productID = (Long)prodDetailType.getProductID(); + int qty = prodDetailType.getQuantityAvailable(); + + if (qty == 0){ + SellingManagerTemplateDetailsArrayType sellingTempArr = returnedSellingManagerProductType[i].getSellingManagerTemplateDetailsArray(); + SellingManagerTemplateDetailsType[] selllingTempType = null; + if (UtilValidate.isNotEmpty(sellingTempArr)){ + selllingTempType = sellingTempArr.getSellingManagerTemplateDetails(); + } + + if (selllingTempType.length > 0){ + for (int j=0;j<selllingTempType.length;j++){ + Long longTemplete = Long.parseLong(selllingTempType[j].getSaleTemplateID()); + DeleteSellingManagerTemplateCall tcall = new DeleteSellingManagerTemplateCall(EbayHelper.getApiContext((String)context.get("productStoreId"), locale, delegator)); + DeleteSellingManagerTemplateRequestType treq = new DeleteSellingManagerTemplateRequestType(); + DeleteSellingManagerTemplateResponseType tresp = null; + treq.setSaleTemplateID(longTemplete); + + tresp = (DeleteSellingManagerTemplateResponseType) tcall.execute(treq); + if(tresp != null && "SUCCESS".equals(tresp.getAck().toString())){ + ebayResp.put("TemplateID", tresp.getDeletedSaleTemplateID()); + ebayResp.put("TemplateName", tresp.getDeletedSaleTemplateName()); + result.put("itemBlocked", ebayResp); + } + } + } + } + } + result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); + if (UtilValidate.isNotEmpty(ebayResp.get("TemplateID"))){ + result.put(ModelService.SUCCESS_MESSAGE, "block "+ebayResp.get("TemplateID")+" out of stock success.."); + }else{ + result.put(ModelService.SUCCESS_MESSAGE, "no item out of stock"); + } + + } + } catch (ApiException e) { + e.printStackTrace(); + } catch (SdkSoapException e) { + e.printStackTrace(); + } catch (SdkException e) { + e.printStackTrace(); + } + } + return result; + } } \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml Tue Jan 26 02:23:09 2010 @@ -242,6 +242,19 @@ <response name="success" type="view" value="AutomationPreferences"/> <response name="error" type="view" value="AutomationPreferences"/> </request-map> + <!-- Block item out of stock --> + <request-map uri="blockItemOutOfStock"> + <security https="true" auth="true"/> + <response name="success" type="view" value="blockItemOutOfStock"/> + <response name="error" type="view" value="blockItemOutOfStock"/> + </request-map> + <request-map uri="runBlockItemOutOfStock"> + <security https="true" auth="true"/> + <event type="service" invoke="getSellingInventory"/> + <response name="success" type="view" value="blockItemOutOfStock"/> + <response name="error" type="view" value="blockItemOutOfStock"/> + </request-map> + <!-- end of request mappings --> <!-- View Mappings --> @@ -272,5 +285,7 @@ <!-- AutomationPreferences --> <view-map name="AutomationPreferences" type="screen" page="component://ebay/widget/EbayScreens.xml#EbayAutomationPreferences"/> + <!-- block out of stock --> + <view-map name="blockItemOutOfStock" type="screen" page="component://ebay/widget/EbayScreens.xml#blockItemOutOfStock"/> <!-- end of view mappings --> </site-conf> Modified: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml Tue Jan 26 02:23:09 2010 @@ -341,4 +341,10 @@ <field name="submit" use-when="job!=null" title="${uiLabelMap.CommonApply}"><submit/></field> <field name="submit" use-when="job==null" title="${uiLabelMap.CommonCreate}"><submit/></field> </form> + <!-- block out of stock items --> + <form name="blockItemsOutOfStock" type="single" target="runBlockItemOutOfStock"> + <field name="productStoreId"><hidden value="${parameters.productStoreId}"/></field> + <field name="productStore" entry-name="parameters.productStoreId" ><display-entity entity-name="ProductStore" description="${storeName} [${productStoreId}]" key-field-name="productStoreId" ></display-entity></field> + <field name="submitButton" title="${uiLabelMap.BlockItemsOutOfStock}"><submit button-type="button"/></field> + </form> </forms> \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml Tue Jan 26 02:23:09 2010 @@ -78,6 +78,11 @@ <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> </link> </menu-item> + <menu-item name="blockItemOutOfStock" title="${uiLabelMap.EbayBlockItemOutOfStock}"> + <link target="blockItemOutOfStock"> + <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> + </link> + </menu-item> <menu-item name="feedback" title="${uiLabelMap.EbayFeedback}"> <link target="Feedback"> <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> Modified: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml?rev=903051&r1=903050&r2=903051&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml (original) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml Tue Jan 26 02:23:09 2010 @@ -381,6 +381,7 @@ <order-by field-name="columnSeqId"/> <order-by field-name="sequenceNum"/> </entity-and> + <set field="headerItem" value="ebayStore"/> <set field="tabButtonItem" value="ebayAccount"/> </actions> <widgets> @@ -397,6 +398,7 @@ <section> <actions> <set field="titleProperty" value="eBay Feedback"/> + <set field="headerItem" value="ebayStore"/> <set field="tabButtonItem" value="feedback"/> </actions> <widgets> @@ -423,6 +425,7 @@ <section> <actions> <set field="titleProperty" value="eBay Feedback"/> + <set field="headerItem" value="ebayStore"/> <set field="eBayTabButtonItem" value="Feedback"/> <service service-name="loadFeedback"> <field-map field-name="productStoreId" from-field="parameters.productStoreId"/> @@ -455,6 +458,7 @@ <section> <actions> <set field="titleProperty" value="eBay Feedback"/> + <set field="headerItem" value="ebayStore"/> <set field="eBayTabButtonItem" value="LeaveFeedback"/> <set field="role" from-field="parameters.role" default-value="all"/> <service service-name="getItemsAwaitingFeedback" result-map="results"/> @@ -478,6 +482,7 @@ <screen name="EbayAutomationPreferences"> <section> <actions> + <set field="headerItem" value="ebayStore"/> <set field="tabButtonItem" value="automationPreferences"/> <service service-name="getEbayStoreUser" result-map="result"> <field-map field-name="productStoreId" from-field="parameters.productStoreId"/> @@ -497,6 +502,10 @@ </screen> <screen name="AutomationRelistSoldItems"> <section> + <actions> + <set field="headerItem" value="ebayStore"/> + <set field="tabButtonItem" value="automationPreferences"/> + </actions> <widgets> <screenlet title="${uiLabelMap.EbayAutomationRelistItems}"> <include-form name="EditAutomationRelistSoldItems" location="component://ebay/widget/EbayForms.xml"/> @@ -504,4 +513,24 @@ </widgets> </section> </screen> + <!-- block out of stock --> + <screen name="blockItemOutOfStock"> + <section> + <actions> + <set field="titleProperty" value="Block items out of stock on eBay"/> + <set field="headerItem" value="ebayStore"/> + <set field="tabButtonItem" value="blockItemOutOfStock"/> + <set field="productStoreId" value="${parameters.productStoreId}"/> + </actions> + <widgets> + <decorator-screen name="permission-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <screenlet title="${uiLabelMap.BlockItemsOutOfStock}"> + <include-form name="blockItemsOutOfStock" location="component://ebay/widget/EbayForms.xml"/> + </screenlet> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> </screens> \ No newline at end of file |
| Free forum by Nabble | Edit this page |
