svn commit: r772407 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java

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

svn commit: r772407 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java

jonesde
Author: jonesde
Date: Wed May  6 19:13:37 2009
New Revision: 772407

URL: http://svn.apache.org/viewvc?rev=772407&view=rev
Log:
Added functionality to also get the rootCategoryId (ie in addition to the categoryId) and put it in a request attribute along with the categoryId and productId/product_id

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java?rev=772407&r1=772406&r2=772407&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java Wed May  6 19:13:37 2009
@@ -122,13 +122,21 @@
             CategoryWorker.setTrail(request, trail);
             categoryId = pathElements.get(pathElements.size() - 1);
         }
-
         if (categoryId != null) {
             request.setAttribute("productCategoryId", categoryId);
         }
-        // setup the data and forward the request
+
+        String rootCategoryId = null;
+        if (pathElements.size() >= 1) {
+            rootCategoryId = pathElements.get(0);
+        }
+        if (rootCategoryId != null) {
+            request.setAttribute("rootCategoryId", rootCategoryId);
+        }
+
         if (productId != null) {
             request.setAttribute("product_id", productId);
+            request.setAttribute("productId", productId);
         }
 
         RequestDispatcher rd = request.getRequestDispatcher("/" + CONTROL_MOUNT_POINT + "/" + (productId != null ? PRODUCT_REQUEST : CATEGORY_REQUEST));