Package evolaris.framework.sys.business.exception

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


    Long userSetId = userSetAssociationListForm.getUserSetId();

    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Modify request with user set ID `" + userSetId + "`");

    if (userSetId == null){
      throw new BugException("missing user set id");
    }
    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSet userSet = userSetManager.getUserSet(userSetId);
    checkAccessRights(req, userSet.getGroup());
    String[] choosen = userSetAssociationListForm.getChoosen();
View Full Code Here


    if (selectedRoleIds != null){
      for (String selectedRoleId : selectedRoleIds) {
        UserManager userManager = new UserManager(locale,session);
        Role role = userManager.getRole(Long.parseLong(selectedRoleId));
        if (role == null){
          throw new BugException("illegal role id");
        }
        roles.add(role);
      }
    }
    user.setRoles(roles)// may even be empty
View Full Code Here

      } else {
        return null;
      }
     
    } catch(ParseException e) {
      throw new BugException("validation of date and time failed");
    }
  }
View Full Code Here

                user = userManager.registerUserByEmail(email.getEmailSender(), invocation.getGroup());
                eventParameters = new EmailEventParameters(Locale.GERMAN,session,user,invocation, email);
                eventParameters.updateInteractionLog(log);
                interactionLogManager.writeInteractionLog(log);
              } else {
                throw new BugException("unsupported message type: " + messageObject.getClass().getName());
              }

              interactionLogManager.writeInteractionLog(log);

              Set commandEntries = invocation.getCommandEntries();
View Full Code Here

     
      return importResult;
    } catch (IOException e) {
      throw new InputException(messages.getString("ErrorDuringReadingTheFile"),e);
    catch (NoSuchMethodException e) {
      throw new BugException("a caption to method mapping is invalid",e);
    catch (IllegalAccessException e) {
      throw new BugException("a caption to method mapping is invalid",e);
    } catch (InvocationTargetException e) {
      throw new BugException("a caption to method mapping is invalid",e);
    }
  }
View Full Code Here

   */
  @Override
  public ActionForward execute(Exception exception, ExceptionConfig arg1, ActionMapping mapping, ActionForm arg3, HttpServletRequest req, HttpServletResponse arg5) throws ServletException {
    String userName = req.getUserPrincipal() == null ? "`ANONYMOUS USER`" : req.getUserPrincipal().getName().toLowerCase();     
    correctStrutsLocale(req);
    BugException e = (BugException) exception;
    e.generalLog(userName);
    String message = e.getUserMessage();
    req.setAttribute("userMessage",message)// may be null => page has to prepare a default
    return mapping.findForward("bugErrorPage");
  }
View Full Code Here

          String generalInformation = getResources(req).getMessage(locale, "smssvc.asyncSendStarted", new Object[] {new Integer(receivers.size()), formattedDate});
          req.setAttribute("generalInformation", generalInformation);
          return mapping.findForward("sent");
        }
      } catch (NumberFormatException e){
        throw new BugException("validation of countryCode and mobileNumber failed");
      }
    default:
      String noDestinationSelectedString = getResources(req).getMessage(locale,"smssvc.noDestinationSelected");
      req.setAttribute("generalError",noDestinationSelectedString);
      return mapping.findForward("notSent");
View Full Code Here

  /* Send message to set of users, checking access rights and creating information/error messages */
  private ActionForward sendToUsersWithMsisdn(SmsSourceAddress fromAddress, Set<User> users, ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp, Date sendAt) {
    SmsSendForm msgForm = (SmsSendForm) form;
    for (User user : users) {
      if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && user.getGroup() != webUser.getGroup()){
        throw new BugException("user selected as SMS destination, who must not be accessed: " + user.getId());
      }
    }
    SortedSet<SmsDestinationAddress> receivers = SmsDestinationAddress.smsDestinationAddresses(users);
    if (receivers.size() == 0) {
      String noUsersWithMsisdnsString = getResources(req).getMessage(locale,"smssvc.noUsersWithMsisdns");
View Full Code Here

   */
  public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    String commandEntryIdParam = req.getParameter("commandEntryId");
    if (commandEntryIdParam == null){
      throw new BugException("missing command entry id parameter");
    }
    long commandEntryId = Long.parseLong(commandEntryIdParam);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null){  // command may have been deleted
      throw new InputException(getResources(req).getMessage(locale,"smssvc.commandEntryNotAvailable"));
    }
    LOGGER.info("distributing edit action according to command entry type: " + commandEntry.getClass().getSimpleName());
    req.setAttribute("commandEntryId",commandEntryId);
   
    if (commandEntry instanceof SmsCommandEntry){
      return mapping.findForward("editSmsTemplate");
    } else if (commandEntry instanceof EmailCommandEntry){
        return mapping.findForward("editEmailTemplate");
    } else if (commandEntry instanceof UpcallCommandEntry) {
      return mapping.findForward("editUpcallTemplate");
    } else if (commandEntry instanceof HttpCommandEntry) {
      return mapping.findForward("editHttpTemplate");
    } else {
      throw new BugException("unsupported command entry type for template: " + commandEntry.getClass().getName());
    }
  }
View Full Code Here

        break;
      case 4: // message to user set
        smsCommandEntry.setDestinationContact(0);
        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);       
        smsCommandEntry.setDestinationUser(null);
        smsCommandEntry.setDestinationMsisdn(null);
        break;
      case 5: // message to user
        Long userId = msgForm.getUserId();
        if (userId.longValue() == -1){
          String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
          throw new InputException(noUserSelectedString);
        }
        UserManager userManager = new UserManager(locale,session);
        User user = userManager.getUserDetails(userId);
        if (user == null){
          throw new ConfigurationException("illegal user id: " + user);
        }
        smsCommandEntry.setDestinationContact(0);
        smsCommandEntry.setDestinationUser(user);
        smsCommandEntry.setDestinationUserSet(null);
        smsCommandEntry.setDestinationMsisdn(null);
        break;
      case 6: // message to msisdn
        smsCommandEntry.setDestinationContact(0);
        String countryCode = msgForm.getCountryCode();
        String mobileNumber = msgForm.getMobileNumber();
        try {
          long countryCodeNumber = Long.parseLong(countryCode);
          long mobileNumberNumber = Long.parseLong(mobileNumber);
          long msisdn = Long.parseLong(countryCodeNumber + "" + mobileNumberNumber)// ignores leading zeros
          smsCommandEntry.setDestinationUserSet(null);
          smsCommandEntry.setDestinationUser(null);
          smsCommandEntry.setDestinationMsisdn(msisdn);
        } catch (NumberFormatException e){
          throw new BugException("validation of countryCode and mobileNumber failed");
        }
        break;
      default:
        throw new BugException("illegal destination selection number");
    }
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase()
        + ": Modified message command entry #" + smsCommandEntry.getId()
        + "; label: " + smsCommandEntry.getSortLabel() + "; message: " + smsCommandEntry.getTextContent()
        + "; MSISDN: " + smsCommandEntry.getSender().getMsisdn());
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.