@RequestMapping(value = "/account/groups", method = RequestMethod.POST)
  public ModelAndView addNewGroup(@ModelAttribute("group") Group group) {

    group.setName(group.getName().replace("<", " "));
    group.setDescription(group.getDescription().replace("<", " "));
    if (group.getName() != null && !group.getName().equals("")) {
      groupService.createGroup(group.getName(), group.getDescription(), group.isPublicGroup());
      return new ModelAndView("redirect:/tatami/account/groups?success=true");
    }
    return reinitializePage();
  }
示例#2
0
 private Collection<Group> getGroupDetails(User currentUser, Collection<String> groupIds) {
   String domain = DomainUtil.getDomainFromLogin(currentUser.getLogin());
   Collection<Group> groups = new TreeSet<Group>();
   for (String groupId : groupIds) {
     Group group = groupRepository.getGroupById(domain, groupId);
     Group groupDetails = groupDetailsRepository.getGroupDetails(groupId);
     group.setName(groupDetails.getName());
     group.setPublicGroup(groupDetails.isPublicGroup());
     group.setDescription(groupDetails.getDescription());
     long counter = groupCounterRepository.getGroupCounter(domain, groupId);
     group.setCounter(counter);
     groups.add(group);
   }
   return groups;
 }