Author: jonesde
Date: Wed Feb 21 01:44:22 2007
New Revision: 509953
URL: http://svn.apache.org/viewvc?view=rev&rev=509953
Log:
Last commit for fixing the prod cat link category ID thingy wasn't adequate,
cleaned up the categorydetail.bsh script and simplified what is done in the
field mapping in the query in the screen def
Modified:
ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
Modified: ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml?view=diff&rev=509953&r1=509952&r2=509953
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml Wed Feb 21
01:44:22 2007
@@ -203,8 +203,9 @@
<set field="productCategoryLinkScreen"
value="component://ecommerce/widget/CatalogScreens.xml#ProductCategoryLink"/>
<script
location="component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh"/>
+
<entity-and entity-name="ProductCategoryLink"
list-name="productCategoryLinks" use-cache="true" filter-by-date="true">
- <field-map field-name="productCategoryId"
env-name="parameters.category_id"/>
+ <field-map field-name="productCategoryId"
env-name="productCategoryId"/>
<order-by field-name="sequenceNum"/>
</entity-and>
</actions>
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh?view=diff&rev=509953&r1=509952&r2=509953
==============================================================================
---
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
(original)
+++
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
Wed Feb 21 01:44:22 2007
@@ -28,6 +28,9 @@
import org.ofbiz.product.catalog.*;
import org.ofbiz.product.category.CategoryContentWrapper;
+productCategoryId = request.getAttribute("productCategoryId");
+context.put("productCategoryId", productCategoryId);
+
viewSize = parameters.get("VIEW_SIZE");
viewIndex = parameters.get("VIEW_INDEX");
currentCatalogId = CatalogWorker.getCurrentCatalogId(request);
@@ -61,7 +64,6 @@
catResult = dispatcher.runSync("getProductCategoryAndLimitedMembers", andMap);
productCategory = catResult.get("productCategory");
-context.put("productCategoryId", request.getAttribute("productCategoryId"));
if (catResult != null) {
context.put("productCategoryMembers",
catResult.get("productCategoryMembers"));
context.put("productCategory", productCategory);
@@ -73,15 +75,15 @@
}
// set this as a last viewed
-categoryId = parameters.get("productCategoryId");
+// DEJ20070220: WHY is this done this way? why not use the existing
CategoryWorker stuff?
int LAST_VIEWED_TO_KEEP = 10; // modify this to change the number of last
viewed to keep
lastViewedCategories = session.getAttribute("lastViewedCategories");
if (lastViewedCategories == null) {
lastViewedCategories = new LinkedList();
session.setAttribute("lastViewedCategories", lastViewedCategories);
}
-lastViewedCategories.remove(categoryId);
-lastViewedCategories.add(0, categoryId);
+lastViewedCategories.remove(productCategoryId);
+lastViewedCategories.add(0, productCategoryId);
while (lastViewedCategories.size() > LAST_VIEWED_TO_KEEP) {
lastViewedCategories.remove(lastViewedCategories.size() - 1);
}