本文整理匯總了Java中org.ofbiz.product.product.ProductSearch.ResultSortOrder類的典型用法代碼示例。如果您正苦於以下問題:Java ResultSortOrder類的具體用法?Java ResultSortOrder怎麽用?Java ResultSortOrder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ResultSortOrder類屬於org.ofbiz.product.product.ProductSearch包,在下文中一共展示了ResultSortOrder類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: searchDo
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public static ArrayList<String> searchDo(HttpSession session, Delegator delegator, String prodCatalogId) {
String visitId = VisitHandler.getVisitId(session);
ProductSearchOptions productSearchOptions = getProductSearchOptions(session);
List<ProductSearchConstraint> productSearchConstraintList = productSearchOptions.getConstraintList();
if (UtilValidate.isEmpty(productSearchConstraintList)) {
// no constraints, don't do a search...
return new ArrayList<String>();
}
ResultSortOrder resultSortOrder = productSearchOptions.getResultSortOrder();
// if the search options have changed since the last search, put at the beginning of the options history list
checkSaveSearchOptionsHistory(session);
return ProductSearch.searchProducts(productSearchConstraintList, resultSortOrder, delegator, visitId);
}
示例2: getProductSearchResults
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public static EntityListIterator getProductSearchResults(HttpServletRequest request) {
HttpSession session = request.getSession();
Delegator delegator = (Delegator) request.getAttribute("delegator");
String visitId = VisitHandler.getVisitId(session);
List<ProductSearch.ProductSearchConstraint> productSearchConstraintList = ProductSearchSession.ProductSearchOptions.getConstraintList(session);
// if no constraints, don't do a search...
if (UtilValidate.isNotEmpty(productSearchConstraintList)) {
ResultSortOrder resultSortOrder = ProductSearchSession.ProductSearchOptions.getResultSortOrder(request);
ProductSearchSession.checkSaveSearchOptionsHistory(session);
ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId);
productSearchContext.addProductSearchConstraints(productSearchConstraintList);
productSearchContext.setResultSortOrder(resultSortOrder);
return productSearchContext.doQuery(delegator);
} else {
return null;
}
}
示例3: getResultSortOrder
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public ResultSortOrder getResultSortOrder() {
if (this.resultSortOrder == null) {
this.resultSortOrder = new SortKeywordRelevancy();
this.changed = true;
}
return this.resultSortOrder;
}
示例4: setResultSortOrder
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public static void setResultSortOrder(ResultSortOrder resultSortOrder, HttpSession session) {
ProductSearchOptions productSearchOptions = getProductSearchOptions(session);
productSearchOptions.resultSortOrder = resultSortOrder;
productSearchOptions.changed = true;
}
示例5: searchGetSortOrderString
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public static String searchGetSortOrderString(boolean detailed, HttpServletRequest request) {
Locale locale = UtilHttp.getLocale(request);
ResultSortOrder resultSortOrder = ProductSearchOptions.getResultSortOrder(request);
if (resultSortOrder == null) return "";
return resultSortOrder.prettyPrintSortOrder(detailed, locale);
}
示例6: searchSetSortOrder
import org.ofbiz.product.product.ProductSearch.ResultSortOrder; //導入依賴的package包/類
public static void searchSetSortOrder(ResultSortOrder resultSortOrder, HttpSession session) {
ProductSearchOptions.setResultSortOrder(resultSortOrder, session);
}