Examples of UserSet


Examples of evolaris.framework.um.datamodel.UserSet

    for(User user : sourceUsers) {
      users.add(user);
      userCount++;
      if (userCount >= maxCount) {
        setCount++;       
        UserSet newSet = new UserSet();
        newSet.setName(sourceSet.getName()+"_"+setCount);
        newSet.setGroup(sourceSet.getGroup());
        newSet.setUsers(users);
        newSet.setCreationdate(new Date());
        result.add(newSet);
        userCount = 0;
        users = new HashSet<User>();
      }
    }
    // a last userSet with the remaining users
    if (users.size() > 0) {
      setCount++;       
      UserSet newSet = new UserSet();
      newSet.setName(sourceSet.getName()+"_"+setCount);
      newSet.setGroup(sourceSet.getGroup());
      newSet.setUsers(users);
      newSet.setCreationdate(new Date());
      result.add(newSet);     
    }
    return result;
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward create(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    Group group = this.getCurrentGroup(req);
    UserSet userSet = new UserSet();
    userSet.setGroup(group);
    userSet.setDescription(userSetEnterOrEditForm.getDescription());
    userSet.setName(userSetEnterOrEditForm.getUserSetName());
    userSet.setHidden(userSetEnterOrEditForm.getHidden()==true?1:0);
    checkAccessRights(req, userSet.getGroup());
    UserSetManager userSetManager = new UserSetManager(locale,session);
    userSetManager.createUserSet(userSet);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Created user set `"+ userSet.getName() + "`" + " in group `" + group.getGroupname() + "`");
    return mapping.findForward("created");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

   */
  public ActionForward modify(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    UserSetManager userSetManager = new UserSetManager(locale,session);
    Long id = userSetEnterOrEditForm.getId();
    UserSet userSet = userSetManager.getUserSet(id);
    if (userSet == null){
      throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  id));
    }
    checkAccessRights(req, userSet.getGroup());
    userSet.setName(userSetEnterOrEditForm.getUserSetName());
    userSet.setDescription(userSetEnterOrEditForm.getDescription());
    userSet.setHidden(userSetEnterOrEditForm.getHidden()==true?1:0);
    userSetManager.modifyUserSet(userSet);
    return mapping.findForward("modified");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    String idParameter = req.getParameter("id");
    long id = Long.valueOf(idParameter);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Requested ID  parameter = `"+ idParameter + "`");
    UserSet userSet = userSetManager.getUserSet(id);
    if (userSet == null){
      throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  id));
    }
    checkAccessRights(req, userSet.getGroup());
    userSetEnterOrEditForm.setId(id);
    userSetEnterOrEditForm.setDescription(userSet.getDescription());
    userSetEnterOrEditForm.setUserSetName(userSet.getName());
    userSetEnterOrEditForm.setHidden(userSet.getHidden()==1?true:false);
    return mapping.findForward("edit");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

  // common delete method
  private ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest req,boolean withUsers) {
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    UserSetManager userSetManager = new UserSetManager(locale,session);
    Long id = userSetEnterOrEditForm.getId();
    UserSet userSet = userSetManager.getUserSet(id);
    if (userSet == null){
      throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  id));
    }
    checkAccessRights(req, userSet.getGroup());
    userSetManager.deleteUserSet(userSet,withUsers);
    return mapping.findForward("deleted");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

   
    String idParameter = req.getParameter("id");
    if (idParameter == null) {
      throw new InputException("ID of user set required");
    }
    UserSet userSet = userSetMgm.getUserSet(Long.parseLong(idParameter));
    userSetSplitForm.setUserSetId(userSet.getId());
    userSetSplitForm.setUserSetName(userSet.getName());
    req.getSession().setAttribute("userCount", userSetMgm.getNumberOfUsersInUserSet(userSet));
   
    return mapping.findForward("enter");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

  public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    UserSetSplitForm splitForm = (UserSetSplitForm)form;
    LOGGER.info("about to split: users/set="+splitForm.getCount());
    UserSetManager userSetMgm = new UserSetManager(locale, session);
    long id = splitForm.getUserSetId();
    UserSet sourceSet = userSetMgm.getUserSet(id);
    List <UserSet> result = userSetMgm.splitUserSet(sourceSet, splitForm.getCount());
    for (UserSet s : result) {
      userSetMgm.createUserSet(s);
    }
    return mapping.findForward("created");
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

      Role role = userMgr.getRole(element.getKey());
      permissionMgr.setRolePermissions(entry, role, element.getValue().toArray(new Long[0]));
    }
    for (Iterator<Map.Entry<Long, Set<Long>>> iter = userSetPermissions.entrySet().iterator(); iter.hasNext();) {
      Map.Entry<Long, Set<Long>> element = iter.next();
      UserSet userSet = userSetMgr.getUserSet(element.getKey());
      permissionMgr.setUserSetPermissions(entry, userSet, element.getValue().toArray(new Long[0]));
    }
    for (Iterator<Map.Entry<Long, Set<Long>>> iter = userPermissions.entrySet().iterator(); iter.hasNext();) {
      Map.Entry<Long, Set<Long>> element = iter.next();
      User user = userMgr.getUserDetails(element.getKey());
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    Group groupToDisplay = this.getCurrentGroup(req);
    UserSetManager userSetMgm = new UserSetManager(locale,session);
    UserSet[] userSets = userSetMgm.getUserSets(groupToDisplay);
    List<UserSetListEntry> userSetList = new LinkedList<UserSetListEntry>();
    for (int i = 0; i < userSets.length; i++) {
      UserSet set = userSets[i];
      userSetList.add(new UserSetListEntry(set.getId(),set.getName(),set.getDescription(),set.getUsers().size()));
    }
    req.setAttribute("userSets", userSetList);
    logProcessingTime("List UserSets; total number of fetched objects = " + userSets.length);
    return mapping.findForward("list");
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    UserSetListForm userSetListForm = (UserSetListForm) form;
    UserSetManager userSetManager = new UserSetManager(locale,session);
    String[] ids = userSetListForm.getChoosen();
    if (ids != null) {
      for (String id : ids) {
        UserSet userSet = userSetManager.getUserSet(Long.parseLong(id));
        if (userSet != null) {
          // security check
          if (UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)
            || (UserManager.isUserInRole(webUser, UserManagerBase.GROUP_ADMINISTRATOR)
              && userSet.getGroup().equals(webUser.getGroup()))) {
            userSetManager.deleteUserSet(userSet,false);
          } else {
            throw new BugException("illegal role");
          }
        }       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.