Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.Criterion


            throw new RuntimeException(_("Unexpected: {0}", addSatisfaction));
        }
    }

    private Criterion getChoosenCriterion() {
        Criterion criterion;
        if (editing) {
            criterion = satisfactionEdited.getCriterion();
        } else {
            criterion = (Criterion) this.selectedWorkCriterion
                    .getSelectedItemApi().getValue();
View Full Code Here


        this.endDate = criterionSatisfaction.getEndDate();
        this.state = "";
        this.criterionAndType = "";
        this.setCriterionSatisfaction(criterionSatisfaction);

        Criterion criterion = criterionSatisfaction.getCriterion();
        CriterionType type = criterion.getType();
        this.setCriterionWithItsType(new CriterionWithItsType(type,criterion));
    }
View Full Code Here

        }
        return false;
    }

    private boolean acceptCriterion(FilterPair filter, Resource resource) {
        Criterion filterCriterion = (Criterion) filter.getValue();
        for (CriterionSatisfaction criterionSatisfaction : resource
                .getCriterionSatisfactions()) {
            if (criterionSatisfaction.getCriterion().getId().equals(
                    filterCriterion.getId())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public List<Criterion> getAllCriterions() {
        return hoursWorkedPerWorkerModel.getCriterions();
    }

    public void onSelectCriterion() {
        Criterion criterion = (Criterion) bdCriterions.getSelectedElement();
        if (criterion == null) {
            throw new WrongValueException(bdCriterions,
                    _("please, select a Criterion"));
        }
        boolean result = hoursWorkedPerWorkerModel
View Full Code Here

        private List<LoadTimeLine> groupsFor(
                Map<Criterion, List<ResourceAllocation<?>>> allocationsByCriterion) {
            List<LoadTimeLine> result = new ArrayList<LoadTimeLine>();
            for (Entry<Criterion, List<ResourceAllocation<?>>> each : allocationsByCriterion
                    .entrySet()) {
                Criterion criterion = each.getKey();
                List<ResourceAllocation<?>> allocations = ResourceAllocation
                        .sortedByStartDate(each.getValue());
                if (allocations == null) {
                    continue;
                }
View Full Code Here

    public List<Criterion> getAllCriterions() {
        return workingProgressPerTaskModel.getCriterions();
    }

    public void onSelectCriterion() {
        Criterion criterion = (Criterion) bdCriterions.getSelectedElement();
        if (criterion == null) {
            throw new WrongValueException(bdCriterions,
                    _("please, select a Criterion"));
        }
        boolean result = workingProgressPerTaskModel
View Full Code Here

    public List<Criterion> getAllCriteria() {
        return projectStatusReportModel.getAllCriteria();
    }

    public void addCriterion() {
        Criterion criterion = (Criterion) bandboxCriteria.getSelectedElement();
        if (criterion == null) {
            throw new WrongValueException(bandboxCriteria,
                    _("please, select a criterion"));
        }
        projectStatusReportModel.addSelectedCriterion(criterion);
View Full Code Here

    private boolean sameCriterion(CriterionSatisfactionDTO otherSatisfaction,
            CriterionSatisfactionDTO satisfaction) {
        if (otherSatisfaction.getCriterionWithItsType() == null) {
            return false;
        }
        Criterion otherCriterion = otherSatisfaction.getCriterionWithItsType()
                .getCriterion();
        if (otherCriterion.getId().equals(
                satisfaction.getCriterionWithItsType().getCriterion().getId())) {
            return true;
        }
        return false;
    }
View Full Code Here

        updateDTOs();
    }

    private void validateDTOs() throws ValidationException {
        for (CriterionSatisfactionDTO satisfactionDTO : getWithCriterionAssignedDTOs()) {
            Criterion criterion = satisfactionDTO.getCriterionWithItsType()
                    .getCriterion();
            if (checkSameCriterionAndSameInterval(satisfactionDTO)) {
                throw new IllegalStateException(
                        _("The {0} can not be assigned to this resource. Its interval overlaps with other criterion",
                                criterion.getName()));
            }
            if (checkNotAllowSimultaneousCriterionsPerResource(satisfactionDTO)) {
                throw new IllegalStateException(
                        _("The {0} is not valid. Other value exists from the same criterion type",
                                criterion.getName()));
            }
        }
    }
View Full Code Here

        // Create a new list of Criterion satisfaction
        Set<CriterionSatisfaction> newList = new HashSet<CriterionSatisfaction>();
        for (CriterionSatisfactionDTO satisfactionDTO : getWithCriterionAssignedDTOs()) {
            CriterionSatisfaction satisfaction;
            if (satisfactionDTO.isNewObject()) {
                Criterion criterion = satisfactionDTO.getCriterionWithItsType()
                        .getCriterion();
                Interval interval = satisfactionDTO.getInterval();
                satisfaction = CriterionSatisfaction.create(criterion, worker,
                        interval);
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.Criterion

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.