Package evolaris.framework.sys.business.exception

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


  public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    String msisdnParam = req.getParameter("msisdn");
    SmsSenderManager senderManager = new SmsSenderManager(locale,session);
    Sender sender = senderManager.getSmsSenderByMsisdn(Long.parseLong(msisdnParam));
    if (sender == null) {
      throw new InputException(getResources(req).getMessage(locale, "admin.SenderNotFound",  msisdnParam));
    }
    senderManager.deleteSmsSender(sender);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Deleted sender `"+ msisdnParam + "`");
    return mapping.findForward("deleted");
  }
View Full Code Here


   * @param group  group which the web user tries to access; null => the user tries to access any group (only allowed for administrators)
   */
  protected void checkAccessRights(HttpServletRequest req, Group group) {
    Group webUserGroup = webUser.getGroup();
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && webUserGroup != group) {     
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.insufficientRights"));
    }   
  }  
View Full Code Here

   */
  @Override
  protected void checkAccessRights(HttpServletRequest req, Group group, User entry) {
    Group webUserGroup = webUser.getGroup();
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && group != webUserGroup){
      throw new InputException(getResources(req).getMessage(locale, "um.insufficientRights"));
    }
    if (entry != null){
      if (!req.isUserInRole(UserManagerBase.GROUP_ADMINISTRATOR) && entry.getId() != webUser.getId()) {
        throw new InputException(getResources(req).getMessage(locale, "um.insufficientRights"));
      }
      // edited user may not have/receive more roles than the web user
      for (Role role : entry.getRoles()) {
        if (!req.isUserInRole(role.getRolename())){
          throw new InputException(getResources(req).getMessage(locale, "um.insufficientRights"));
        }
      }
    }
       }
View Full Code Here

   
    UserManager userManager = new UserManager(locale,session);
    User user = userManager.getUserDetails(f.getId());
   
    if (user == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"));
    }
   
    // delete old references
    UserSetManager userSetManager = new UserSetManager(locale,session);
    Set<UserSet> oldUserSets = user.getUserSets();
View Full Code Here

   * @param duplicateUsers  true => include the users in the new set (for different destination groups new user objects without username/password and roles are created)
   * @return  newly created user set
   */
  public UserSet duplicate(UserSet userSet, Group destinationGroup, String newName, boolean includeUsers){
    if (destinationGroup == userSet.getGroup() && newName == null){
      throw new InputException(ResourceBundle.getBundle("UserManagement", locale).getString("userSetExists"));
    }
    UserSet newUserSet = clone(userSet);
    newUserSet.setCreationdate(new Date());
    newUserSet.setEditedAt(null);
    newUserSet.setGroup(destinationGroup);
View Full Code Here

   * @param userSet  the user set
   */
  public void createUserSet(UserSet userSet) {
    // check for existing set and create a reasonable exception if necessary
    if (getUserSet(userSet.getName(),userSet.getGroup()) != null){
      throw new InputException(ResourceBundle.getBundle("UserManagement", locale).getString("userSetExists") + ": " + userSet.getName());
    }
    userSet.setCreationdate(new Date());
    session.save(userSet);
  }
View Full Code Here

    Set<User> sourceUsers = sourceSet.getUsers();
    List<UserSet> result = new ArrayList<UserSet>();
   
    if ((sourceUsers.size() / maxCount) > MAX_AUTOGENERATED_USERSETS) {
      ResourceBundle messages = PropertyResourceBundle.getBundle("UserManagement", locale);     
      throw new InputException(messages.getString("splitResultToHigh").replace("{0}", new Long(MAX_AUTOGENERATED_USERSETS).toString()));
    }

    int setCount = 0;
    int userCount = 0;
    Set<User> users = new HashSet<User>();
View Full Code Here

  protected ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    req.getSession().setAttribute("task", "modify");
    EnterEditDuplicateForm<ET> f = (EnterEditDuplicateForm<ET>)form;
    ET entry = entryFromDatabase(f.getId());
    if (entry == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"),"id = " + f.getId(),null,null);
    }
    f.initialize(entry,locale,session,getResources(req));
    Group group = groupPreparation(req, f.getGroupId());
    f.setGroupId(group.getId());
    Application application = applicationPreparation(req, group, f.getApplicationId());
View Full Code Here

  @SuppressWarnings("unchecked")
  public ActionForward modify(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    EnterEditDuplicateForm<ET> f = (EnterEditDuplicateForm<ET>)form;
    ET entry = entryFromDatabase(f.getId());
    if (entry == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"));
    }
    f.toEntry(entry, locale, session, getResources(req));
    f.modifyEntry(entry, locale, session);
    f.initialize(entry, locale, session, getResources(req))// check access rights with actually written data
    Group group = groupFromId(f.getGroupId());
View Full Code Here

  @SuppressWarnings("unchecked")
  public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    EnterEditDuplicateForm<ET> f = (EnterEditDuplicateForm<ET>)form;
    ET entry = entryFromDatabase(f.getId());
    if (entry == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"));
    }
    f.initialize(entry, locale, session, getResources(req))// check access rights with actual written data in database
    checkAccessRights(req, groupFromId(f.getGroupId()),entry);
    f.deleteEntry(entry,locale,session,getResources(req));
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": deleted existing entry #"+ f.getId() + " of class " + entry.getClass().getSimpleName());
View Full Code Here

TOP

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

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.