Package evolaris.framework.sys.business.exception

Examples of evolaris.framework.sys.business.exception.BugException


                         request.getServerName(),
                         request.getServerPort(),
                         homePagePath);
      return reconstructedURL.toString();
    } catch (MalformedURLException e) {
      throw new BugException("creating absolute home page url failed", e);
    }
  }
View Full Code Here


    if (f.getSelectedGroupIds() != null) {
      GroupManager groupManager = new GroupManager(locale,session);
      for (String selectedGroupId : f.getSelectedGroupIds()) {
        Group group = groupManager.getGroup(Long.parseLong(selectedGroupId));
        if (group == null) {
          throw new BugException("illegal group id "+selectedGroupId)// must not happen because groups can not be deleted
        }
        groups.add(group);
      }
    }
    sender.setGroups(groups);
View Full Code Here

      UserManager userManager = new UserManager(locale,session);
      roles = userManager.getRoles();
    } else  if (req.isUserInRole(UserManagerBase.GROUP_ADMINISTRATOR) || req.isUserInRole(UserManagerBase.USER)) {
      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);
   
View Full Code Here

   * @param user  user object
   * @return true, if the user was actually added
   */
  public boolean add(UserSet userSet, User user){
    if (userSet.getGroup() != user.getGroup()){
      throw new BugException("tried to add user to user set of different group");
    }
    Set<User> users = userSet.getUsers();
    if (!users.contains(user)){
      users.add(user);
      userSet.setUsers(users);
View Full Code Here

   * @param user  user object
   * @return true, if the user was actually removed
   */
  public boolean remove(UserSet userSet, User user){
    if (userSet.getGroup().getId() != user.getGroup().getId()) {
      throw new BugException("tried to remove user from user set of different group");
    }
    Set<User> users = userSet.getUsers();
    if (users.contains(user)){
      users.remove(user);
      userSet.setUsers(users);
View Full Code Here

   */
  protected Group groupFromId(long groupId) {
    GroupManager groupManager = new GroupManager(locale, session);
    Group group = groupManager.getGroup(groupId);
    if (group == null){
      throw new BugException("Group with ID " + groupId + " disappeared");
    }
    return group;
  }
View Full Code Here

        emailCommandEntry.setDestinationPersonalName(null);
        break;
      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);
        emailCommandEntry.setDestinationUser(null);
        emailCommandEntry.setDestinationEmail(null);
        emailCommandEntry.setDestinationPersonalName(null);
        break;
      case 2: // message to user
        Long userId = f.getUserId();
        if (userId.longValue() == -1){
          throw new InputException(resources.getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected"));
        }
        UserManager userManager = new UserManager(locale,session);
        User user = userManager.getUserDetails(userId);
        if (user == null){
          throw new ConfigurationException("illegal user id: " + user);
        }
        emailCommandEntry.setDestinationUser(user);
        emailCommandEntry.setDestinationUserSet(null);
        emailCommandEntry.setDestinationEmail(null);
        emailCommandEntry.setDestinationPersonalName(null);
        break;
      case 3: // message to e-mail
        emailCommandEntry.setDestinationEmail(f.getToEmail());
        emailCommandEntry.setDestinationPersonalName(f.getToPersonalName());
        emailCommandEntry.setDestinationUserSet(null);
        emailCommandEntry.setDestinationUser(null);
        break;
      default:
        throw new BugException("illegal destination selection number");
    }
    return emailCommandEntry;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see evolaris.platform.smssvc.web.form.MessageSendForm#initialize(evolaris.framework.smsservices.datamodel.CommandEntry)
   */
  @Override
  public void initialize(Send2DCodeCommandEntry entry) {
    throw new BugException("templates not supported for 2D code sending (yet)");
  }
View Full Code Here

      Set<Sender> senders = new HashSet<Sender>();
      if (selectedSenderIds != null) {
        for (String selectedSenderId : selectedSenderIds) {
          Sender sender = senderMgr.getSmsSenderById(Long.parseLong(selectedSenderId));
          if (sender == null) {
            throw new BugException("illegal sender id "+selectedSenderId);
          }
          senders.add(sender);
        }
      }
      group.setSmsSenders(senders);
View Full Code Here

          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");
          }
        }       
      }
    }   
    return mapping.findForward("deleted");
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.exception.BugException

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.