Package com.tapsterrock.mpx

Examples of com.tapsterrock.mpx.Task


     *            Currenct MPXFile instance
     */
    private void processRelationships(MPXFile mpx) {
        TaskManager tm = m_project.getTaskManager();
        Iterator taskIter = mpx.getAllTasks().iterator();
        Task task;
        RelationList rels;
        Iterator relIter;
        Relation rel;

        GanttTask gTask1;
        int gTaskNumber1;
        GanttTask gTask2;
        int gTaskNumber2;
        TaskDependency gTaskDependency;
        int gConstraintType;
        while (taskIter.hasNext() == true) {
            task = (Task) taskIter.next();
            gTaskNumber1 = mapTaskNumber(task.getID());

            if (gTaskNumber1 == -1) {
                continue;
            }

            rels = (RelationList)task.getPredecessors();

            if (rels != null) {
                relIter = rels.iterator();

                while (relIter.hasNext() == true) {
View Full Code Here


        return s.replaceAll("\r", "");
    }

    private void exportProject(MPXFile file, Project project, ResourceRegistry resources) throws MPXException {
        ProjectHeader header = file.getProjectHeader();
        Task projectLevelTask = file.addTask();
        header.setProjectTab(project.getName());
        projectLevelTask.setName(project.getName());
        if (!StringUtils.isEmpty(project.getDescription())) {
            projectLevelTask.addTaskNotes(filterString(project.getDescription()));
        }

        long earliestStartTime = Long.MAX_VALUE;
        List iterations = new ArrayList(project.getIterations());
        Collections.sort(iterations, new Comparator() {
View Full Code Here

            header.setStartDate(new Date());
        }
    }

    private Task exportIteration(MPXFile file, Task projectLevelTask, Iteration iteration, ResourceRegistry resources) throws MPXException {
        Task iterationLevelTask = null;
        if (projectLevelTask != null) {
            iterationLevelTask = projectLevelTask.addTask();
        } else {
            iterationLevelTask = file.addTask();
            file.getProjectHeader().setStartDate(iteration.getStartDate());
            file.getProjectHeader().setProjectTab(iteration.getName());
        }
        iterationLevelTask.setName(iteration.getName());
        iterationLevelTask.setStart(iteration.getStartDate());
        iterationLevelTask.setFinish(iteration.getEndDate());
        if (StringUtils.isNotEmpty(iteration.getDescription())) {
            iterationLevelTask.addTaskNotes(filterString(iteration.getDescription()));
        }
        for (Iterator iterator = iteration.getUserStories().iterator(); iterator.hasNext();) {
            UserStory userStory = (UserStory) iterator.next();
            exportUserStory(iterationLevelTask, userStory, resources);
        }
View Full Code Here

        }
        return iterationLevelTask;
    }

    private void exportUserStory(Task iterationLevelTask, UserStory userStory, ResourceRegistry resources) throws MPXException {
        Task storyLevelTask = iterationLevelTask.addTask();
        storyLevelTask.setName(userStory.getName());
        if (StringUtils.isNotEmpty(userStory.getDescription())) {
            storyLevelTask.addTaskNotes(filterString(userStory.getDescription()));
        }
        long earliestTaskStartTime = Long.MAX_VALUE;
        Collection storyTasks = userStory.getTasks();
        if (storyTasks.size() > 0) {
            for (Iterator iterator = storyTasks.iterator(); iterator.hasNext();) {
                org.nxplanner.domain.Task task = (org.nxplanner.domain.Task) iterator.next();
                Task taskLevelTask = storyLevelTask.addTask();
                taskLevelTask.setName(task.getName());
                taskLevelTask.setDuration(new MPXDuration(task.getEstimatedHours(), TimeUnit.HOURS));
                if (StringUtils.isNotEmpty(task.getDescription())) {
                    taskLevelTask.addTaskNotes(filterString(task.getDescription()));
                }
                if (task.getAcceptorId() != 0) {
                    taskLevelTask.addResourceAssignment(resources.getResource(task.getAcceptorId()));
                }
                if (task.getActualHours() != 0) {
                    taskLevelTask.setActualWork(new MPXDuration(task.getActualHours(), TimeUnit.HOURS));
                    Date startTime = getStartTime(iterationLevelTask, task);
                    if (startTime != null) {
                        taskLevelTask.setActualStart(startTime);
                    }
                }
                if (task.getTimeEntries().size() > 0) {
                    long startTime = Long.MAX_VALUE;
                    for (Iterator timeItr = task.getTimeEntries().iterator(); timeItr.hasNext();) {
                        TimeEntry timeEntry = (TimeEntry) timeItr.next();
                        if (timeEntry.getStartTime() != null && timeEntry.getStartTime().getTime() < startTime) {
                            startTime = timeEntry.getStartTime().getTime();
                        }
                    }
                    if (startTime < Long.MAX_VALUE) {
                        taskLevelTask.setActualStart(new Date(startTime));
                        if (startTime < earliestTaskStartTime) {
                            earliestTaskStartTime = startTime;
                        }
                    }
                } else {
                    taskLevelTask.setActualStart(iterationLevelTask.getActualStart());
                }
            }
            if (earliestTaskStartTime == Long.MAX_VALUE) {
                earliestTaskStartTime = iterationLevelTask.getStart().getTime();
            }
            List tasks = storyLevelTask.getChildTasks();
            for (int i = 0; i < tasks.size(); i++) {
                Task task = (Task) tasks.get(i);
                if (task.getActualStart() == null) {
                    task.setActualStart(new Date(earliestTaskStartTime));
                }
            }
        } else {
            storyLevelTask.setActualStart(iterationLevelTask.getStart());
            storyLevelTask.setDuration(new MPXDuration(0, TimeUnit.DAYS));
View Full Code Here

TOP

Related Classes of com.tapsterrock.mpx.Task

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.