Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.UserSet


  // Creates duplicated user set with or without users
  private ActionForward createWithOrWithoutUsers(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp, boolean includeUserAssignments) {
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    long originalUserSetId = userSetEnterOrEditForm.getOriginalId();
    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSet originalUserSet = userSetManager.getUserSet(originalUserSetId);
    if (originalUserSet == null){
      throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  originalUserSetId));
    }
    checkAccessRights(req, originalUserSet.getGroup());
    Group group = new GroupManager(locale,session).getGroup(userSetEnterOrEditForm.getGroupId());
    boolean differentGroup = group != originalUserSet.getGroup();
    if (includeUserAssignments && differentGroup && !userSetEnterOrEditForm.isConfirmationPending() && originalUserSet.getUsers().size() >= 1){
      userSetEnterOrEditForm.setConfirmationPending(true);
      String reallyDuplicate1 = getResources(req).getMessage(locale,"um.reallyDuplicate1");
      String reallyDuplicate2 = getResources(req).getMessage(locale,"um.reallyDuplicate2");
      req.setAttribute("generalError",reallyDuplicate1 + " " + originalUserSet.getUsers().size() + " " + reallyDuplicate2);
      return mapping.findForward("confirm");
    }
    userSetEnterOrEditForm.setConfirmationPending(false);
    UserSet newUserSet = userSetManager.duplicate(originalUserSet,group,userSetEnterOrEditForm.getUserSetName(),includeUserAssignments);
    checkAccessRights(req, newUserSet.getGroup());
    newUserSet.setDescription(userSetEnterOrEditForm.getDescription());
    newUserSet.setHidden(userSetEnterOrEditForm.getHidden()==true?1:0);
    userSetManager.modifyUserSet(newUserSet);
    setCurrentGroup(req, resp, group); // switch group in global group selection
    return mapping.findForward("created");
  }
View Full Code Here


    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    if (!userSetEnterOrEditForm.isConfirmationPending()){
      String idParameter = req.getParameter("id");
      long id = Long.valueOf(idParameter);
      UserSet userSet = userSetManager.getUserSet(id);
      if (userSet == null){
        throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  id));
      }
      checkAccessRights(req,userSet.getGroup());
      userSetEnterOrEditForm.setOriginalId(id);
      userSetEnterOrEditForm.setId(id);
      userSetEnterOrEditForm.setDescription(userSet.getDescription());
      userSetEnterOrEditForm.setHidden(userSet.getHidden()==1?true:false);
      userSetEnterOrEditForm.setUserSetName(req.isUserInRole(UserManagerBase.ADMINISTRATOR) ? userSet.getName() :  getResources(req).getMessage(locale, "um.Copy") + ": " + userSet.getName());
      Group group = userSet.getGroup();
      userSetEnterOrEditForm.setGroupId(group.getId());
      userSetEnterOrEditForm.setGroupname(group.getGroupname());
      Group[] groups = groupManager.getGroups();
      req.getSession().setAttribute("groups", groups)// must be in session, because the form may be redisplayed on validation errors
    }
View Full Code Here

        Long userSetId = msgForm.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);
        }
        smsCommandEntry.setDestinationUserSet(userSet);
        smsCommandEntry.setCurrentUserSetAsDestination(userSetId == -2 ? 1 : 0);       
View Full Code Here

        Long userSetId = msgForm.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);
        }
        smsCommandEntry.setDestinationUserSet(userSet);
        smsCommandEntry.setCurrentUserSetAsDestination(userSetId == -2 ? 1 : 0);
View Full Code Here

        && (smsSendForm.getMobileNumber() == null || smsSendForm.getMobileNumber().length() == 0)){
      smsSendForm.setCountryCode("43")// we are from Austria
    }

    // user sets
    UserSet userSet = prepareUserSets(req, smsSendForm, group);

    // destination users
    Set<User> users = userSet == null ? group.getUsers() : userSet.getUsers();
    SortedSet<SmsDestinationAddress> userAddresses = SmsDestinationAddress.smsDestinationAddresses(users);
    prepareUser(req, smsSendForm, userAddresses);

    // senders
    SmsSenderManager smsSenderManager = new SmsSenderManager(locale,session);
