Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.Resource$DayAssignmentsState


    public Resource getResource() {
        return resource;
    }

    public void setResource(Resource resource) {
        Resource oldResource = this.resource;
        this.resource = resource;
        if (oldResource != null) {
            oldResource.removeResourcesCostCategoryAssignment(this);
        }
        if (resource != null
                && !resource.getResourcesCostCategoryAssignments().contains(this)) {
            resource.addResourcesCostCategoryAssignment(this);
        }
View Full Code Here


    @SuppressWarnings("unchecked")
    private <T extends Resource> List<T> reloadResources(
            Collection<? extends T> resources) {
        List<T> result = new ArrayList<T>();
        for (T each : resources) {
            Resource reloaded = resourceDAO.findExistingEntity(each.getId());
            reattachResource(reloaded);
            result.add((T) reloaded);
        }
        return result;
    }
View Full Code Here

        return resources;
    }

    @Override
    public String _toString(Object value) {
        final Resource resource = (Resource) value;
        return (resource != null) ? resource.getShortDescription() : "";
    }
View Full Code Here

        bindingStrategy.assignOrderElementsToWorkReportLine(workReport,
                bindingStrategy.getOrderElementsBound(workReportDTO));

        if (workReportDTO.resource != null) {
            try {
                Resource resource = Registry.getResourceDAO().findByCode(
                        workReportDTO.resource);
                workReport.setResource(resource);
            } catch (InstanceNotFoundException e) {
                workReport.setResource(null);
                throw new ValidationException(
View Full Code Here

        bindingStrategy.assignOrderElementsToWorkReportLine(workReportLine,
                bindingStrategy.getOrderElementsBound(workReportLineDTO));

        if (workReportLineDTO.resource != null) {
            try {
                Resource resource = Registry.getResourceDAO().findByCode(
                        workReportLineDTO.resource);
                workReportLine.setResource(resource);
            } catch (InstanceNotFoundException e) {
                workReportLine.setResource(null);
                throw new ValidationException(
View Full Code Here

        /* Step 4.2: Update the resource. */
        String resourceCode = workReportDTO.resource;
        if (!Strings.isBlank(resourceCode)) {
            try {
                Resource resource = Registry.getResourceDAO().findByCode(
                        resourceCode);
                workReport.setResource(resource);
            } catch (InstanceNotFoundException e) {
                throw new ValidationException(
                        "There is no resource with this code");
View Full Code Here

        /* Step 3.2: Update the resource. */
        String resourceCode = workReportLineDTO.resource;
        if (!Strings.isBlank(resourceCode)) {
            try {
                Resource resource = Registry.getResourceDAO().findByCode(
                        resourceCode);
                workReportLine.setResource(resource);
            } catch (InstanceNotFoundException e) {
                throw new ValidationException(
                        "There is no resource with this code");
View Full Code Here

        return resources;
    }

    @Override
    public boolean entryMatchesText(Object obj, String text) {
        Resource resource = (Resource) obj;
        text = text.trim().toLowerCase();
        return (resource.getCode().toLowerCase().contains(text) || resource.getName().toLowerCase()
                .contains(text));
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly = true)
    public String objectToString(Object obj) {
        Resource resource = (Resource) obj;
        return resource.getName() + " :: " + resource.getCode();
    }
View Full Code Here

        Iterator<Class<?>> iteratorClass = mapResources.keySet().iterator();
        while (iteratorClass.hasNext() && getListMatching().size() < 10) {
            Class<?> className = iteratorClass.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapResources.get(className).size(); i++) {
                Resource resource = mapResources.get(className).get(i);
                addResource(className, resource);
            }
        }
        return getListMatching();
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.Resource$DayAssignmentsState

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.