📄 categorydetail.bsh
字号:
/*
* Copyright (c) 2003 The Open For Business Project - www.ofbiz.org
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*@author Andy Zeneski (jaz@ofbiz.org)
*@version $Revision: 1.3 $
*@since 2.1
*/
import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.service.*;
import org.ofbiz.product.catalog.*;
requestParameters = UtilHttp.getParameterMap(request);
viewSize = requestParameters.get("VIEW_SIZE");
viewIndex = requestParameters.get("VIEW_INDEX");
currentCatalogId = CatalogWorker.getCurrentCatalogId(request);
// set the default view size
defaultViewSize = request.getAttribute("defaultViewSize");
if (defaultViewSize == null) {
defaultViewSize = new java.lang.Integer(10);
}
context.put("defaultViewSize", defaultViewSize);
// set the limit view
Boolean limitViewObj = request.getAttribute("limitView");
limitView = Boolean.TRUE;
if (limitViewObj != null) {
limitView = limitViewObj;
}
context.put("limitView", limitView);
// get the product category & members
dispatcher = request.getAttribute("dispatcher");
andMap = UtilMisc.toMap("productCategoryId", request.getAttribute("productCategoryId"),
"viewIndexString", viewIndex, "viewSizeString", viewSize,
"defaultViewSize", defaultViewSize, "limitView", limitView);
andMap.put("prodCatalogId", currentCatalogId);
andMap.put("checkViewAllow", Boolean.TRUE);
catResult = dispatcher.runSync("getProductCategoryAndLimitedMembers", andMap);
context.put("productCategoryId", request.getAttribute("productCategoryId"));
if (catResult != null) {
context.put("productCategoryMembers", catResult.get("productCategoryMembers"));
context.put("productCategory", catResult.get("productCategory"));
context.put("viewIndex", catResult.get("viewIndex"));
context.put("viewSize", catResult.get("viewSize"));
context.put("lowIndex", catResult.get("lowIndex"));
context.put("highIndex", catResult.get("highIndex"));
context.put("listSize", catResult.get("listSize"));
}
// set the content path prefix
contentPathPrefix = CatalogWorker.getContentPathPrefix(request);
context.put("contentPathPrefix", contentPathPrefix);
// little routine to see if any members have a quantity > 0 assigned
members = context.get("productCategoryMembers");
if (members != null && members.size() > 0) {
for (i = 0; i < members.size(); i++) {
productCategoryMember = (GenericValue) members.get(i);
if (productCategoryMember.get("quantity") != null && productCategoryMember.getDouble("quantity").doubleValue() > 0.0) {
context.put("hasQuantities", new Boolean(true));
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -