Ejemplo n.º 1
0
  @RequestMapping(value = "auth/team/executeDelete")
  public String executeDelete(
      Principal principal, @ModelAttribute TeamBackingBean teamBean, ModelMap map) {
    String id = teamBean.getId();
    if (teamBean.getId().isEmpty()) id = null;
    Team team = teamsManager.getTeam(id);

    if (team == null) {
      return "redirect:/auth/team/manage";
    }

    teamsManager.deleteTeam(id);
    return "redirect:/auth/team/manage";
  }
Ejemplo n.º 2
0
  @RequestMapping(value = "auth/team/delete")
  public String prepareDeleteWithNullId(Principal principal, ModelMap map) {
    Team team = teamsManager.getTeam(null);

    if (team == null) {
      return "redirect:/auth/team/manage";
    }

    map.addAttribute("team", teamTranslator.translateTeam(team));
    return "auth/team/delete";
  }
Ejemplo n.º 3
0
  @RequestMapping(value = "auth/team/delete/{teamId}")
  public String prepareDelete(
      Principal principal, @PathVariable("teamId") String teamId, ModelMap map) {
    Team team = teamsManager.getTeam(teamId);

    if (team == null) {
      return "redirect:/auth/team/manage";
    }

    map.addAttribute("team", teamTranslator.translateTeam(team));
    return "auth/team/delete";
  }