當前位置: 首頁>>代碼示例>>Java>>正文


Java CategoryWorker.getCategoryRollupTrails方法代碼示例

本文整理匯總了Java中org.ofbiz.product.category.CategoryWorker.getCategoryRollupTrails方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryWorker.getCategoryRollupTrails方法的具體用法?Java CategoryWorker.getCategoryRollupTrails怎麽用?Java CategoryWorker.getCategoryRollupTrails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.ofbiz.product.category.CategoryWorker的用法示例。


在下文中一共展示了CategoryWorker.getCategoryRollupTrails方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getProductRollupTrails

import org.ofbiz.product.category.CategoryWorker; //導入方法依賴的package包/類
/**
 * SCIPIO: Returns all rollups for a product that have the given top categories.
 * TODO: REVIEW: maybe this can be optimized with a smarter algorithm?
 * Added 2017-11-09.
 */
public static List<List<String>> getProductRollupTrails(Delegator delegator, String productId, Set<String> topCategoryIds, boolean useCache) {
    List<GenericValue> prodCatMembers;
    try {
        prodCatMembers = EntityQuery.use(delegator).from("ProductCategoryMember")
                .where("productId", productId).orderBy("-fromDate").filterByDate().cache(useCache).queryList();
    } catch (GenericEntityException e) {
        Debug.logError("Cannot generate trail from product '" + productId + "'", productId);
        return new ArrayList<>();
    }
    if (prodCatMembers.size() == 0) return new ArrayList<>();
    
    List<List<String>> possibleTrails = null;
    for(GenericValue prodCatMember : prodCatMembers) {
        List<List<String>> trails = CategoryWorker.getCategoryRollupTrails(delegator, prodCatMember.getString("productCategoryId"), topCategoryIds, useCache);
        if (possibleTrails == null) possibleTrails = trails;
        else possibleTrails.addAll(trails);
    }
    return possibleTrails;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:25,代碼來源:ProductWorker.java

示例2: getCategoryTrail

import org.ofbiz.product.category.CategoryWorker; //導入方法依賴的package包/類
public static List<List<String>> getCategoryTrail(String productCategoryId, DispatchContext dctx) {
    return CategoryWorker.getCategoryRollupTrails(dctx.getDelegator(), productCategoryId, true);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:4,代碼來源:SolrCategoryUtil.java

示例3: getCategoryRollupTrails

import org.ofbiz.product.category.CategoryWorker; //導入方法依賴的package包/類
/**
 * Return all paths from the given topCategoryIds to the category.
 * <p>
 * TODO?: perhaps can cache with UtilCache in future, or read from a cached category tree.
 */
protected List<List<String>> getCategoryRollupTrails(Delegator delegator, String productCategoryId, Set<String> topCategoryIds) {
    return CategoryWorker.getCategoryRollupTrails(delegator, productCategoryId, topCategoryIds, true);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:9,代碼來源:SeoCatalogUrlWorker.java


注:本文中的org.ofbiz.product.category.CategoryWorker.getCategoryRollupTrails方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。