From e580f4e050795659f26dd4fe4ebde38abcb0984d Mon Sep 17 00:00:00 2001 From: Ashish Vijaywargiya Date: Sat, 5 Sep 2009 08:01:59 +0000 Subject: [PATCH] Minor Improvements. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@811600 13f79535-47bb-0310-9956-ffa450edef68 --- ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java b/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java index 7b4b4026a..4a6b2efd2 100755 --- a/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java +++ b/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java @@ -208,6 +208,16 @@ public class ProductsExportToEbay { 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 @@ public class ProductsExportToEbay { 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 @@ public class ProductsExportToEbay { 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);