📄 searchbrowsecategoryaction.java
字号:
package com.bluesky.elecall.web.struts.action;
import java.util.Iterator;
import java.util.Set;
import com.bluesky.elecall.domain.IProductCategory;
import com.bluesky.elecall.domain.CategoryItem;
import com.bluesky.elecall.domain.search.CategoryStatisticsItem;
import com.opensymphony.xwork2.ActionInvocation;
public class SearchBrowseCategoryAction extends ProductCategoryBaseAction {
/**
*
*/
private static final long serialVersionUID = -905631074830993753L;
// form bean
private String nextAction;
private CategoryStatisticsItem categoryStatisticsItem;
public String list() {
categoryItem = productCategory.getCategoryItem(categoryItemId);
if (categoryItem == null)// search
currentCategoryItem = productCategory.getRootCategoryItem();
else {
if (categoryItem.getLevel() == 4)
currentCategoryItem = productCategory
.getParentCategoryItem(categoryItem);
else
currentCategoryItem = categoryItem;
}
if (keywords == null || keywords.trim().length() == 0)// browse
{
categoryStatisticsItem = productCategory
.getCategoryStatistics(currentCategoryItem);
} else// search
{
categoryStatisticsItem = productCategory.getCategoryStatistics(
currentCategoryItem, keywords);
}
return SUCCESS;
}
@Override
public String execute() throws Exception {
return list();
}
@Override
public void beforeResult(ActionInvocation arg0, String arg1) {
if (currentCategoryItem != null && currentCategoryItem.getLevel() >= 2)
nextAction = "product-list.action";
else
nextAction = "search-browse-category.action";
super.beforeResult(arg0, arg1);
}
public String getNextAction() {
return nextAction;
}
public void setNextAction(String nextAction) {
this.nextAction = nextAction;
}
public CategoryStatisticsItem getCategoryStatisticsItem() {
return categoryStatisticsItem;
}
public void setCategoryStatisticsItem(
CategoryStatisticsItem categoryStatisticsItem) {
this.categoryStatisticsItem = categoryStatisticsItem;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -