Examples of findList()


Examples of org.ofbiz.entity.Delegator.findList()

                        , EntityOperator.OR
                        , EntityCondition.makeCondition("drObjectInfo", "/" + alternativeUrl)));
                productContentConds.add(EntityCondition.makeCondition("localeString", localeString));
                productCategoryContentConds.add(EntityCondition.makeCondition("prodCatContentTypeId", "ALTERNATIVE_URL"));
                productCategoryContentConds.add(EntityUtil.getFilterByDateExpr());
                List<GenericValue> productCategoryContentInfos = delegator.findList("ProductCategoryContentAndInfo", EntityCondition.makeCondition(productCategoryContentConds), null, UtilMisc.toList("-fromDate"), null, true);
                if (UtilValidate.isNotEmpty(productCategoryContentInfos)) {
                    GenericValue productCategoryContentInfo = EntityUtil.getFirst(productCategoryContentInfos);
                    productCategoryId = productCategoryContentInfo.getString("productCategoryId");
                }
            } catch (GenericEntityException e) {
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

            if (UtilValidate.isNotEmpty(productId)) {
                try {
                    List<EntityCondition> conds = FastList.newInstance();
                    conds.add(EntityCondition.makeCondition("productId", productId));
                    conds.add(EntityUtil.getFilterByDateExpr());
                    List<GenericValue> productCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition(conds), UtilMisc.toSet("productCategoryId"), UtilMisc.toList("-fromDate"), null, true);
                    if (UtilValidate.isNotEmpty(productCategoryMembers)) {
                        GenericValue productCategoryMember = EntityUtil.getFirst(productCategoryMembers);
                        productCategoryId = productCategoryMember.getString("productCategoryId");
                    }
                } catch (GenericEntityException e) {
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

            if (UtilValidate.isNotEmpty(productId)) {
                try {
                    List<EntityCondition> rolllupConds = FastList.newInstance();
                    rolllupConds.add(EntityCondition.makeCondition("productId", productId));
                    rolllupConds.add(EntityUtil.getFilterByDateExpr());
                    List<GenericValue> productCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("-fromDate"), null, true);
                    for (GenericValue productCategoryMember : productCategoryMembers) {
                        String trailCategoryId = productCategoryMember.getString("productCategoryId");
                        if (trailCategoryIds.contains(trailCategoryId)) {
                            productCategoryId = trailCategoryId;
                            break;
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                    // find product category rollup
                    try {
                        List<EntityCondition> rolllupConds = FastList.newInstance();
                        rolllupConds.add(EntityCondition.makeCondition("productCategoryId", parentProductCategoryId));
                        rolllupConds.add(EntityUtil.getFilterByDateExpr());
                        List<GenericValue> productCategoryRollups = delegator.findList("ProductCategoryRollup", EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("-fromDate"), null, true);
                        if (UtilValidate.isNotEmpty(productCategoryRollups)) {
                            // add only categories that belong to the top category to trail
                            for (GenericValue productCategoryRollup : productCategoryRollups) {
                                String trailCategoryId = productCategoryRollup.getString("parentProductCategoryId");
                                parentProductCategoryId = trailCategoryId;
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

    public static void getCategoriesWithNoParent(ServletRequest request, String attributeName) {
        Delegator delegator = (Delegator) request.getAttribute("delegator");
        Collection<GenericValue> results = FastList.newInstance();

        try {
            Collection<GenericValue> allCategories = delegator.findList("ProductCategory", null, null, null, null, false);

            for (GenericValue curCat: allCategories) {
                Collection<GenericValue> parentCats = curCat.getRelatedCache("CurrentProductCategoryRollup");

                if (parentCats.isEmpty())
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                        EntityCondition.makeCondition(UtilMisc.toList(
                                EntityCondition.makeCondition("portalPageId", EntityOperator.EQUALS, parentPortalPageId),
                                EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
                                EntityOperator.OR)),
                        EntityOperator.AND);
                portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
                List<GenericValue> userPortalPages = new ArrayList<GenericValue>();
                if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
                    String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
                    // replace with private pages
                    for (GenericValue portalPage : portalPages) {
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                    for (GenericValue portalPage : portalPages) {
                        cond = EntityCondition.makeCondition(UtilMisc.toList(
                                EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
                                EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))),
                                EntityOperator.AND);
                        List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
                        if (UtilValidate.isNotEmpty(privatePortalPages)) {
                            //portalPages.remove(portalPage);
                            userPortalPages.add(privatePortalPages.get(0));
                        } else {
                            userPortalPages.add(portalPage);
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                    cond = EntityCondition.makeCondition(UtilMisc.toList(
                            EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
                            EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null),
                            EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
                            EntityOperator.AND);
                    userPortalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false));
                }
                portalPages = EntityUtil.orderBy(userPortalPages, UtilMisc.toList("sequenceNum"));
            } catch (GenericEntityException e) {
                Debug.logError("Could not retrieve portalpages:" + e.getMessage(), module);
            }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                    EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"),
                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
                        EntityOperator.OR)),
                    EntityOperator.AND);
                List <GenericValue> portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
                if (UtilValidate.isNotEmpty(portalPages)) {
                    portalPage = EntityUtil.getFirst(portalPages);
                }
               
                // If a derived PortalPage private to the user exists, returns this instead of the system one
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findList()

                // If a derived PortalPage private to the user exists, returns this instead of the system one
                cond = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPageId),
                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
                        EntityOperator.AND);
                List <GenericValue> privateDerivedPortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
                if (UtilValidate.isNotEmpty(privateDerivedPortalPages)) {
                    portalPage = EntityUtil.getFirst(privateDerivedPortalPages);
                }
            } catch (GenericEntityException e) {
                Debug.logError("Could not retrieve portalpage:" + e.getMessage(), module);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.