Examples of CriterionType


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

    }

    @Override
    public CriterionType findUniqueByName(String name)
            throws InstanceNotFoundException {
        CriterionType result = findByName(name);
        if (result == null) {
              throw new InstanceNotFoundException(name,
                  CriterionType.class.getName());
          }
        return result;
View Full Code Here

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

    }

    @Override
    public boolean existsOtherCriterionTypeByName(CriterionType criterionType) {
        Validate.notNull(criterionType);
        CriterionType found = findByName(criterionType.getName());
        return found != null && criterionType != found;
    }
View Full Code Here

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

    }

    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
    public boolean hasDiferentTypeSaved(Long id, ResourceEnum resource) {
        try {
            CriterionType type = find(id);
            return (!(type.getResource().equals(resource)));
        } catch (InstanceNotFoundException e) {
            return false;
        }
    }
View Full Code Here

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

    @Override
    public CriterionType findPredefined(CriterionType criterionType) {
        Validate.notNull(criterionType);
        Validate.notNull(criterionType.getPredefinedTypeInternalName());
        CriterionType result = findByName(criterionType.getName());
        if (result != null) {
            return result;
        }
        return uniqueByInternalName(criterionType);
    }
View Full Code Here

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

    }

    @Override
    public void removeByName(CriterionType criterionType) {
        try {
            CriterionType reloaded = findUniqueByName(criterionType);
            remove(reloaded.getId());
        } catch (InstanceNotFoundException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

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

            @Override
            public Map<CriterionType, Set<Criterion>> execute() {
                Map<CriterionType, Set<Criterion>> result = new LinkedHashMap<CriterionType, Set<Criterion>>();
                for (Criterion criterion : criterionDAO
                        .getAllSortedByTypeAndName()) {
                    CriterionType key = criterion.getType();
                    if (klassTheCriterionTypeMustBeRelatedWith
                            .isAssignableFrom(key.getResource().asClass())) {
                        if (!result.containsKey(key)) {
                            result.put(key, new LinkedHashSet<Criterion>());
                        }
                        result.get(key).add(criterion);
                    }
View Full Code Here

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

        this.initValid(criterionRequirement);
        this.setNewObject(isNewObject);

        if (!isNewObject) {
            Criterion criterion = criterionRequirement.getCriterion();
            CriterionType type = criterion.getType();
            setCriterionWithItsType(new CriterionWithItsType(type, criterion));
        }
    }
View Full Code Here

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

                2000);
        Set<ConstraintViolation<OrderElement>> invalidValues = orderElementValidator
                .validate(orderElement);
        assertTrue(invalidValues.isEmpty());

        CriterionType type = CriterionType.create("", "");
        type.setResource(ResourceEnum.WORKER);
        Criterion criterion = Criterion.create(type);
        CriterionRequirement requirement = DirectCriterionRequirement
                .create(criterion);
        requirement.setOrderElement(orderElement);
        orderElement.addDirectCriterionRequirement(requirement);
View Full Code Here

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

        container1.add(container2);
        OrderLine line = OrderLine.createOrderLineWithUnfixedPercentage(100);
        line.useSchedulingDataFor(mockedOrderVersion);
        container2.add(line);

        CriterionType type = CriterionType.create("", "");
        type.setResource(ResourceEnum.WORKER);
        CriterionRequirement requirement = DirectCriterionRequirement
                .create(Criterion.create(type));
        order.addDirectCriterionRequirement(requirement);

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

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

    private List<FilterPair> fillWithFirstTenFiltersCriterions() {
        SortedMap<CriterionType, List<Criterion>> mapCriterions = getCriterionsMap();
        Iterator<CriterionType> iteratorCriterionType = mapCriterions.keySet()
                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
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.