You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2008/06/12 22:23:51 UTC
svn commit: r667219 - in /ofbiz/trunk/applications/product:
webapp/catalog/WEB-INF/actions/ webapp/catalog/WEB-INF/actions/find/
widget/catalog/
Author: mrisaliti
Date: Thu Jun 12 13:23:50 2008
New Revision: 667219
URL: http://svn.apache.org/viewvc?rev=667219&view=rev
Log:
Converted all catalog bsh scripts to groovy (Part of issue OFBIZ-1801)
Added:
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy
- copied, changed from r664476, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy
- copied, changed from r664476, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy
- copied, changed from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh
Removed:
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh
Modified:
ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml
ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy Thu Jun 12 13:23:50 2008
@@ -17,10 +17,8 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.product.category.*;
+import org.ofbiz.product.category.*
CategoryWorker.getCategoriesWithNoParent(request, "noParentCategories");
noParentCategories = request.getAttribute("noParentCategories");
-context.put("noParentCategories", noParentCategories);
+context.noParentCategories = noParentCategories;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy Thu Jun 12 13:23:50 2008
@@ -17,21 +17,21 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.entity.util.*;
+import org.ofbiz.base.util.*
+import org.ofbiz.entity.*
+import org.ofbiz.entity.util.*
-List messageList = new LinkedList();
+messageList = [];
messageList.add("Loading Categories...");
UtilTimer ctimer = new UtilTimer();
messageList.add(ctimer.timerString("Before category find"));
-EntityListIterator categories = delegator.find("ProductCategory", null, null, null, null, null);
+categories = delegator.find("ProductCategory", null, null, null, null, null);
messageList.add(ctimer.timerString("Before load all categories into cache"));
-GenericValue category = null;
+category = null;
long numCategories = 0;
-while ((category = (GenericValue) categories.next()) != null) {
+while ((category = (GenericValue) categories.next())) {
delegator.putInPrimaryKeyCache(category.getPrimaryKey(), category);
numCategories++;
}
@@ -45,11 +45,11 @@
messageList.add("Loading Products...");
UtilTimer ptimer = new UtilTimer();
messageList.add(ptimer.timerString("Before product find"));
-EntityListIterator products = delegator.find("Product", null, null, null, null, null);
+products = delegator.find("Product", null, null, null, null, null);
messageList.add(ptimer.timerString("Before load all products into cache"));
-GenericValue product = null;
+product = null;
long numProducts = 0;
-while ((product = (GenericValue) products.next()) != null) {
+while ((product = (GenericValue) products.next())) {
delegator.putInPrimaryKeyCache(product.getPrimaryKey(), product);
numProducts++;
}
@@ -58,4 +58,4 @@
messageList.add(ptimer.timerString("Finished Products"));
messageList.add("Loaded " + numProducts + " products");
-context.put("messageList", messageList);
+context.messageList = messageList;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy (from r664476, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh&r1=664476&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy Thu Jun 12 13:23:50 2008
@@ -17,26 +17,26 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.product.catalog.*;
-import org.ofbiz.product.feature.*;
-import org.ofbiz.product.product.*;
+import org.ofbiz.entity.condition.*
+import org.ofbiz.product.catalog.*
+import org.ofbiz.product.feature.*
+import org.ofbiz.product.product.*
-searchCategoryId = parameters.get("SEARCH_CATEGORY_ID");
-if (searchCategoryId == null || searchCategoryId.length() == 0) {
+searchCategoryId = parameters.SEARCH_CATEGORY_ID;
+if (!searchCategoryId || searchCategoryId.length() == 0) {
currentCatalogId = CatalogWorker.getCurrentCatalogId(request);
searchCategoryId = CatalogWorker.getCatalogSearchCategoryId(request, currentCatalogId);
}
-searchCategory = delegator.findByPrimaryKey("ProductCategory", UtilMisc.toMap("productCategoryId", searchCategoryId));
+searchCategory = delegator.findOne("ProductCategory", [productCategoryId : searchCategoryId], false);
-if (UtilValidate.isNotEmpty(searchCategoryId)) {
+if (searchCategoryId) {
productFeaturesByTypeMap = ParametricSearch.makeCategoryFeatureLists(searchCategoryId, delegator, 2000);
} else {
productFeaturesByTypeMap = ParametricSearch.getAllFeaturesByType(delegator, 2000);
}
productFeatureTypeIdsOrdered = new ArrayList(new TreeSet(productFeaturesByTypeMap.keySet()));
-searchOperator = parameters.get("SEARCH_OPERATOR");
+searchOperator = parameters.SEARCH_OPERATOR;
if (!"AND".equals(searchOperator) && !"OR".equals(searchOperator)) {
searchOperator = "OR";
}
@@ -45,17 +45,17 @@
searchSortOrderString = ProductSearchSession.searchGetSortOrderString(false, request);
// get suppliers in system
-supplerPartyRoleAndPartyDetails = delegator.findByAnd("PartyRoleAndPartyDetail", UtilMisc.toMap("roleTypeId", "SUPPLIER"), UtilMisc.toList("groupName", "firstName"));
+supplerPartyRoleAndPartyDetails = delegator.findList("PartyRoleAndPartyDetail", EntityCondition.makeCondition([roleTypeId : 'SUPPLIER']), null, ['groupName', 'firstName'], null, false);
// get the GoodIdentification types
-goodIdentificationTypes = delegator.findList("GoodIdentificationType", null, null, UtilMisc.toList("description"), null, false);
+goodIdentificationTypes = delegator.findList("GoodIdentificationType", null, null, ['description'], null, false);
-context.put("searchCategoryId", searchCategoryId);
-context.put("searchCategory", searchCategory);
-context.put("productFeaturesByTypeMap", productFeaturesByTypeMap);
-context.put("productFeatureTypeIdsOrdered", productFeatureTypeIdsOrdered);
-context.put("searchOperator", searchOperator);
-context.put("searchConstraintStrings", searchConstraintStrings);
-context.put("searchSortOrderString", searchSortOrderString);
-context.put("supplerPartyRoleAndPartyDetails", supplerPartyRoleAndPartyDetails);
-context.put("goodIdentificationTypes", goodIdentificationTypes);
\ No newline at end of file
+context.searchCategoryId = searchCategoryId;
+context.searchCategory = searchCategory;
+context.productFeaturesByTypeMap = productFeaturesByTypeMap;
+context.productFeatureTypeIdsOrdered = productFeatureTypeIdsOrdered;
+context.searchOperator = searchOperator;
+context.searchConstraintStrings = searchConstraintStrings;
+context.searchSortOrderString = searchSortOrderString;
+context.supplerPartyRoleAndPartyDetails = supplerPartyRoleAndPartyDetails;
+context.goodIdentificationTypes = goodIdentificationTypes;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy (from r664476, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh&r1=664476&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy Thu Jun 12 13:23:50 2008
@@ -17,39 +17,35 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.product.catalog.*;
-import org.ofbiz.product.feature.*;
-import org.ofbiz.product.product.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.entity.condition.*;
+import org.ofbiz.entity.condition.*
+import org.ofbiz.product.catalog.*
+import org.ofbiz.product.product.*
-module = "keywordsearch.bsh";
+module = "keywordsearch.groovy";
// note: this can be run multiple times in the same request without causing problems, will check to see on its own if it has run again
ProductSearchSession.processSearchParameters(parameters, request);
prodCatalogId = CatalogWorker.getCurrentCatalogId(request);
-Map result = ProductSearchSession.getProductSearchResult(request, delegator, prodCatalogId);
+result = ProductSearchSession.getProductSearchResult(request, delegator, prodCatalogId);
-applicationTypes = delegator.findList("ProductFeatureApplType", null, null, UtilMisc.toList("description"), null, false);
+applicationTypes = delegator.findList("ProductFeatureApplType", null, null, ['description'], null, false);
-//productCategories = delegator.findList("ProductCategory", null, null, UtilMisc.toList("description"), null, false);
expr = EntityCondition.makeCondition(EntityCondition.makeCondition("showInSelect", EntityOperator.EQUALS, null),
- EntityOperator.OR,
- EntityCondition.makeCondition("showInSelect", EntityOperator.NOT_EQUAL, "N"));
-productCategories = delegator.findList("ProductCategory", expr, null, UtilMisc.toList("description"), null, false);
-
-context.put("applicationTypes", applicationTypes);
-context.put("productCategories", productCategories);
-
-context.put("productIds", result.get("productIds"));
-context.put("viewIndex", result.get("viewIndex"));
-context.put("viewSize", result.get("viewSize"));
-context.put("listSize", result.get("listSize"));
-context.put("lowIndex", result.get("lowIndex"));
-context.put("highIndex", result.get("highIndex"));
-context.put("paging", result.get("paging"));
-context.put("previousViewSize", result.get("previousViewSize"));
-context.put("searchCategory", result.get("searchCategory"));
-context.put("searchConstraintStrings", result.get("searchConstraintStrings"));
-context.put("searchSortOrderString", result.get("searchSortOrderString"));
+ EntityOperator.OR,
+ EntityCondition.makeCondition("showInSelect", EntityOperator.NOT_EQUAL, "N"));
+productCategories = delegator.findList("ProductCategory", expr, null, ['description'], null, false);
+
+context.applicationTypes = applicationTypes;
+context.productCategories = productCategories;
+
+context.productIds = result.productIds;
+context.viewIndex = result.viewIndex;
+context.viewSize = result.viewSize;
+context.listSize = result.listSize;
+context.lowIndex = result.lowIndex;
+context.highIndex = result.highIndex;
+context.paging = result.paging;
+context.previousViewSize = result.previousViewSize;
+context.searchCategory = result.searchCategory;
+context.searchConstraintStrings = result.searchConstraintStrings;
+context.searchSortOrderString = result.searchSortOrderString;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy Thu Jun 12 13:23:50 2008
@@ -17,19 +17,15 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-
state = request.getParameter("SearchProductsState");
isOpen = true;
-if (state != null) {
+if (state) {
session.setAttribute("SearchProductsState", state);
isOpen = "open".equals(state);
} else {
state = (String) session.getAttribute("SearchProductsState");
- if (state != null) {
+ if (state) {
isOpen = "open".equals(state);
}
}
-
-context.put("isOpen", isOpen);
+context.isOpen = isOpen;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy Thu Jun 12 13:23:50 2008
@@ -17,40 +17,37 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-
-dispatcher = request.getAttribute("dispatcher");
+import org.ofbiz.base.util.*
state = request.getParameter("CategoryProductsState");
isOpen = true;
-if (state != null) {
+if (state) {
session.setAttribute("CategoryProductsState", state);
isOpen = "open".equals(state);
} else {
state = (String) session.getAttribute("CategoryProductsState");
- if (state != null) {
+ if (state) {
isOpen = "open".equals(state);
}
}
-context.put("isOpen", isOpen);
+context.isOpen = isOpen;
// Get a list of all products in the current category
if (isOpen) {
- paramInMap = new HashMap();
- paramInMap.put("productCategoryId", UtilFormatOut.checkNull(request.getParameter("productCategoryId")));
- paramInMap.put("defaultViewSize", 30);
- paramInMap.put("limitView", true);
- paramInMap.put("useCacheForMembers", false);
- paramInMap.put("checkViewAllow", false);
+ paramInMap = [:];
+ paramInMap.productCategoryId = UtilFormatOut.checkNull(request.getParameter("productCategoryId"));
+ paramInMap.defaultViewSize = 30;
+ paramInMap.limitView = true;
+ paramInMap.useCacheForMembers = false;
+ paramInMap.checkViewAllow = false;
// Returns: viewIndex, viewSize, lowIndex, highIndex, listSize, productCategory, productCategoryMembers
outMap = dispatcher.runSync("getProductCategoryAndLimitedMembers", paramInMap);
- context.put("viewIndex", outMap.get("viewIndex"));
- context.put("viewSize", outMap.get("viewSize"));
- context.put("lowIndex", outMap.get("lowIndex"));
- context.put("highIndex", outMap.get("highIndex"));
- context.put("listSize", outMap.get("listSize"));
- context.put("productCategory", outMap.get("productCategory"));
- context.put("productCategoryMembers", outMap.get("productCategoryMembers"));
-}
+ context.viewIndex = outMap.viewIndex;
+ context.viewSize = outMap.viewSize;
+ context.lowIndex = outMap.lowIndex;
+ context.highIndex = outMap.highIndex;
+ context.listSize = outMap.listSize;
+ context.productCategory = outMap.productCategory;
+ context.productCategoryMembers = outMap.productCategoryMembers;
+}
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy Thu Jun 12 13:23:50 2008
@@ -17,36 +17,30 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-
-delegator = request.getAttribute("delegator");
-
state = request.getParameter("BrowseCatalogsState");
isOpen = true;
-if (state != null) {
+if (state) {
session.setAttribute("BrowseCatalogsState", state);
isOpen = "open".equals(state);
} else {
state = (String) session.getAttribute("BrowseCatalogsState");
- if (state != null) {
+ if (state) {
isOpen = "open".equals(state);
}
}
-context.put("isOpen", isOpen);
+context.isOpen = isOpen;
//prodCatalogs
if (isOpen) {
prodCatalogs = delegator.findList("ProdCatalog", null, null, null, null, false);
- context.put("prodCatalogs", prodCatalogs);
+ context.prodCatalogs = prodCatalogs;
}
//get the current prodCatalogId
curProdCatalogId = request.getParameter("prodCatalogId");
-if (UtilValidate.isNotEmpty(curProdCatalogId)) {
+if (curProdCatalogId) {
session.setAttribute("curProdCatalogId", curProdCatalogId);
} else {
curProdCatalogId = (String) session.getAttribute("curProdCatalogId");
}
-context.put("curProdCatalogId", curProdCatalogId);
-
+context.curProdCatalogId = curProdCatalogId;
\ No newline at end of file
Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy (from r667195, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh&r1=667195&r2=667219&rev=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy Thu Jun 12 13:23:50 2008
@@ -17,44 +17,41 @@
* under the License.
*/
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.product.category.*;
-import javolution.util.FastMap;
-
-delegator = request.getAttribute("delegator");
+import org.ofbiz.base.util.*
+import org.ofbiz.entity.*
+import org.ofbiz.product.category.*
state = request.getParameter("BrowseCategoriesState");
isOpen = true;
-if (state != null) {
+if (state) {
session.setAttribute("BrowseCategoriesState", state);
isOpen = "open".equals(state);
} else {
state = (String) session.getAttribute("BrowseCategoriesState");
- if (state != null) {
+ if (state) {
isOpen = "open".equals(state);
}
}
-context.put("isOpen", isOpen);
+context.isOpen = isOpen;
requestParameters = UtilHttp.getParameterMap(request);
-defaultTopCategoryId = requestParameters.get("TOP_CATEGORY") != null ? requestParameters.get("TOP_CATEGORY") : UtilProperties.getPropertyValue("catalog", "top.category.default");
+defaultTopCategoryId = requestParameters.TOP_CATEGORY ? requestParameters.TOP_CATEGORY : UtilProperties.getPropertyValue("catalog", "top.category.default");
currentTopCategoryId = CategoryWorker.getCatalogTopCategory(request, defaultTopCategoryId);
currentTopCategory = null;
if (isOpen) {
CategoryWorker.getRelatedCategories(request, "topLevelList", currentTopCategoryId, false);
- currentTopCategory = delegator.findByPrimaryKeyCache("ProductCategory", UtilMisc.toMap("productCategoryId", currentTopCategoryId));
- context.put("topLevelList", request.getAttribute("topLevelList"));
+ currentTopCategory = delegator.findOne("ProductCategory", [productCategoryId : currentTopCategoryId], true);
+ context.topLevelList = request.getAttribute("topLevelList");
}
-curCategoryId = UtilFormatOut.checkNull(requestParameters.get("productCategoryId"));
+curCategoryId = UtilFormatOut.checkNull(requestParameters.productCategoryId);
CategoryWorker.setTrail(request, curCategoryId);
-context.put("curCategoryId", curCategoryId);
-context.put("currentTopCategory", currentTopCategory);
+context.curCategoryId = curCategoryId;
+context.currentTopCategory = currentTopCategory;
categoryList = request.getAttribute("topLevelList");
-if(categoryList != null) {
- catContentWrappers = FastMap.newInstance();
- CategoryWorker.getCategoryContentWrappers(catContentWrappers, categoryList, request);
- context.put("catContentWrappers", catContentWrappers);
-}
+if (categoryList) {
+ catContentWrappers = [:];
+ CategoryWorker.getCategoryContentWrappers(catContentWrappers, categoryList, request);
+ context.catContentWrappers = catContentWrappers;
+}
\ No newline at end of file
Modified: ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml?rev=667219&r1=667218&r2=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml Thu Jun 12 13:23:50 2008
@@ -237,7 +237,7 @@
<condition-expr field-name="showInSelect" operator="not-equals" value="N"/>
<order-by field-name="description"/>
</entity-condition>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/keywordsearchbox.ftl"/></html></platform-specific>
@@ -247,7 +247,7 @@
<screen name="sidecatalogs">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/sidecatalogs.ftl"/></html></platform-specific>
@@ -257,7 +257,7 @@
<screen name="sidedeepcategory">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/sidedeepcategory.ftl"/></html></platform-specific>
@@ -267,7 +267,7 @@
<screen name="miniproductlist">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/miniproductlist.ftl"/></html></platform-specific>
@@ -283,7 +283,7 @@
<set field="MainColumnStyle" value="leftonly"/>
<set field="titleProperty" value="PageTitleChooseTopCategory"/>
- <script location="component://product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -302,7 +302,7 @@
<set field="MainColumnStyle" value="leftonly"/>
<set field="titleProperty" value="ProductFastLoadCatalogIntoCache"/>
- <script location="component://product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
Modified: ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml?rev=667219&r1=667218&r2=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml Thu Jun 12 13:23:50 2008
@@ -36,7 +36,7 @@
<screen name="keywordsearchbox">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearchbox.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/keywordsearchbox.ftl"/></html></platform-specific>
@@ -46,7 +46,7 @@
<screen name="sidecatalogs">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/sidecatalogs.ftl"/></html></platform-specific>
@@ -56,7 +56,7 @@
<screen name="sidedeepcategory">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/sidedeepcategory.ftl"/></html></platform-specific>
@@ -66,7 +66,7 @@
<screen name="miniproductlist">
<section>
<actions>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/miniproductlist.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://product/webapp/catalog/find/miniproductlist.ftl"/></html></platform-specific>
@@ -82,7 +82,7 @@
<set field="MainColumnStyle" value="leftonly"/>
<set field="titleProperty" value="PageTitleChooseTopCategory"/>
- <script location="component://product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/ChooseTopCategory.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -104,7 +104,7 @@
<set field="MainColumnStyle" value="leftonly"/>
<set field="titleProperty" value="ProductFastLoadCatalogIntoCache"/>
- <script location="component://product/webapp/catalog/WEB-INF/actions/FastLoadCache.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
Modified: ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml?rev=667219&r1=667218&r2=667219&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml Thu Jun 12 13:23:50 2008
@@ -60,7 +60,7 @@
<entity-condition entity-name="ProdCatalog" list-name="prodCatalogs">
<order-by field-name="catalogName"/>
</entity-condition>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonFindDecorator">
@@ -77,7 +77,7 @@
<section>
<actions>
<set field="titleProperty" value="PageTitleSearchResults"/>
- <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh"/>
+ <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonFindDecorator">