Ejemplo n.º 1
0
  @Override
  protected void processSecure() throws GamedayException {
    if (RequestUtils.isSubmit(request, "commit")) {
      Team team = TeamFormBean.parse(request);
      team.setId(id);

      getLogic().update(team);
      request.getSession().removeAttribute("club");
      request.getSession().removeAttribute(ClubTeamsCommand.DATA_TYPE);

      sendRedirect("/Exec.do?command=ClubTeams&club_id=" + club.getId().toString());
    } else {
      List<Team> teams = getSessionData(ClubTeamsCommand.DATA_TYPE);

      TeamLogic logic = getLogic();
      if (!logic.processList(id, teams)) {
        throw new TeamNotFoundException(id);
      }

      Team team = logic.getCurrent();
      request.setAttribute("team", team);
      request.setAttribute("teamLeagues", getLeagues(team));
      request.setAttribute("prevTeam", logic.getPrevious());
      request.setAttribute("nextTeam", logic.getNext());
      request.setAttribute("teamTypes", getTypes());
      request.setAttribute(PersonsCommand.DATA_TYPE, PersonLogic.getPersons());
      request.setAttribute(SeasonsCommand.DATA_TYPE, SeasonLogic.getSeasons());

      List<Venue> venues = VenueLogic.getVenues();
      venues = new VenueTownSorter().sort(venues);
      request.setAttribute(VenuesCommand.DATA_TYPE, venues);

      command.forward(ClubTeamsCommand.CLUB_TEAM_EDIT_JSP);
    }
  }
Ejemplo n.º 2
0
  @SuppressWarnings("unchecked")
  @Override
  protected void processSecure() throws GamedayException {
    List<Venue> venues = (List<Venue>) request.getSession().getAttribute("venues");

    VenueLogic logic = getLogic();
    if (!logic.processList(id, venues)) {
      throw new VenueNotFoundException(id);
    }

    request.setAttribute("venue", logic.getCurrent());
    request.setAttribute("prevVenue", logic.getPrevious());
    request.setAttribute("nextVenue", logic.getNext());

    command.forward(VenuesCommand.VENUE_SHOW_JSP);
  }