View Full Code Here

      if (userSetId.longValue() == -1){
        String noUserSetSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSetSelected");
        req.setAttribute("generalError",noUserSetSelectedString);
        return mapping.findForward("notSent");
      }
      UserSet userSet =  userSetManager.getUserSet(userSetId);
      if (userSet == null){
        throw new ConfigurationException("illegal user set id: " + userSetId);
      }
      users = userSet.getUsers();
      break;
    case 2: // user
      if (userId.longValue() == -1){
        String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
        req.setAttribute("generalError",noUserSelectedString);
View Full Code Here

    if (emailSendForm.getFromPersonalName() == null || emailSendForm.getFromPersonalName().trim().length() == 0){
      emailSendForm.setFromPersonalName((webUser.getFirstName() == null ? "" : webUser.getFirstName()) + " " + (webUser.getLastName() == null ? "" : webUser.getLastName()).trim());
    }

    // user sets
    UserSet userSet = prepareUserSets(req, emailSendForm, group);

    // destination users
    Set<User> users = userSet == null ? group.getUsers() : userSet.getUsers();
    SortedSet<EmailAddress> userAddresses = EmailAddress.availableAddresses(users);
    prepareUser(req, emailSendForm, userAddresses);

    // initial send date
    prepareSendDate(emailSendForm);
View Full Code Here

      if (userSetId.longValue() == -1){
        String noUserSetSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSetSelected");
        req.setAttribute("generalError",noUserSetSelectedString);
        return mapping.findForward("notSent");
      }
      UserSet userSet =  userSetManager.getUserSet(userSetId);
      if (userSet == null){
        throw new ConfigurationException("illegal user set id: " + userSetId);
      }
      users = userSet.getUsers();
      break;
    case 2: // user
      if (userId.longValue() == -1){
        String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
        req.setAttribute("generalError",noUserSelectedString);
View Full Code Here

    interactionLogCommandEntry.setParameter(interactionLogForm.getParameter().length() == 0 ? null : interactionLogForm.getParameter());
    interactionLogCommandEntry.setParameterFromContent(interactionLogForm.getParameterSelection() == null ? 0 : interactionLogForm.getParameterSelection());
    long userSetId = interactionLogForm.getUserSetId();
    if (userSetId >= 1L){
      UserSetManager userSetManager = new UserSetManager(locale,session);
      UserSet userSet = userSetManager.getUserSet(userSetId);
      if (userSet == null || userSet.getGroup() != interactionLogCommandEntry.getGroup()){
        throw new InputException(getResources(req).getMessage(locale, "smssvc.selectedUserSetDoesNotExistAnymore"))// may have been deleted
      }
      interactionLogCommandEntry.setLogUserSet(userSet);
    } else {
      interactionLogCommandEntry.setLogUserSet(null);
View Full Code Here

    UserSetCommandEntry userSetCommandEntry = (UserSetCommandEntry)commandEntry;
    checkAccessRights(req, userSetCommandEntry.getGroup());
    commandEntryManager.evict(userSetCommandEntry)// do not modify in this session yet (might be erroneous)
   
    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSet userSet = f.getUserSetId() == -2 ? null : userSetManager.getUserSet(f.getUserSetId());
    if (f.getUserSetId() != -2
      && (userSet == null || userSet.getGroup() != userSetCommandEntry.getGroup())) {
      throw new InputException(getResources(req).getMessage(locale, "smssvc.selectedUserSetDoesNotExistAnymore"))// may have been deleted
    }

    userSetCommandEntry.setSortLabel(f.getSortLabel());
    userSetCommandEntry.setUserSet(userSet);
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.