Package evolaris.framework.sys.business.exception

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


        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);
View Full Code Here


  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    String idParam = req.getParameter("id");
    BlogManager mgr = new BlogManager(locale, session);
    Blog blog = mgr.getBlog(Long.parseLong(idParam));
    if (blog == null) {
      throw new InputException(getResources(req).getMessage(locale, "admin.BlogNotFound", idParam));
    }
    checkAccessRights(req, blog.getGroup());   
    blogToForm(blog, (BlogEnterOrEditForm)form);
    return mapping.findForward("edit");
  }
View Full Code Here

  public ActionForward modify(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    BlogEnterOrEditForm f = (BlogEnterOrEditForm)form;
    BlogManager mgr = new BlogManager(locale,session);
    Blog blog = mgr.getBlog(f.getId());
    if (blog == null) {
      throw new InputException(getResources(req).getMessage(locale, "admin.BlogNotFound", f.getId()));
    }
    checkAccessRights(req, blog.getGroup());
    formToBlog(f, blog);
    ensureUniqueCodePerGroup(blog, req);
    mgr.modifyBlog(blog);
View Full Code Here

      crit.add(Restrictions.ne("id", blog.getId()));
    }
    crit.setProjection(Projections.rowCount());
    Integer count = (Integer)crit.uniqueResult();
    if (count != null && count > 0) {
      throw new InputException(getResources(req).getMessage(locale, "admin.blogCodeNotUniqueInGroup", blog.getCode(), blog.getGroup().getGroupname()));
    }
  }
View Full Code Here

  public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    String idParam = req.getParameter("id");
    BlogManager mgr = new BlogManager(locale, session);
    Blog blog = mgr.getBlog(Long.parseLong(idParam));
    if (blog == null) {
      throw new InputException(getResources(req).getMessage(locale, "admin.BlogNotFound",  idParam));
    }
    checkAccessRights(req, blog.getGroup());
    mgr.deleteBlog(blog);
    String code = blog.getCode();
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": deleted blog `"+ code + "`");
View Full Code Here

    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);
View Full Code Here

    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());
View Full Code Here

    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

    if (entry == null){
      entry = new FragmentCommandEntry();
    }
    entry.setGroup(group);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
    entry.setSortLabel(f.getSortLabel());
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    Fragment fragment = smsDbManager.getFragment(f.getFragmentId());
    if (fragment == null || fragment.getGroup() != entry.getGroup()){
      throw new InputException(resources.getMessage(locale, "smssvc.selectedFragmentDoesNotExistAnymore"));
    }
    entry.setFragment(fragment);
    entry.setOperationPrefix(f.getOperationPrefix().trim().length() == 0 ? null : f.getOperationPrefix());
    return entry;
  }
View Full Code Here

    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));
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.