Package org.libreplan.business.planner.limiting.entities

Examples of org.libreplan.business.planner.limiting.entities.LimitingResourceQueueElement


            result.setTooltiptext(_("Edit queue-based resource element"));
            result.addEventListener(Events.ON_CLICK, new EventListener() {

                @Override
                public void onEvent(Event event) {
                    LimitingResourceQueueElement queueElement = element.getOriginal();

                    editResourceAllocation(queueElement);
                    if (queueElement.getLimitingResourceQueue() == null) {
                        reloadUnassignedLimitingResourceQueueElements();
                    }
                }
            });
            return result;
View Full Code Here


        }

        private void removeUnassignedLimitingResourceQueueElement(
                LimitingResourceQueueElementDTO dto) {

            LimitingResourceQueueElement element = dto.getOriginal();
            limitingResourceQueueModel
                    .removeUnassignedLimitingResourceQueueElement(element);
            reloadUnassignedLimitingResourceQueueElements();
        }
View Full Code Here

     * @return
     */
    public QueueTask getQueueTask(LimitingResourceQueueElement element) {
        QueueComponent queue = fromQueueToComponent.get(element.getLimitingResourceQueue());
        for (QueueTask each: queue.getQueueTasks()) {
            LimitingResourceQueueElement target = each.getLimitingResourceQueueElement();
            if (element.getId().equals(target.getId())) {
                return each;
            }
        }
        return null;
    }
View Full Code Here

     *
     */
    @Override
    public void removeUnassignedLimitingResourceQueueElement(
            LimitingResourceQueueElement element) {
        LimitingResourceQueueElement queueElement = queuesState.getEquivalent(element);

        queueElement.getResourceAllocation().setLimitingResourceQueueElement(null);
        queueElement.getResourceAllocation().getTask()
                .removeAllResourceAllocations();
        queuesState.removeUnassigned(queueElement);
        markAsRemoved(queueElement);
    }
View Full Code Here

            LimitingResourceQueue _queue, DateAndHour allocationTime) {

        Set<LimitingResourceQueueElement> result = new HashSet<LimitingResourceQueueElement>();

        LimitingResourceQueue queue = queuesState.getEquivalent(_queue);
        LimitingResourceQueueElement element = queuesState.getEquivalent(_element);

        InsertionRequirements requirements = queuesState
                .getRequirementsFor(element, allocationTime);

        if (element.getLimitingResourceQueue() != null) {
            unschedule(element);
        }

        // Unschedule elements in queue since allocationTime and put them in
        // toSchedule
View Full Code Here

    @SuppressWarnings("unchecked")
    public LimitingResourceQueueElement getFirstElementFrom(LimitingResourceQueue queue, DateAndHour allocationTime) {
        final List<LimitingResourceQueueElement> elements = new ArrayList(queue.getLimitingResourceQueueElements());

        // First element
        final LimitingResourceQueueElement first = elements.get(0);
        if (isAfter(first, allocationTime)) {
            return first;
        }

        // Rest of elements
        for (int i = 0; i < elements.size(); i++) {
            final LimitingResourceQueueElement each = elements.get(i);
            if (isInTheMiddle(each, allocationTime) ||
                    isAfter(each, allocationTime)) {
                return each;
            }
        }
View Full Code Here

    public TimeTracker getTimeTracker() {
        return timeTrackerComponent.getTimeTracker();
    }

    public void unschedule(QueueTask task) {
        LimitingResourceQueueElement queueElement = task.getLimitingResourceQueueElement();
        LimitingResourceQueue queue = queueElement.getLimitingResourceQueue();

        limitingResourcesController.unschedule(task);
        removeQueueTask(task);
        dependencyList.removeDependenciesFor(queueElement);
        queueListComponent.removeQueueElementFrom(queue, queueElement);
View Full Code Here

            transactionService.runOnReadOnlyTransaction(allocationDoer);
        }
    }

    private void addAssociatedLimitingResourceQueueElement(Task task, ResourceAllocation<?> resourceAllocation) {
        LimitingResourceQueueElement element = LimitingResourceQueueElement.create();
        resourceAllocation.setLimitingResourceQueueElement(element);
        task.setResourceAllocation(resourceAllocation);
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testLimitingResourceQueueHasElements() {
        LimitingResourceQueueElement element = createValidLimitingResourceQueueElement();
        LimitingResourceQueue queue = createValidLimitingResourceQueue();
        queue.addLimitingResourceQueueElement(element);
        limitingResourceQueueDAO.save(queue);
        assertTrue(!limitingResourceQueueElementDAO.getAssigned().isEmpty());
    }
View Full Code Here

            }
        }

        private void updateLimitingResourceQueueElementDates(Task task) {
            try {
                LimitingResourceQueueElement limiting = task
                        .getAssociatedLimitingResourceQueueElementIfAny();

                GanttDate earliestStart = resolveConstraints(task, Point.START);
                GanttDate earliestEnd = resolveConstraints(task, Point.END);

                limiting.updateDates(
                        TaskElementAdapter.toIntraDay(earliestStart),
                        TaskElementAdapter.toIntraDay(earliestEnd));
            } catch (Exception e) {
                // if this fails all the saving shouldn't fail
                LOG.error(
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.limiting.entities.LimitingResourceQueueElement

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.