Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.UserSet


   
    setFromEmail(entry.getSourceEmail());
    setFromPersonalName(entry.getSourcePersonalName());
   
    // destination selection
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
   
    if(destinationUserSet != null || entry.getCurrentUserSetAsDestination() == 1) {
      setDestinationSelection(1);
      setUserSetId(destinationUserSet != null ? destinationUserSet.getId() : -2);
    } else if(destinationUser != null){
      setDestinationSelection(2);
      setUserId(destinationUser.getId());
    } else if (entry.getDestinationEmail() != null){
      setDestinationSelection(3);
      setUserSetId(-1L);
      setToEmail(entry.getDestinationEmail());
      setToPersonalName(entry.getDestinationPersonalName());
    } else { // the sender of the request is also the receiver
      setDestinationSelection(0);
    }
   
    setUserId(destinationUser == null ? null : destinationUser.getId());
    setUserName(destinationUser == null ? null : destinationUser.getUsername());
    setUserSetId(destinationUserSet == null ? null : destinationUserSet.getId());
  }
View Full Code Here


    setFromEmail(entry.getSourceEmail());
    setFromPersonalName(entry.getSourcePersonalName());
    // destination selection
    String destinationEmail = entry.getDestinationEmail();
    String destinationPersonalName = entry.getDestinationPersonalName();
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
    if (destinationUser != null){
      destinationUserSet = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(2);
    } else if (destinationUserSet != null || entry.getCurrentUserSetAsDestination() == 1){
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(1);
    } else if (destinationEmail != null){
      destinationUserSet = null;
      destinationUser = null;
      setDestinationSelection(3);
    } else { // default: requesting user
      destinationUserSet = null;
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(0);
    }
    setToEmail(destinationEmail);
    setToPersonalName(destinationPersonalName);
    setUserId(destinationUser == null ? -1 : destinationUser.getId());
    setUserSetId(destinationUserSet == null ? entry.getCurrentUserSetAsDestination() == 1 ? -2 : -1 : destinationUserSet.getId());
  }
View Full Code Here

   * removes a user from userSet
   * @param user the user that has to be removed from userSet
   * @param userSetName the user set name
   */
  public void removeUserFromUserSet(User user, String userSetName){
    UserSet set = getUserSet(userSetName,user.getGroup());
    removeUserFromUserSet(user,set);
  }
View Full Code Here

        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

    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

   *      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

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

    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

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

   
    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

TOP

Related Classes of evolaris.framework.um.datamodel.UserSet

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.