svn commit: r822222 - /ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java

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

svn commit: r822222 - /ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java

ashish-18
Author: ashish
Date: Tue Oct  6 11:22:02 2009
New Revision: 822222

URL: http://svn.apache.org/viewvc?rev=822222&view=rev
Log:
Now "product_type" tag will contain only values that are having ProductCategory.productCategoryTypeId = "GOOGLE_BASE_CATEGORY".

Modified:
    ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java

Modified: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=822222&r1=822221&r2=822222&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original)
+++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Tue Oct  6 11:22:02 2009
@@ -447,16 +447,19 @@
                 while (productCategoryMembersIter.hasNext()) {
                     GenericValue productCategoryMember = (GenericValue) productCategoryMembersIter.next();
                     GenericValue productCategory = productCategoryMember.getRelatedOne("ProductCategory");
-                    String categoryDescription = "";
-                    if (UtilValidate.isNotEmpty(productCategory.getString("categoryName"))) {
-                        categoryDescription = productCategory.getString("categoryName");  
-                    } else if (UtilValidate.isNotEmpty(productCategory.getString("description"))) {
-                        categoryDescription = productCategory.getString("description");
-                    } else if (UtilValidate.isNotEmpty(productCategory.getString("longDescription"))) {
-                        categoryDescription = productCategory.getString("longDescription");
-                    }
-                    if (UtilValidate.isNotEmpty(productCategory)) {
-                        UtilXml.addChildElementNSValue(entryElem, "g:product_type", StringUtil.wrapString(categoryDescription).toString() , feedDocument, googleBaseNSUrl);
+                    String productCategoryTypeId = productCategory.getString("productCategoryTypeId");
+                    if (UtilValidate.isNotEmpty(productCategoryTypeId) && "GOOGLE_BASE_CATEGORY".equals(productCategoryTypeId)) {
+                        String categoryDescription = "";
+                        if (UtilValidate.isNotEmpty(productCategory.getString("categoryName"))) {
+                            categoryDescription = productCategory.getString("categoryName");  
+                        } else if (UtilValidate.isNotEmpty(productCategory.getString("description"))) {
+                            categoryDescription = productCategory.getString("description");
+                        } else if (UtilValidate.isNotEmpty(productCategory.getString("longDescription"))) {
+                            categoryDescription = productCategory.getString("longDescription");
+                        }
+                        if (UtilValidate.isNotEmpty(productCategory)) {
+                            UtilXml.addChildElementNSValue(entryElem, "g:product_type", StringUtil.wrapString(categoryDescription).toString() , feedDocument, googleBaseNSUrl);
+                        }
                     }
                 }