Package org.nxplanner.domain

Examples of org.nxplanner.domain.Task


        story.setTasks(tasks);
        return story;
    }

    private static Task newTask(String name, String description, double estimatedHours) {
        Task task = new Task();
        task.setName(name);
        task.setDescription(description);
        task.setEstimatedHours(estimatedHours);
        return task;
    }
View Full Code Here


            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse reply)
            throws Exception {
        TaskEditorForm taskForm = (TaskEditorForm)actionForm;
        Task task = (Task)object;
        String operation = request.getParameter("operation");
        try {
            if (StringUtils.equals(operation, "continue")) {
                continueTask(request, session, task, taskForm);
                HistorySupport.saveEvent(
View Full Code Here

        }
    }

    public Task continueTask(HttpServletRequest request, Session session, Task task, TaskEditorForm form)
            throws Exception {
        Task continuedTask = new Task();
        BeanUtils.copyProperties(continuedTask, task);
        session.save(continuedTask);
        TARGET_STORY_ID_MAPPING.populateDomainObject(continuedTask, form);
        continuedTask.setCreatedDate(new Date());
        continuedTask.setEstimatedHours(task.getEstimatedHours() - task.getActualHours());
        continuedTask.setTimeEntries(null);
        task.setDescription(
                getResources(request).getMessage("task.continued.to", Integer.toString(continuedTask.getId()))
                + "\n\n"
                + task.getDescription());
        continuedTask.setDescription(
                getResources(request).getMessage(
                        "task.continued.from",
                        Integer.toString(task.getId()) + "\n\n" + continuedTask.getDescription()));
        HistorySupport.saveEvent(
                session,
                continuedTask,
                HistoricalEvent.CREATED,
                "continuation",
View Full Code Here

        List tasks = hibernateSession.find(query, new Object[]{overhead, requestedUsername},
                new Type[]{Hibernate.STRING, Hibernate.STRING});
        Iterator iter = tasks.iterator();
        while (iter.hasNext()) {
            Object[] result = (Object[])iter.next();
            Task task = (Task)result[0];

            out.write("BEGIN:VTODO\r\n");
            out.write("UID:task-" + task.getId() + guid + "\r\n");
            out.write(quote("SUMMARY:" + task.getName()) + "\r\n");
            // SunBird doesn't support multi-value categories
            out.write(quote("CATEGORIES:" + result[4] + "\n" + result[3] + "\n" + result[1]) + "\r\n");
            out.write("PERCENT-COMPLETE:" + ((int)((task.getActualHours() * 100) /
                    (task.getActualHours() + task.getRemainingHours()))) + "\r\n");
            out.write("PRIORITY:" + result[2] + "\r\n");
            out.write("STATUS:IN-PROCESS\r\n");
            out.write(quote("URL:" + taskURL + task.getId()) + "\r\n");
            out.write("END:VTODO\r\n");
        }
    }
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse reply)
            throws Exception {
        TaskEditorForm taskForm = (TaskEditorForm)actionForm;
        Task task = (Task)object;
        String operation = request.getParameter("operation");
        try {
            if (StringUtils.equals(operation, "continue")) {
                continueTask(request, session, task, taskForm);
                HistorySupport.saveEvent(
View Full Code Here

        }
    }

    public Task continueTask(HttpServletRequest request, Session session, Task task, TaskEditorForm form)
            throws Exception {
        Task continuedTask = new Task();
        BeanUtils.copyProperties(continuedTask, task);
        session.save(continuedTask);
        TARGET_STORY_ID_MAPPING.populateDomainObject(continuedTask, form);
        continuedTask.setCreatedDate(new Date());
        continuedTask.setEstimatedHours(task.getEstimatedHours() - task.getActualHours());
        continuedTask.setTimeEntries(null);
        task.setDescription(
                getResources(request).getMessage("task.continued.to", Integer.toString(continuedTask.getId()))
                + "\n\n"
                + task.getDescription());
        continuedTask.setDescription(
                getResources(request).getMessage(
                        "task.continued.from",
                        Integer.toString(task.getId()) + "\n\n" + continuedTask.getDescription()));
        HistorySupport.saveEvent(
                session,
                continuedTask,
                HistoricalEvent.CREATED,
                "continuation",
View Full Code Here

        List tasks = hibernateSession.find(query, new Object[]{overhead, requestedUsername},
                new Type[]{Hibernate.STRING, Hibernate.STRING});
        Iterator iter = tasks.iterator();
        while (iter.hasNext()) {
            Object[] result = (Object[])iter.next();
            Task task = (Task)result[0];

            out.write("BEGIN:VTODO\r\n");
            out.write("UID:task-" + task.getId() + guid + "\r\n");
            out.write(quote("SUMMARY:" + task.getName()) + "\r\n");
            // SunBird doesn't support multi-value categories
            out.write(quote("CATEGORIES:" + result[4] + "\n" + result[3] + "\n" + result[1]) + "\r\n");
            out.write("PERCENT-COMPLETE:" + ((int)((task.getActualHours() * 100) /
                    (task.getActualHours() + task.getRemainingHours()))) + "\r\n");
            out.write("PRIORITY:" + result[2] + "\r\n");
            out.write("STATUS:IN-PROCESS\r\n");
            out.write(quote("URL:" + taskURL + task.getId()) + "\r\n");
            out.write("END:VTODO\r\n");
        }
    }
View Full Code Here

        Collection tasks = statistics.getIterationTasks();
        HashMap effortAdded = new HashMap(tasks.size());

        Iterator iter = tasks.iterator();
        while (iter.hasNext()) {
            Task task = (Task)iter.next();
            Date createdDate = task.getCreatedDate();

            if ((createdDate == null) || (createdDate.getTime() == 0) || (createdDate.before(velocityStart))) {
                createdDate = velocityStart;
            } else if (createdDate.after(velocityEnd)) {
                createdDate = velocityEnd;
            }

            incrementValueOnDate(effortAdded, createdDate, task.getStartingEstimatedHours());
        }

        // Build a list of all the dates at which tasks are completed.
        //
        HashMap effortCompleted = new HashMap(tasks.size());

        iter = tasks.iterator();
        while (iter.hasNext()) {
            Task task = (Task)iter.next();

            if (task.isCompleted()) {
                Date completedDate = getCompletedDate(task);

                // If a task was completed but it didn't have any time entries then assume that
                // it finished when it was created.
                //
                if (completedDate == null) {
                    completedDate = task.getCreatedDate();

                    if ((completedDate == null) || (completedDate.getTime() == 0)) {
                        completedDate = velocityStart;
                    }
                }

                incrementValueOnDate(effortCompleted, completedDate, task.getStartingEstimatedHours());
            }
        }

        // Now that we know the range of the iteration we can go through each day calculating the
        // hour completed and required on that single day.
View Full Code Here

         parameters.put("StoryName", story.getName());
         Person cust = story.getCustomer(); parameters.put("StoryCustomerName", (cust != null) ? cust.getName() : null);
         parameters.put("StoryEstimatedHours", new java.lang.Double(story.getEstimatedHours()));
         parameters.put("StoryDescription", story.getDescription());
      } else if (object instanceof Task) {
         Task task = (Task)object;

         try {
            ds = new TaskDataSource(task, session);
         } catch (HibernateException he) {
            throw new ExportException(he);
         }

         reportStream = PdfReportExporter.class.getClassLoader().getResourceAsStream("org/nxplanner/export/reports/JRTask.jasper");
         parameters.put("TaskName", task.getName());
         parameters.put("TaskDescription", task.getDescription());
         double actual = task.getActualHours();
         parameters.put("TaskPercentage", new java.lang.Integer((int)((actual * 100) / (actual + task.getRemainingHours()))));
         parameters.put("TaskDisposition", task.getDisposition());
         parameters.put("TaskType", task.getType());
         parameters.put("TaskAcceptor", getPersonName(session, new Integer(task.getAcceptorId())));
         parameters.put("TaskEstimate", new java.lang.Double(task.getEstimatedHours()));
         parameters.put("TaskCompleted", new java.lang.Boolean(task.isCompleted()));
      } else if (object instanceof Person) {
         Person person = (Person)object;

         try {
            ds = new PersonDataSource(person, session);
View Full Code Here

        Collection tasks = statistics.getIterationTasks();
        HashMap effortAdded = new HashMap(tasks.size());

        Iterator iter = tasks.iterator();
        while (iter.hasNext()) {
            Task task = (Task)iter.next();
            Date createdDate = task.getCreatedDate();

            if ((createdDate == null) || (createdDate.getTime() == 0) || (createdDate.before(velocityStart))) {
                createdDate = velocityStart;
            } else if (createdDate.after(velocityEnd)) {
                createdDate = velocityEnd;
            }

            incrementValueOnDate(effortAdded, createdDate, task.getStartingEstimatedHours());
        }

        // Build a list of all the dates at which tasks are completed.
        //
        HashMap effortCompleted = new HashMap(tasks.size());

        iter = tasks.iterator();
        while (iter.hasNext()) {
            Task task = (Task)iter.next();

            if (task.isCompleted()) {
                Date completedDate = getCompletedDate(task);

                // If a task was completed but it didn't have any time entries then assume that
                // it finished when it was created.
                //
                if (completedDate == null) {
                    completedDate = task.getCreatedDate();

                    if ((completedDate == null) || (completedDate.getTime() == 0)) {
                        completedDate = velocityStart;
                    }
                }

                incrementValueOnDate(effortCompleted, completedDate, task.getStartingEstimatedHours());
            }
        }

        // Now that we know the range of the iteration we can go through each day calculating the
        // hour completed and required on that single day.
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.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.