Package net.sf.pmr.struts.agilePlanning.task.form

Examples of net.sf.pmr.struts.agilePlanning.task.form.TaskForm


        // get the service
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();

        // populate the form
        TaskForm taskForm = (TaskForm) form;
        taskForm.setStoryPersistanceId(Integer.parseInt((String) request.getParameter("storyPersistanceId")));
       
        // find the Story... if needed
        if (StringUtils.isNotEmpty((String) request.getParameter("persistanceId"))) {

            Task task = storyService.findTaskByPersistanceId(Integer.parseInt((String) request.getParameter("persistanceId")));

            taskForm.setDaysEstimated(task.getDaysEstimated());
            taskForm.setPersistanceId(task.getPersistanceId());
            taskForm.setPersistanceVersion(task.getPersistanceVersion());
            taskForm.setShortDescription(task.getShortDescription());
           
            taskForm.setDaysCompleted(task.daysCompleted());
            taskForm.setDaysRemaining(task.daysRemaining());
            taskForm.setDifferenceInPercentBetweenEstimateAndCharge(task.differenceInPercentBetweenEstimateAndCharge());
            taskForm.setDifferenceOfDaysBetweenEstimateAndCharge(task.differenceOfDaysBetweenEstimateAndCharge());
            taskForm.setPercentCompleted(task.percentCompleted());
            taskForm.setPercentRemaining(task.percentRemaining());
            taskForm.setWarning(task.warning());
           
            if (task.getOwner() != null) {
                taskForm.setDevelopperPersistanceId(task.getOwner().getPersistanceId());
            }
        }   
   
        //populate listBox
        populateListBox(request);
View Full Code Here


        // get the service
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();

        // get the form
        TaskForm taskForm = (TaskForm) form;

        // TODO faire une seul m�thode taskService.save ?
        Errors errors = null;
        // save the story
        if (taskForm.getPersistanceId() == 0) {
            // add
            errors = storyService.addTask(taskForm.getStoryPersistanceId(),
                                          taskForm.getDaysEstimated(),
                                          taskForm.getShortDescription(),
                                          taskForm.getDevelopperPersistanceId());
        } else {
            // update
            errors = storyService.updateTask(taskForm.getStoryPersistanceId(),
                                             taskForm.getDaysEstimated(),
                                             taskForm.getShortDescription(),
                                             taskForm.getDevelopperPersistanceId(),
                                             taskForm.getPersistanceId(),
                                             taskForm.getPersistanceVersion());
        }

        // Convert into struts action errors
        ActionMessages actionMessages = new ActionMessages();

        if (errors.hasErrors()) {

            for (Iterator iterator = errors.getAllErrorsMessageParameters().iterator(); iterator.hasNext();) {

                MessageParameters messageParameters = (MessageParameters) iterator.next();

                actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(messageParameters.getErrorCode(),
                                                                                    messageParameters.getErrorArguments()));

            }

            saveErrors(request, actionMessages);

        }

        // forward
        if (actionMessages.isEmpty() == false) {
           
            //put the persistanceId in the request
            request.setAttribute("persistanceId", Integer.valueOf(taskForm.getPersistanceId()));
           
            // populate the list box
            populateListBox(request);
           
            // populate the summary
            populateSummary(request);
           
            return mapping.findForward("taskDetail");

        } else {
           
            // set the storyPersistanceId in request
            request.setAttribute("storyPersistanceId", String.valueOf(taskForm.getStoryPersistanceId()));
           
            return this.list(mapping, form, request, response);
        }

    }
View Full Code Here

        // get the service
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();

        // get the form
        TaskForm taskForm = (TaskForm) form;

        Errors errors = null;
        // save the story
        if (taskForm.getPersistanceId() != 0) {
           
            errors = storyService.deleteTask(taskForm.getStoryPersistanceId(), taskForm.getPersistanceId(), taskForm.getPersistanceVersion());
           
        }

        // Convert into struts action errors
        ActionMessages actionMessages = new ActionMessages();

        if (errors.hasErrors()) {

            for (Iterator iterator = errors.getAllErrorsMessageParameters().iterator(); iterator.hasNext();) {

                MessageParameters messageParameters = (MessageParameters) iterator.next();

                actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(messageParameters.getErrorCode(),
                                                                                    messageParameters.getErrorArguments()));

            }

            saveErrors(request, actionMessages);

        }

        // forward
        if (actionMessages.isEmpty() == false) {
           
            //put the persistanceId in the request
            request.setAttribute("persistanceId", Integer.valueOf(taskForm.getPersistanceId()));
           
//            // populate the list box
//            populateListBox(request);
//           
//            // populate the summary
//            populateSummary(request);
           
            return this.detail(mapping, form, request, response);
           
            // return mapping.findForward("taskDetail");

        } else {
           
            // set the storyPersistanceId in request
            request.setAttribute("storyPersistanceId", String.valueOf(taskForm.getStoryPersistanceId()));
           
            return this.list(mapping, form, request, response);
        }

View Full Code Here

TOP

Related Classes of net.sf.pmr.struts.agilePlanning.task.form.TaskForm

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.