svn commit: r803518 - in /ofbiz/trunk/specialpurpose/ebay: src/org/ofbiz/ebay/ProductsExportToEbay.java webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy webapp/ebay/find/productsExportToEbay.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r803518 - in /ofbiz/trunk/specialpurpose/ebay: src/org/ofbiz/ebay/ProductsExportToEbay.java webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy webapp/ebay/find/productsExportToEbay.ftl

jacopoc
Author: jacopoc
Date: Wed Aug 12 14:01:48 2009
New Revision: 803518

URL: http://svn.apache.org/viewvc?rev=803518&view=rev
Log:
Misc fixes to the ebay export features: there are still a lot of hardcoded values but at least now it is possible to publish something. Still a lot to do here.

Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=803518&r1=803517&r2=803518&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Wed Aug 12 14:01:48 2009
@@ -208,9 +208,10 @@
                     UtilXml.addChildElementValue(itemElem, "Description", description, itemDocument);
                     UtilXml.addChildElementValue(itemElem, "ListingDuration", (String)context.get("listingDuration"), itemDocument);
                     UtilXml.addChildElementValue(itemElem, "Quantity", qnt, itemDocument);
-                    UtilXml.addChildElementValue(itemElem, "UseTaxTable", "false", itemDocument);
 
                     setPaymentMethodAccepted(itemDocument, itemElem, context);
+                    setShippingDetails(itemDocument, itemElem, context);
+                    setMiscDetails(itemDocument, itemElem, context);
 
                     String categoryCode = (String)context.get("ebayCategory");
                     String categoryParent = "";
@@ -395,6 +396,26 @@
         }
     }
 
+    // TODO: these are mandatory values that have been hardcoded
+    private static void setShippingDetails(Document itemDocument, Element itemElem, Map context) {
+        Element shippingDetails = UtilXml.addChildElement(itemElem, "ShippingDetails", itemDocument);
+        UtilXml.addChildElementValue(shippingDetails, "ShippingType", "Flat", itemDocument);
+        Element shippingServiceOptions = UtilXml.addChildElement(shippingDetails, "ShippingServiceOptions", itemDocument);
+        UtilXml.addChildElementValue(shippingServiceOptions, "ShippingService", "UPS2ndDay", itemDocument);
+        UtilXml.addChildElementValue(shippingServiceOptions, "ShippingServicePriority", "1", itemDocument);
+        UtilXml.addChildElementValue(shippingServiceOptions, "ShippingServiceCost", "5", itemDocument);
+        UtilXml.addChildElementValue(shippingServiceOptions, "ShippingServiceAdditionalCost", "2", itemDocument);
+        UtilXml.addChildElementValue(shippingServiceOptions, "ShippingSurcharge", "1", itemDocument);
+    }
+
+    // TODO: these are mandatory values that have been hardcoded
+    private static void setMiscDetails(Document itemDocument, Element itemElem, Map context) {
+        UtilXml.addChildElementValue(itemElem, "UseTaxTable", "false", itemDocument);
+        UtilXml.addChildElementValue(itemElem, "DispatchTimeMax", "3", itemDocument);
+        Element returnPolicy = UtilXml.addChildElement(itemElem, "ReturnPolicy", itemDocument);
+        UtilXml.addChildElementValue(returnPolicy, "ReturnsAcceptedOption", "ReturnsNotAccepted", itemDocument);
+    }
+    
     public static Map getEbayCategories(DispatchContext dctx, Map context) {
         Locale locale = (Locale) context.get("locale");
         String categoryCode = (String)context.get("categoryCode");

Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy?rev=803518&r1=803517&r2=803518&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy (original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy Wed Aug 12 14:01:48 2009
@@ -24,4 +24,10 @@
 
 if (results.categories) {
     context.categories = results.categories;
-}
\ No newline at end of file
+}
+
+if (!categoryCode || !"Y".equals(categoryCode.substring(0, 1))) {
+    context.hideExportOptions = "Y";
+} else {
+    context.hideExportOptions = "N";
+}

Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl?rev=803518&r1=803517&r2=803518&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl (original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl Wed Aug 12 14:01:48 2009
@@ -49,6 +49,7 @@
                     </select>
                 </td>
             </tr>
+            <#if hideExportOptions == "N">
             <tr>
                 <td align="right" class="label">${uiLabelMap.CommonCountry}</td>
                 <td>&nbsp;</td>
@@ -149,6 +150,7 @@
                     <input type="submit" value="${uiLabelMap.EbayExportToEbay}" name="submitButton" class="smallSubmit">
                 </td>
             </tr>
+            </#if>
         </table>
     </form>
     <script language="JavaScript" type="text/javascript">