svn commit: r811600 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

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

svn commit: r811600 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

ashish-18
Author: ashish
Date: Sat Sep  5 08:01:59 2009
New Revision: 811600

URL: http://svn.apache.org/viewvc?rev=811600&view=rev
Log:
Minor Improvements.

Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

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=811600&r1=811599&r2=811600&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Sat Sep  5 08:01:59 2009
@@ -208,6 +208,16 @@
                     if (UtilValidate.isEmpty(qnt)) {
                         qnt = "1";
                     }
+                    String productDescription = "";
+                    String description = prod.getString("description");
+                    String longDescription = prod.getString("longDescription");
+                    if (UtilValidate.isNotEmpty(description)) {
+                        productDescription = description;
+                    } else if (UtilValidate.isNotEmpty(longDescription)) {
+                        productDescription = longDescription;
+                    } else if (UtilValidate.isNotEmpty(prod.getString("productName"))) {
+                        productDescription = prod.getString("productName");
+                    }
                     String startPrice = (String)context.get("startPrice");
                     if (UtilValidate.isEmpty(startPrice)) {
                         GenericValue startPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelatedByAnd("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MINIMUM_PRICE"))));
@@ -234,7 +244,7 @@
                     if (UtilValidate.isNotEmpty(ebayDescription.toString())) {
                         UtilXml.addChildElementCDATAValue(itemElem, "Description", ebayDescription.toString(), itemDocument);
                     } else {
-                        UtilXml.addChildElementValue(itemElem, "Description", encoder.encode(prod.getString("productName")), itemDocument);
+                        UtilXml.addChildElementValue(itemElem, "Description", encoder.encode(productDescription), itemDocument);
                     }
                     String smallImage = prod.getString("smallImageUrl");
                     String mediumImage = prod.getString("mediumImageUrl");
@@ -277,7 +287,7 @@
                     Element startPriceElem = UtilXml.addChildElementValue(itemElem, "StartPrice", startPrice, itemDocument);
                     startPriceElem.setAttribute("currencyID", "USD");
                 }
-
+                //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(itemDocument), module);
                 dataItemsXml.append(UtilXml.writeXmlDocument(itemDocument));
             } catch (Exception e) {
                 Debug.logError("Exception during building data items to eBay: " + e.getMessage(), module);