Package org.libreplan.business.requirements.entities

Examples of org.libreplan.business.requirements.entities.IndirectCriterionRequirement


        final Map<HoursGroup, Map<Criterion, Boolean>> mapHoursGroup =
            createHoursGroupCriterionMap(originalIndirectCriterionRequirements);

        for (T each: orderElements) {

            IndirectCriterionRequirement indirect = IndirectCriterionRequirement
                    .create(parent, criterion);

            if (isOrderLine(each)) {
                for (HoursGroup hoursGroup: myHoursGroups(toOrderLine(each))) {
                    Map<Criterion, Boolean> criterionMap = mapHoursGroup.get(hoursGroup.getOrigin());
                    if (criterionMap != null) {
                        final Boolean valid = criterionMap.get(indirect.getCriterion());
                        indirect.setValid(valid);
                    }
                    hoursGroup.addCriterionRequirement(indirect);
                }
            }
View Full Code Here


    @Override
    public void setValidCriterionRequirementWrapper(
            CriterionRequirementWrapper requirementWrapper, boolean valid) {
        requirementWrapper.setValid(valid);
        IndirectCriterionRequirement requirement = (IndirectCriterionRequirement) requirementWrapper
                .getCriterionRequirement();
        setValidCriterionRequirement(requirement, valid);
        if (requirementWrapper.getCriterionWithItsType() != null) {
            updateExceptionInHoursGroups();
        }
View Full Code Here

        for (OrderElement each : orderElements) {
            Map<Criterion, Boolean> criterionMap = mapTemplateCriterion
                    .get(each.getTemplate());
            if (criterionMap != null) {
                IndirectCriterionRequirement indirect = IndirectCriterionRequirement
                        .create(parent, criterion);
                indirect.setValid(criterionMap.get(criterion));
                addIndirectCriterionRequirement(each, indirect);
            }

            if (isOrderLineGroup(each)) {
                copyIndirectCriterionRequirementsFromOriginalToOrderLineGroupChildren(
View Full Code Here

        Map<Criterion, Boolean> mapCriterionToValid = createCriterionToValidMap(origin
                .getIndirectCriterionRequirement());

        for (CriterionRequirement each : criterionRequirements) {
            if (each instanceof IndirectCriterionRequirement) {
                IndirectCriterionRequirement indirect = (IndirectCriterionRequirement) each;
                indirect.setValid(mapCriterionToValid.get(each.getCriterion()));
            }
        }
    }
View Full Code Here

        model.addElementAt(element, "element2", 50);

        OrderLineGroup container = (OrderLineGroup) order.getChildren().get(0);
        model.removeNode(container.getChildren().iterator().next());

        IndirectCriterionRequirement indirectCriterionRequirement = (IndirectCriterionRequirement) container
                .getCriterionRequirements().iterator().next();
        assertTrue(indirectCriterionRequirement.getCriterion().isEquivalent(
                criterion));
        indirectCriterionRequirement.setValid(false);

        addAnotherCriterionRequirement(container);

        // This calls toLeaf in the container
        model.removeNode(container.getChildren().get(0));
View Full Code Here

    public void selectCriterionToExceptionRequirementWrapper(
            CriterionRequirementWrapper exception,
            CriterionWithItsType criterionAndType) {
        exception.setCriterionWithItsType(criterionAndType);
        IndirectCriterionRequirement indirect = findValidRequirementByCriterion(criterionAndType
                .getCriterion());
        exception.setCriterionRequirement(indirect);
        exception.setValid(false);
    }
View Full Code Here

        for (OrderElementTemplate each : orderElements) {
            Map<Criterion, Boolean> criterionMap = mapTemplateCriterion
                    .get(each.getOrigin());
            if (criterionMap != null) {
                IndirectCriterionRequirement indirect = IndirectCriterionRequirement
                        .create(parent, criterion);
                indirect.setValid(criterionMap.get(criterion));
                addIndirectCriterionRequirement(each, indirect);
            }

            if (isOrderLineGroup(each)) {
                copyIndirectCriterionRequirementsFromOriginalToOrderLineGroupChildren(
View Full Code Here

        CriterionRequirement requirement = DirectCriterionRequirement
                .create(Criterion.create(type));
        order.addDirectCriterionRequirement(requirement);

        assertThat(container2.getCriterionRequirements().size(), equalTo(1));
        IndirectCriterionRequirement requirementAtContainer = (IndirectCriterionRequirement) container2
                .getCriterionRequirements().iterator().next();

        container2.setValidCriterionRequirement(requirementAtContainer, false);

        assertThat(container1.getCriterionRequirements().size(), equalTo(1));
View Full Code Here

                            throw new ValidationException(e.getMessage());
                        }
                    }
                } else { // criterionRequirementDTO instanceof
                    // IndirectCriterionRequirementDTO
                    IndirectCriterionRequirement indirectCriterionRequirement = getIndirectCriterionRequirementByCriterion(
                            criterionRequirable, criterion);
                    if (indirectCriterionRequirement != null) {
                        indirectCriterionRequirement
                                .setValid(((IndirectCriterionRequirementDTO) criterionRequirementDTO).valid);
                    }
                }
            } else {
                if (criterionRequirementDTO.name == null
View Full Code Here

TOP

Related Classes of org.libreplan.business.requirements.entities.IndirectCriterionRequirement

Copyright © 2018 www.massapicom. 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.