Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor


     * @return TaskElement TaskElement that represent the data.
     */
    @Transactional
    private TaskElement createTaskMilestone(MilestoneDTO milestone) {

        TaskElement taskMilestone = TaskMilestone.create(milestone.startDate);

        taskMilestone.setName(milestone.name);

        setPositionConstraint((TaskMilestone) taskMilestone, milestone);

        milestone.taskElement = taskMilestone;

View Full Code Here


     */
    private TaskElement createTask(OrderElementDTO task, boolean importCalendar) {

        OrderElement orderElement = task.orderElement;

        TaskElement taskElement;

        TaskSource taskSource;

        if (task.children.size() == 0) {

            taskSource = TaskSource.create(
                    orderElement.getCurrentSchedulingDataForVersion(),
                    orderElement.getHoursGroups());

            taskElement = taskSource
                    .createTaskWithoutDatesInitializedAndLinkItToTaskSource();

            if (importCalendar && task.calendarName != null) {
                taskElement.setCalendar(findBaseCalendar(task.calendarName));
            }

            setPositionConstraint((Task) taskElement, task);

        } else {

            taskSource = TaskSource.createForGroup(orderElement
                    .getCurrentSchedulingDataForVersion());

            taskElement = taskSource
                    .createTaskGroupWithoutDatesInitializedAndLinkItToTaskSource();

            List<TaskElement> taskElements = new ArrayList<TaskElement>();

            for (OrderElementDTO importTask : task.children) {

                taskElements.add(createTask(importTask, importCalendar));

            }

            for (MilestoneDTO milestone : task.milestones) {

                taskElements.add(createTaskMilestone(milestone));

            }

            for (TaskElement childTaskElement : taskElements) {
                ((TaskGroup) taskElement).addTaskElement(childTaskElement);
            }

        }

        taskElement.setStartDate(task.startDate);
        taskElement.setEndDate(task.endDate);

        task.taskElement = taskElement;

        return taskElement;
    }
View Full Code Here

        List<Dependency> dependencies =  new ArrayList<Dependency>();

        for(DependencyDTO dependencyDTO: importData.dependencies){

            TaskElement origin = dependencyDTO.origin.getTaskAssociated();

            TaskElement destination = dependencyDTO.destination
                    .getTaskAssociated();

            dependencies.add(Dependency.create(origin, destination,
                    toLPType(dependencyDTO.type)));
        }
View Full Code Here

     * Needed for import external tasks.
     *
     * @return Task New Task
     */
    public Task createTaskWithoutDatesInitializedAndLinkItToTaskSource() {
        TaskElement task = Task.createTaskWithoutDatesInitialized(this);
        this.setTask(task);
        return (Task) task;
    }
View Full Code Here

     * Needed for import external tasks.
     *
     * @return Task New Task
     */
    public TaskGroup createTaskGroupWithoutDatesInitializedAndLinkItToTaskSource() {
        TaskElement task = TaskGroup.create(this);
        this.setTask(task);
        return (TaskGroup) task;
    }
View Full Code Here

        }

        private List<TaskElement> getChildren(IOptionalPersistence persistence) {
            List<TaskElement> result = new ArrayList<TaskElement>();
            for (TaskSourceSynchronization each : synchronizations) {
                TaskElement t = each.apply(persistence);
                if (t != null) {
                    // TaskSourceMustBeRemoved gives null
                    result.add(t);
                }
            }
View Full Code Here

        taskDAO.save(getAssociatedTask(element));
    }

    private void updateEndDateForParentTasks() {
        for(TaskElement task : parentElementsToBeUpdated) {
            TaskElement parent = task;
            while(parent != null) {
                parent.setIntraDayEndDate(null);
                parent.initializeDatesIfNeeded();
                taskDAO.save(parent);
                parent = parent.getParent();
            }
        }
    }
View Full Code Here

    }

    void removeSpuriousDayAssignments(Scenario scenario) {
        TaskSource taskSource = getTaskSource();
        if (taskSource != null) {
            TaskElement task = taskSource.getTask();
            task.removeDayAssignmentsFor(scenario);
        }
    }
View Full Code Here

            }
        }
    }

    private void removeAtCurrent(Scenario scenario) {
        TaskElement associatedTaskElement = getAssociatedTaskElement();
        if (associatedTaskElement != null) {
            associatedTaskElement.removePredecessorsDayAssignmentsFor(scenario);
        }
    }
View Full Code Here

     * Calculate if the tasks of the planification point has finished
     */

    public boolean isFinishPlanificationPointTask() {
        // look up into the order elements tree
        TaskElement task = lookToUpAssignedTask();
        if (task != null) {
            return task.getOrderElement().isFinishedAdvance();
        }
        // look down into the order elements tree
        List<TaskElement> listTask = lookToDownAssignedTask();
        if (!listTask.isEmpty()) {
            for (TaskElement taskElement : listTask) {
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor

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.