Package evolaris.framework.um.business

Examples of evolaris.framework.um.business.UserSetManager


    Long userSetId = userImportForm.getUserSetId();
   
    if(userSetId == null){
      throw new InputException(resources.getMessage(locale, "smssvc.missingUserSetSelection"));
    }
    UserSetManager userSetMgm = new UserSetManager(locale,session);
    UserSet userSet = userSetMgm.getUserSet(userSetId);
   
    if(userSet == null){
      throw new InputException(resources.getMessage(locale, "um.userSetNotFound",userSetId));
    }
   
View Full Code Here


    if (user == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"));
    }
   
    // delete old references
    UserSetManager userSetManager = new UserSetManager(locale,session);
    Set<UserSet> oldUserSets = user.getUserSets();
    for (Iterator iterator = oldUserSets.iterator(); iterator.hasNext();) {
      UserSet userSet = (UserSet) iterator.next();
      userSet.getUsers().remove(user);
      userSetManager.modifyUserSet(userSet);
    }
   
    return super.modify(mapping, form, req, resp);
  }
View Full Code Here

      roles = webUser.getRoles().toArray(new Role[0])// only show the own roles
    } else {
      throw new BugException("illegal role");
    }
   
    UserSetManager userSetManager = new UserSetManager(locale,session);
    List<KeyValueContainer> orderedUserSets = userSetManager.buildUserSetOptions(group);
   
    req.getSession().setAttribute("userSets", orderedUserSets);
    req.getSession().setAttribute("roles", roles);
    req.getSession().setAttribute("ownAccount", new Boolean(ownUser).toString());
  }
View Full Code Here

      case 1: // message to user set
        Long userSetId = f.getUserSetId();
        if(userSetId.longValue() == -1){
          throw new BugException("illegal user set id: " + userSetId);
        }
        UserSetManager userSetManager = new UserSetManager(locale,session);
        UserSet userSet =  userSetManager.getUserSet(userSetId);
        if (userSet == null && userSetId != -2) {
          throw new ConfigurationException("illegal user set id: " + userSetId);
        }
        emailCommandEntry.setDestinationUserSet(userSet);
        emailCommandEntry.setCurrentUserSetAsDestination(userSetId == -2 ? 1 : 0);
View Full Code Here

    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

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  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

   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    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);
View Full Code Here

  }
 
  // 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

  }

  public ActionForward enter(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {

    UserSetSplitForm userSetSplitForm = (UserSetSplitForm) form;
    UserSetManager userSetMgm = new UserSetManager(locale, session);
   
    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

  }

  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

TOP

Related Classes of evolaris.framework.um.business.UserSetManager

Copyright © 2018 www.massapicom. 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.