Package org.ofbiz.entity

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


        List<GenericValue> facilities = null;
        try {
            if (facilityId != null) {
                facilities = delegator.findByAnd("Facility", UtilMisc.toMap("facilityId", facilityId));
            } else {
                facilities = delegator.findList("Facility", null, null, null, null, false);
            }
        } catch (GenericEntityException e) {
            return ServiceUtil.returnError("Unable to locate facilities." + e.getMessage());
        }
View Full Code Here


        EntityCondition productPriceEc = EntityCondition.makeCondition(productPriceEcList, EntityOperator.AND);

        // for prices, get all ProductPrice entities for this productId and currencyUomId
        List<GenericValue> productPrices = null;
        try {
            productPrices = delegator.findList("ProductPrice", productPriceEc, null, UtilMisc.toList("-fromDate"), null, true);
        } catch (GenericEntityException e) {
            Debug.logError(e, "An error occurred while getting the product prices", module);
        }
        productPrices = EntityUtil.filterByDate(productPrices, true);
View Full Code Here

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

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

            if (allCategories == null)
                return;
            for (GenericValue curCat: allCategories) {
                Collection<GenericValue> parentCats = curCat.getRelatedCache("CurrentProductCategoryRollup");
View Full Code Here

    }

    public static List<GenericValue> getRelatedWorkEfforts(GenericValue workEffort) throws GenericEntityException {
        GenericDelegator delegator = workEffort.getDelegator();
        String workEffortId = workEffort.getString("workEffortId");
        List<GenericValue> relatedParties = EntityUtil.filterByDate(delegator.findList("WorkEffortPartyAssignment", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false));
        List<GenericValue> relatedFixedAssets = EntityUtil.filterByDate(delegator.findList("WorkEffortFixedAssetAssign", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false));
        List<GenericValue> workEfforts = FastList.newInstance();
        List<EntityCondition> conditionList = UtilMisc.<EntityCondition>toList(
                EntityCondition.makeCondition("scopeEnumId", EntityOperator.EQUALS, "WES_PUBLIC"),
                EntityCondition.makeCondition("workEffortTypeId", EntityOperator.NOT_EQUAL, "PUBLISH_PROPS"));
View Full Code Here

    public static List<GenericValue> getRelatedWorkEfforts(GenericValue workEffort) throws GenericEntityException {
        GenericDelegator delegator = workEffort.getDelegator();
        String workEffortId = workEffort.getString("workEffortId");
        List<GenericValue> relatedParties = EntityUtil.filterByDate(delegator.findList("WorkEffortPartyAssignment", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false));
        List<GenericValue> relatedFixedAssets = EntityUtil.filterByDate(delegator.findList("WorkEffortFixedAssetAssign", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false));
        List<GenericValue> workEfforts = FastList.newInstance();
        List<EntityCondition> conditionList = UtilMisc.<EntityCondition>toList(
                EntityCondition.makeCondition("scopeEnumId", EntityOperator.EQUALS, "WES_PUBLIC"),
                EntityCondition.makeCondition("workEffortTypeId", EntityOperator.NOT_EQUAL, "PUBLISH_PROPS"));
        EntityExpr variableExpr = EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, "");
View Full Code Here

        EntityExpr variableExpr = EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, "");
        conditionList.add(variableExpr);
        EntityCondition workEffortCond = EntityCondition.makeCondition(conditionList);
        for (GenericValue partyValue : relatedParties) {
            variableExpr.init("partyId", EntityOperator.EQUALS, partyValue.get("partyId"));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", workEffortCond, null, null, null, false)));
        }
        for (GenericValue fixedAssetValue : relatedFixedAssets) {
            variableExpr.init("fixedAssetId", EntityOperator.EQUALS, fixedAssetValue.get("fixedAssetId"));
            workEfforts.addAll(delegator.findList("WorkEffort", workEffortCond, null, null, null, false));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", workEffortCond, null, null, null, false)));
View Full Code Here

            variableExpr.init("partyId", EntityOperator.EQUALS, partyValue.get("partyId"));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", workEffortCond, null, null, null, false)));
        }
        for (GenericValue fixedAssetValue : relatedFixedAssets) {
            variableExpr.init("fixedAssetId", EntityOperator.EQUALS, fixedAssetValue.get("fixedAssetId"));
            workEfforts.addAll(delegator.findList("WorkEffort", workEffortCond, null, null, null, false));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", workEffortCond, null, null, null, false)));
        }
        workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAssocToView", EntityCondition.makeCondition("workEffortIdFrom", EntityOperator.EQUALS, workEffortId), null, null, null, false)));
        return WorkEffortWorker.removeDuplicateWorkEfforts(workEfforts);
    }
View Full Code Here

            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", workEffortCond, null, null, null, false)));
        }
        for (GenericValue fixedAssetValue : relatedFixedAssets) {
            variableExpr.init("fixedAssetId", EntityOperator.EQUALS, fixedAssetValue.get("fixedAssetId"));
            workEfforts.addAll(delegator.findList("WorkEffort", workEffortCond, null, null, null, false));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", workEffortCond, null, null, null, false)));
        }
        workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAssocToView", EntityCondition.makeCondition("workEffortIdFrom", EntityOperator.EQUALS, workEffortId), null, null, null, false)));
        return WorkEffortWorker.removeDuplicateWorkEfforts(workEfforts);
    }
View Full Code Here

        for (GenericValue fixedAssetValue : relatedFixedAssets) {
            variableExpr.init("fixedAssetId", EntityOperator.EQUALS, fixedAssetValue.get("fixedAssetId"));
            workEfforts.addAll(delegator.findList("WorkEffort", workEffortCond, null, null, null, false));
            workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", workEffortCond, null, null, null, false)));
        }
        workEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAssocToView", EntityCondition.makeCondition("workEffortIdFrom", EntityOperator.EQUALS, workEffortId), null, null, null, false)));
        return WorkEffortWorker.removeDuplicateWorkEfforts(workEfforts);
    }

    public static VEvent makeEvent(GenericValue workEffort) throws GenericEntityException {
        GenericDelegator delegator = workEffort.getDelegator();
View Full Code Here

        Double durationMillis = workEffort.getDouble("estimatedMilliSeconds");
        if (durationMillis != null) {
            TimeDuration duration = TimeDuration.fromLong(durationMillis.longValue());
            eventProps.add(new Duration(new Dur(duration.days(), duration.hours(), duration.minutes(), duration.seconds())));
        }
        List<GenericValue> relatedParties = EntityUtil.filterByDate(delegator.findList("WorkEffortPartyAssignView", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false));
        for (GenericValue partyValue : relatedParties) {
            String partyName = partyValue.getString("groupName");
            if (UtilValidate.isEmpty(partyName)) {
                partyName = partyValue.getString("firstName") + " " + partyValue.getString("lastName");
            }
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.