Package net.sf.pmr.agilePlanning.service

Examples of net.sf.pmr.agilePlanning.service.StoryService


      // nombre de story terminées, en cours, à faire
      int numberOfStoryLeft = 0;
      int numberOfStoryInProgress = 0;
      int numberOfStoryCompleted = 0;

        StoryService storyService = AgilePlanningObjectFactory.getStoryService();
        if (myWorkspaceForm.getProjectId() > 0) {
         
          Set<Story> stories = storyService.findByProjectPersistanceId(myWorkspaceForm.getProjectId());

          // nombre de story
          numberOfStory = stories.size();
         
          for (Story story : stories) {
View Full Code Here


     * @throws Exception
     */
    public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

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

        // list the tasks for the current story
        int persistanceId = 0;
        if ( StringUtils.isNotEmpty(request.getParameter("storyPersistanceId"))) {
            persistanceId = Integer.parseInt(request.getParameter("storyPersistanceId"));
        } else if (StringUtils.isNotEmpty((String)request.getAttribute("storyPersistanceId"))) {
            persistanceId = Integer.parseInt((String)request.getAttribute("storyPersistanceId"));
        }
       
        Story story = storyService.findByPersistanceId(persistanceId);

        // put the tasks in the request
        request.setAttribute("taskList", story.getTasks());

        // populate summary
View Full Code Here

    public ActionForward detail(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

        // TODO Faire une méthode de sécurité pour vérifier le user

        // 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());
View Full Code Here

    }

    public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

        // 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());
View Full Code Here

    }

    public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

        // 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();
View Full Code Here

     * @param request request
     */
    private void populateSummary(final HttpServletRequest request) {

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

        // list the tasks for the current story
        int persistanceId = 0;
        if ( StringUtils.isNotEmpty(request.getParameter("storyPersistanceId"))) {
            persistanceId = Integer.parseInt(request.getParameter("storyPersistanceId"));
        } else if (StringUtils.isNotEmpty((String)request.getAttribute("storyPersistanceId"))) {
            persistanceId = Integer.parseInt((String)request.getAttribute("storyPersistanceId"));
        }

        Story story = storyService.findByPersistanceId(persistanceId);
       
       
        int numberOfTask = Integer.valueOf(story.getTasks().size());
        int numberOfTaskInProgress = 0;
        int numberOfTaskCompleted = 0;
View Full Code Here

     * @param request request
     */
    private void populateSummary(final HttpServletRequest request) {
       
        // Get the services
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();
        IterationService iterationService = AgilePlanningObjectFactory.getIterationService();
        ReleaseService releaseService = AgilePlanningObjectFactory.getReleaseService();
       
        request.setAttribute("numberOfStory", new Integer(storyService.findByProjectPersistanceId(((Integer) request.getSession().getAttribute("basicProject.persistanceId")).intValue()).size()));
        request.setAttribute("numberOfIteration", new Integer(iterationService.findByProjectPersistanceId(((Integer) request.getSession().getAttribute("basicProject.persistanceId")).intValue()).size()));
        request.setAttribute("numberOfRelease", new Integer(releaseService.findByProjectPersistanceId(((Integer) request.getSession().getAttribute("basicProject.persistanceId")).intValue()).size()));
       
    }
View Full Code Here

    public ActionForward list(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

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

        // list the stories for the current project
        Set stories = storyService
                .findByProjectPersistanceId(((Integer) request.getSession()
                        .getAttribute("basicProject.persistanceId")).intValue());

      Set<StoryView> storyViews = this.buildStoryViewsForStories(stories);
View Full Code Here

            throws Exception {

        // TODO Faire une m�thode de s�curit� pour v�rifier le user

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

        // find the Story... if needed
        if (StringUtils.isNotEmpty((String) request
                .getParameter("persistanceId"))) {

            Story story = storyService.findByPersistanceId(Integer
                    .parseInt((String) request.getParameter("persistanceId")));

            // populate the form
            StoryForm storyForm = (StoryForm) form;

            storyForm.setDescription(story.getDescription());
            storyForm.setDaysEstimated(story.getDaysEstimated());
            storyForm.setShortDescription(story.getShortDescription());
            storyForm.setPersistanceId(story.getPersistanceId());
            storyForm.setPersistanceVersion(story.getPersistanceVersion());
            storyForm.setBusinessValueId(story.getBusinessValue().getId());
            storyForm.setRiskLevelId(story.getRiskLevel().getId());
            storyForm.setDaysCompleted(story.daysCompleted());
            storyForm.setDaysRemaining(story.daysRemaining());
            storyForm.setPercentCompleted(story.percentCompleted());
            storyForm.setDifferenceInPercentBetweenEstimateAndTaskCharge(story.differenceInPercentBetweenEstimateAndTaskCharge());
            storyForm.setDifferenceOfDaysBetweenEstimateAndTaskCharge(story.differenceOfDaysBetweenEstimateAndTaskCharge());
            storyForm.setDifferenceInPercentBetweenEstimateAndTaskEstimate(story.differenceInPercentBetweenEstimateAndTaskEstimate());
            storyForm.setDifferenceOfDaysBetweenEstimateAndTaskEstimate(story.differenceOfDaysBetweenEstimateAndTaskEstimate());

        }

        // get the list of riskLevel to populate the list box
        Set<RiskLevel> riskLevels = storyService.findAllRiskLevel();
        // populate a list of views
        Set<RiskLevelView> riskLevelsToReturn = new HashSet<RiskLevelView>();
        for (RiskLevel riskLevel : riskLevels) {
            RiskLevelView riskLevelView = new RiskLevelView();
            riskLevelView.populateWithRiskLevel(riskLevel);
            riskLevelsToReturn.add(riskLevelView);
        }
       
        request.setAttribute("riskLevels", riskLevelsToReturn);
       
        // get the list of businessValue to populate the list box
        Set<BusinessValue> businessValues = storyService.findAllBusinessValue();
        // populate a list of views
        Set<BusinessValueView> businessValuesToReturn = new HashSet<BusinessValueView>();
        for (BusinessValue businessvalue : businessValues) {
            BusinessValueView businessValueView = new BusinessValueView();
            businessValueView.populateWithBusinessValue(businessvalue);
View Full Code Here

    public ActionForward save(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

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

        // get the form
        StoryForm storyform = (StoryForm) form;

        // TODO faire une seul m�thode storyService.save ?
        Errors errors = null;
        // save the story
        if (storyform.getPersistanceId() == 0) {
            // add
            // get the current basicProject from the session
            Integer basicProjectPersistanceId = (Integer) request.getSession()
                    .getAttribute("basicProject.persistanceId");
            errors = storyService.add(basicProjectPersistanceId.intValue(),
                    storyform.getShortDescription(),
                    storyform.getDescription(), storyform.getDaysEstimated(),
                    storyform.getBusinessValueId(), storyform.getRiskLevelId());
        } else {
            // update
             errors = storyService.update(storyform.getShortDescription(),
             storyform.getDescription(), storyform.getDaysEstimated(),
             storyform.getBusinessValueId(), storyform.getRiskLevelId(),
             storyform.getPersistanceId(), storyform.getPersistanceVersion());
        }
View Full Code Here

TOP

Related Classes of net.sf.pmr.agilePlanning.service.StoryService

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.