You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/11/05 15:55:53 UTC

svn commit: r833054 - in /ofbiz/trunk: applications/product/src/org/ofbiz/product/product/ProductSearchSession.java specialpurpose/ecommerce/data/DemoProduct.xml

Author: ashish
Date: Thu Nov  5 14:55:15 2009
New Revision: 833054

URL: http://svn.apache.org/viewvc?rev=833054&view=rev
Log:
Applied patch from jira issue OFBIZ-3167 - Add Constraint with respect to eBay root category for product search and change demo data according to the concept.

As we have different productCatalogCategoryType for eBay so add a constraint on searching that if catalog not associated with any PCCT_BROWSE_ROOT type category then also search for PCCT_EBAY_ROOT type category for CatalogConstrain. This will help to manage separate catalog and catalog category association for ebay.

Thanks Parimal for the contribution.

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=833054&r1=833053&r2=833054&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Thu Nov  5 14:55:15 2009
@@ -580,7 +580,11 @@
         if (UtilValidate.isNotEmpty((String) parameters.get("SEARCH_CATALOG_ID"))) {
             String searchCatalogId = (String) parameters.get("SEARCH_CATALOG_ID");
             if (searchCatalogId != null && !searchCatalogId.equalsIgnoreCase("")) {
-                List<GenericValue> categories = CategoryWorker.getRelatedCategoriesRet(request, "topLevelList", CatalogWorker.getCatalogTopCategoryId(request, searchCatalogId), true, false, true);
+                String topCategory = CatalogWorker.getCatalogTopCategoryId(request, searchCatalogId);
+                if (UtilValidate.isEmpty(topCategory)) {
+                    topCategory = CatalogWorker.getCatalogTopEbayCategoryId(request, searchCatalogId);
+                }
+                List<GenericValue> categories = CategoryWorker.getRelatedCategoriesRet(request, "topLevelList", topCategory, true, false, true);
                 searchAddConstraint(new ProductSearch.CatalogConstraint(searchCatalogId, categories), session);
                 constraintsChanged = true;
             }

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=833054&r1=833053&r2=833054&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Thu Nov  5 14:55:15 2009
@@ -247,8 +247,15 @@
     <ProductCategory categoryName="Toys &amp; Games"
         primaryParentCategoryId="GOOGLE_BASE" productCategoryId="GB_TYS_GMS" productCategoryTypeId="GOOGLE_BASE_CATEGORY"/>
 
+    <!--Catalog specific to eBay-->
+    <ProdCatalog prodCatalogId="eBayCatalog" catalogName="eBay Catalog" useQuickAdd="Y"/>
+    <ProductStoreCatalog productStoreId="9000" prodCatalogId="eBayCatalog" fromDate="2009-11-05 12:00:00.0" sequenceNum="4"/>
+
     <!-- Category specific to eBay -->
     <ProductCategory categoryName="15064" productCategoryId="eBay_Category" productCategoryTypeId="EBAY_CATEGORY"/>
+    <ProdCatalogCategory prodCatalogId="eBayCatalog" productCategoryId="eBay_Category" fromDate="2009-11-05 12:00:00.0" sequenceNum="1" prodCatalogCategoryTypeId="PCCT_EBAY_ROOT"/>
+    
+    <ProductCategory productCategoryId="eBay_ECom_Category" categoryName="Ebay E-Commerce Category" productCategoryTypeId="EBAY_CATEGORY"/>
 
     <ProdCatalogCategory prodCatalogId="GoogleCatalog" productCategoryId="GOOGLE_BASE" fromDate="2001-05-13 12:00:00.0"
         sequenceNum="1" prodCatalogCategoryTypeId="PCCT_BROWSE_ROOT"/>
@@ -602,9 +609,9 @@
     <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="GOOGLE_BASE" productCategoryId="GB_TYS_GMS"/>
     
     <!-- ProductCategoryMember record specific to eBay -->
-    <ProductCategoryMember productCategoryId="eBay_Category" productId="GZ-1000" fromDate="2009-07-28 12:15:00.0"/>
-    <ProductCategoryMember productCategoryId="eBay_Category" productId="GZ-1001" fromDate="2009-07-28 12:15:00.0"/>
-    <ProductCategoryMember productCategoryId="eBay_Category" productId="GZ-2644" fromDate="2009-07-28 12:15:00.0"/>
+    <ProductCategoryMember productCategoryId="eBay_ECom_Category" productId="GZ-1000" fromDate="2009-11-05 12:15:00.0"/>
+    <ProductCategoryMember productCategoryId="eBay_ECom_Category" productId="GZ-1001" fromDate="2009-11-05 12:15:00.0"/>
+    <ProductCategoryMember productCategoryId="eBay_ECom_Category" productId="GZ-2644" fromDate="2009-11-05 12:15:00.0"/>
     
     <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="CATALOG1" productCategoryId="100"/>
     <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="100" productCategoryId="101"/>
@@ -616,6 +623,9 @@
     <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="201" productCategoryId="2012"/>
     <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="2011" productCategoryId="20111"/>
 
+    <!-- ProductCategoryRollup record specific to eBay -->
+    <ProductCategoryRollup parentProductCategoryId="eBay_Category" productCategoryId="eBay_ECom_Category" fromDate="2009-11-05 12:00:00.0"/>
+
     <!-- some default product facility settings -->
     <ProductFacility productId="GZ-2644" facilityId="WebStoreWarehouse" minimumStock="2" reorderQuantity="10" daysToShip="15"/>
     <ProductFacility productId="GZ-8544" facilityId="WebStoreWarehouse" minimumStock="20" reorderQuantity="50" daysToShip="1"/>