Package evolaris.framework.sys.business.exception

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


      crit.add(Restrictions.ne("id", app.getId()));
    }
    crit.setProjection(Projections.rowCount());
    Integer count = (Integer)crit.uniqueResult();
    if (count != null && count > 0) {
      throw new InputException(ResourceBundle.getBundle("System", locale).getString("ApplicationNameNotUniqueInGroup") +": " + app.getName());
    }
  }
View Full Code Here


      calendar.set(Calendar.YEAR, Integer.parseInt(schedulableForm.getSendYear()));
      calendar.set(Calendar.MONTH, Integer.parseInt(schedulableForm.getSendMonth()) - 1);
      calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(schedulableForm.getSendDay()));
    }
    if (schedulableForm.getSendHour() == null || schedulableForm.getSendHour().length() == 0){
      throw new InputException(getResources(req).getMessage(locale,"smssvc.sendingHourAndMinuteMustBeProvided"));
    }
    calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(schedulableForm.getSendHour()));
    calendar.set(Calendar.MINUTE, Integer.parseInt(schedulableForm.getSendMinute()));
    if (calendar.get(Calendar.YEAR) != Integer.parseInt(schedulableForm.getSendYear())
        || calendar.get(Calendar.MONTH) != Integer.parseInt(schedulableForm.getSendMonth()) - 1
        || calendar.get(Calendar.DAY_OF_MONTH) != Integer.parseInt(schedulableForm.getSendDay())
        || calendar.get(Calendar.HOUR_OF_DAY) != Integer.parseInt(schedulableForm.getSendHour())
        || calendar.get(Calendar.MINUTE) != Integer.parseInt(schedulableForm.getSendMinute())){
      throw new InputException(getResources(req).getMessage(locale,"smssvc.specifiedDateDoesNotExist"));
    }
   
    if (calendar.getTimeInMillis() <= System.currentTimeMillis()){
      throw new InputException(getResources(req).getMessage(locale,"smssvc.sendingTimeMustBeInTheFuture"));
    }
    return calendar;
  }
View Full Code Here

   */
  public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    HttpInteractionEnterOrEditForm f = (HttpInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
   
    HttpCommandEntry commandEntry = new HttpCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
View Full Code Here

  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    HttpInteractionEnterOrEditForm f = (HttpInteractionEnterOrEditForm)form;
   
    HttpCommandEntry commandEntry = (HttpCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
   
    f.setCommandEntryId(commandEntry.getId());
    f.setSortLabel(commandEntry.getSortLabel());
View Full Code Here

  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    HttpInteractionEnterOrEditForm f = (HttpInteractionEnterOrEditForm)form;
   
    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null || f.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
       
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale, session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof HttpCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
   
    HttpCommandEntry httpCommandEntry = (HttpCommandEntry)commandEntry;
    checkAccessRights(req, httpCommandEntry.getGroup());
    commandEntryManager.evict(httpCommandEntry)// do not modify in this session yet (might be erroneous)
View Full Code Here

      nextCh();
      try {
        phrase();
        return result.toArray(new String[result.size()]);
      } catch (ParseException e) {
        throw new InputException("error parsing line `"+buffer+"`");
      }
    }
View Full Code Here

   */
  public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    BlogInteractionEnterOrEditForm f = (BlogInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
   
    BlogCommandEntry commandEntry = new BlogCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    if (f.getBlogId() > 0) {
      BlogManager blogMgr = new BlogManager(locale, session);
      Blog blog = blogMgr.getBlog(f.getBlogId());
      if (blog == null) {
        throw new InputException(resources.getMessage(locale, "smssvc.selectedBlogNotFound"));
      }
      commandEntry.setBlog(blog);
    } else {
      commandEntry.setBlog(null);
    }
View Full Code Here

    BlogInteractionEnterOrEditForm f = (BlogInteractionEnterOrEditForm)form;
   
    BlogCommandEntry commandEntry = (BlogCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      MessageResources resources = getResources(req);
      throw new InputException(resources.getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
   
    f.setCommandEntryId(commandEntry.getId());
    f.setBlogId(commandEntry.getBlog() == null ? 0 : commandEntry.getBlog().getId());
View Full Code Here

  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    BlogInteractionEnterOrEditForm f = (BlogInteractionEnterOrEditForm)form;
   
    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null || f.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
       
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale, session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof BlogCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
   
    BlogCommandEntry blogCommandEntry = (BlogCommandEntry)commandEntry;
    checkAccessRights(req, blogCommandEntry.getGroup());
    commandEntryManager.evict(blogCommandEntry)// do not modify in this session yet (might be erroneous)

    blogCommandEntry.setSortLabel(f.getSortLabel());
    if (f.getBlogId() > 0) {
      BlogManager blogMgr = new BlogManager(locale, session);
      Blog blog = blogMgr.getBlog(f.getBlogId());
      if (blog == null) {
        throw new InputException(resources.getMessage(locale, "smssvc.selectedBlogNotFound"));
      }     
      blogCommandEntry.setBlog(blog);
    } else {
      blogCommandEntry.setBlog(null);
    }
View Full Code Here

    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
   
    Invocation invocation = smsDbManager.getInvocation(invocationId);
   
    if (invocation == null){
      throw new InputException(getResources(req).getMessage(locale, "sys.entryNotAvailable"),"id = " + executionForm.getId(),null,null);
    }
   
    req.getSession().setAttribute("invocation", invocation);
   
    Long msisdn = webUser.getMsisdn();
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.