@Override
  public StringBuilder getResponse(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    // get project from session or DB
    ProjectObject project = (ProjectObject) SessionManager.getProjectObject(request);

    // get parameter
    String CurrentSprintID = request.getParameter("SprintID");

    SprintPlanHelper helper = new SprintPlanHelper(project);
    List<ISprintPlanDesc> plans = helper.loadListPlans();

    ISprintPlanDesc currentPlan = null;

    if (CurrentSprintID == null) {
      currentPlan = helper.loadCurrentPlan();
    } else {
      currentPlan = helper.loadPlan(CurrentSprintID);
    }

    SprintPlanUI spui = new SprintPlanUI(plans, currentPlan);

    Gson gson = new Gson();
    return new StringBuilder(gson.toJson(spui));
  }
Esempio n. 2
0
  @Override
  public StringBuilder getResponse(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    // get session info
    ProjectObject project = (ProjectObject) SessionManager.getProjectObject(request);

    SprintPlanHelper sprintPlanHelper = new SprintPlanHelper(project);
    TranslateSpecialChar translateSpecialChar = new TranslateSpecialChar();

    // get parameter info
    String sprintId = request.getParameter("Id");
    String sprintGoal = translateSpecialChar.TranslateXMLChar(request.getParameter("Goal"));
    String startDate = request.getParameter("StartDate");
    String interval = request.getParameter("Interval");
    String teamSize = request.getParameter("Members");
    String hoursCanCommit = request.getParameter("AvaliableDays");
    String focusFactor = request.getParameter("FocusFactor");
    String dailyInfo = translateSpecialChar.TranslateXMLChar(request.getParameter("DailyScrum"));
    String demoDate = request.getParameter("DemoDate");
    String demoPlace = translateSpecialChar.TranslateXMLChar(request.getParameter("DemoPlace"));
    String dueDate = request.getParameter("DueDate");

    // set sprint info
    SprintInfo sprintInfo = new SprintInfo();
    sprintInfo.id = Long.parseLong(sprintId);
    sprintInfo.sprintGoal = sprintGoal;
    sprintInfo.startDate = startDate;
    sprintInfo.interval = Integer.parseInt(interval);
    sprintInfo.teamSize = Integer.parseInt(teamSize);
    sprintInfo.hoursCanCommit = Integer.parseInt(hoursCanCommit);
    sprintInfo.focusFactor = Integer.parseInt(focusFactor);
    sprintInfo.dailyInfo = dailyInfo;
    sprintInfo.demoDate = demoDate;
    sprintInfo.demoPlace = demoPlace;
    sprintInfo.dueDate = dueDate;

    sprintPlanHelper.updateSprint(sprintInfo.id, sprintInfo);

    return new StringBuilder("true");
  }