Package org.ofbiz.entity

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


        //Debug.logInfo("updateSiteRoles, serviceContext(0):" + serviceContext, module);
        //Debug.logInfo("updateSiteRoles, context(0):" + context, module);

        List<GenericValue> siteRoles = null;
        try {
            siteRoles = delegator.findByAndCache("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"));
        } catch (GenericEntityException e) {
          return ServiceUtil.returnError(e.toString());
        }
        for(GenericValue roleType : siteRoles) {
            String siteRole = (String)roleType.get("roleTypeId"); // BLOG_EDITOR, BLOG_ADMIN, etc.
View Full Code Here


        Integer useTime = (Integer) context.get("useTime");
        String useTimeUomId = (String) context.get("useTimeUomId");
        boolean hasExistingContentRole = false;
        GenericValue contentRole = null;
        try {
            List<GenericValue> contentRoleList = delegator.findByAndCache("ContentRole", UtilMisc.toMap("partyId", partyId, "contentId", webPubPt, "roleTypeId", roleTypeId));
            List<GenericValue> listFiltered = EntityUtil.filterByDate(contentRoleList, true);
            List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("fromDate DESC"));
            if (listOrdered.size() > 0) {
                contentRole = listOrdered.get(0);
                hasExistingContentRole = true;
View Full Code Here

        if (orderCreatedDate == null) {
            orderCreatedDate = UtilDateTime.nowTimestamp();
        }
        GenericValue productContent = null;
           try {
            List<GenericValue> lst = delegator.findByAndCache("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"));
            List<GenericValue> listFiltered = EntityUtil.filterByDate(lst, orderCreatedDate, "purchaseFromDate", "purchaseThruDate", true);
            List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate"));
            List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null));
            if (listThrusOnly.size() > 0) {
                productContent = listThrusOnly.get(0);
View Full Code Here

        Timestamp orderCreatedDate = (Timestamp) context.get("orderCreatedDate");
        if (orderCreatedDate == null) {
            orderCreatedDate = UtilDateTime.nowTimestamp();
        }
        try {
            List<GenericValue> productSubscriptionResourceList = delegator.findByAndCache("ProductSubscriptionResource", UtilMisc.toMap("productId", productId));
            productSubscriptionResourceList = EntityUtil.filterByDate(productSubscriptionResourceList, orderCreatedDate, null, null, true);
            productSubscriptionResourceList = EntityUtil.filterByDate(productSubscriptionResourceList, orderCreatedDate, "purchaseFromDate", "purchaseThruDate", true);

            if (productSubscriptionResourceList.size() == 0) {
                Debug.logError("No ProductSubscriptionResource found for productId: " + productId, module);
View Full Code Here

                BigDecimal qty = orderItem.getBigDecimal("quantity");
                String productId = orderItem.getString("productId");
                if (UtilValidate.isEmpty(productId)) {
                    continue;
                }
                List<GenericValue> productSubscriptionResourceList = delegator.findByAndCache("ProductSubscriptionResource", UtilMisc.toMap("productId", productId));
                List<GenericValue> productSubscriptionResourceListFiltered = EntityUtil.filterByDate(productSubscriptionResourceList, true);
                if (productSubscriptionResourceListFiltered.size() > 0) {
                    subContext.put("subscriptionTypeId", "PRODUCT_SUBSCR");
                    subContext.put("productId", productId);
                    subContext.put("orderId", orderId);
View Full Code Here

        result.put("offsetQOHQtyAvailable", offsetQOHQtyAvailable);
        result.put("offsetATPQtyAvailable", offsetATPQtyAvailable);

        List<GenericValue> productPrices = null;
        try {
            productPrices = delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId",productId), UtilMisc.toList("-fromDate"));
        } catch (GenericEntityException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        //change this for product price
View Full Code Here

                    productContentConds.add(EntityUtil.getFilterByDateExpr());
                    List<GenericValue> productContentInfos = delegator.findList("ProductContentAndInfo", EntityCondition.makeCondition(productContentConds), null, UtilMisc.toList("-fromDate"), null, true);
                    if (UtilValidate.isNotEmpty(productContentInfos)) {
                        for(GenericValue productContentInfo : productContentInfos){
                            String contentId = (String) productContentInfo.get("contentId");
                            List<GenericValue> ContentAssocDataResourceViewTos = delegator.findByAndCache("ContentAssocDataResourceViewTo", UtilMisc.toMap("contentIdStart", contentId, "caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                            if (UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)){
                                for (GenericValue ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
                                    GenericValue ElectronicText = ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
                                    if (UtilValidate.isNotEmpty(ElectronicText)) {
                                        String textData = (String) ElectronicText.get("textData");
View Full Code Here

                                        }
                                    }
                                }
                            }
                            if (UtilValidate.isEmpty(productId)) {
                                List<GenericValue> contentDataResourceViews = delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                                for (GenericValue contentDataResourceView : contentDataResourceViews) {
                                    GenericValue ElectronicText = contentDataResourceView.getRelatedOneCache("ElectronicText");
                                    if (UtilValidate.isNotEmpty(ElectronicText)) {
                                        String textData = (String) ElectronicText.get("textData");
                                        if (UtilValidate.isNotEmpty(textData)) {
View Full Code Here

                    productCategoryContentConds.add(EntityUtil.getFilterByDateExpr());
                    List<GenericValue> productCategoryContentInfos = delegator.findList("ProductCategoryContentAndInfo", EntityCondition.makeCondition(productCategoryContentConds), null, UtilMisc.toList("-fromDate"), null, true);
                    if (UtilValidate.isNotEmpty(productCategoryContentInfos)) {
                        for(GenericValue productCategoryContentInfo : productCategoryContentInfos){
                            String contentId = (String) productCategoryContentInfo.get("contentId");
                            List<GenericValue> ContentAssocDataResourceViewTos = delegator.findByAndCache("ContentAssocDataResourceViewTo", UtilMisc.toMap("contentIdStart", contentId, "caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                            if (UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)){
                                for (GenericValue ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
                                    GenericValue ElectronicText = ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
                                    if (UtilValidate.isNotEmpty(ElectronicText)){
                                        String textData = (String) ElectronicText.get("textData");
View Full Code Here

                                        }
                                    }
                                }
                            }
                            if (UtilValidate.isEmpty(productCategoryId)) {
                                List<GenericValue> contentDataResourceViews = delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                                for (GenericValue contentDataResourceView : contentDataResourceViews) {
                                    GenericValue ElectronicText = contentDataResourceView.getRelatedOneCache("ElectronicText");
                                    if (UtilValidate.isNotEmpty(ElectronicText)) {
                                        String textData = (String) ElectronicText.get("textData");
                                        if (UtilValidate.isNotEmpty(textData)) {
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.