Package evolaris.framework.sys.business.exception

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


        POIFSFileSystem fs = new POIFSFileSystem(inputStream);
        XLS2CSVmra converter = new XLS2CSVmra(fs, out, -1, separator, quote);
        converter.process();
        return outStream.toByteArray();
      } catch (IOException e) {       
        throw new BugException(e.getMessage());
      }     
    }
    return new byte[] {0};
  }
View Full Code Here


        receivedSms.setAttachment(new SerialBlob(executionForm.getFile().getFileData()));
        receivedSms.setAttachmentContentType(executionForm.getFile().getContentType());
        receivedSms.setAttachmentName(executionForm.getFile().getFileName());
      } catch (Exception e) {
        LOGGER.error("Creating blob from uploaded file faild.", e);
        throw new BugException("Creating blob from uploaded file faild.", e);
      }
    }
   
    receivedSms.setInvocation(invocation);
    SmsDbManager smsMgr = new SmsDbManager(locale, session);
View Full Code Here

    String labelParam;
    Group group = getGroupParam(req);
    try {
      labelParam = new String(req.getParameter("label").getBytes(), "UTF-8");
    } catch (UnsupportedEncodingException e1) {
      throw new BugException(e1.getMessage());
    }
    BlogManager blogMgr = new BlogManager(locale, session);
    List<Article> articles = blogMgr.getArticlesByLabel(labelParam);   
    List<DisplayableArticle> entries = new ArrayList<DisplayableArticle>();
    PermissionManager permissionMgr = new PermissionManager(locale, session);
View Full Code Here

      }
      timerEvent.setRequestingUser(requestingUser);
      timerEvent.setRequestingUserSet(null);
    } else {
      if (f.getApplyToSelection() != 2) { // user set
        throw new BugException("invalid apply-to flag: " + f.getApplyToSelection());
      }
      UserSetManager userSetManager = new UserSetManager(locale,session);
      timerEvent.setRequestingUser(null);
      UserSet requestingUserSet = userSetManager.getUserSet(f.getRequestingUserSetId());
      if (requestingUserSet == null){
View Full Code Here

    Group destinationGroup;
    Application destinationApplication = null;
    Object destinationApplicationIdFromSession = req.getSession().getAttribute("destinationApplicationId");
    if (destinationApplicationIdFromSession != null){
      if (!(destinationApplicationIdFromSession instanceof Long)){
        throw new BugException("invalid destinationApplicationId parameter: " + destinationApplicationIdFromSession);
      }
      ApplicationManager applicationManager = new ApplicationManager(locale,session);
      destinationApplication = applicationManager.getApplication((Long)destinationApplicationIdFromSession);
      if (destinationApplication == null){
        throw new BugException("invalid destination application id: " + destinationApplicationIdFromSession);
      }
      destinationGroup = destinationApplication.getGroup();
    } else {
      Object destinationGroupIdFromSession = req.getSession().getAttribute("destinationGroupId");
      if (!(destinationGroupIdFromSession instanceof Long)){
        throw new BugException("invalid destinationGroupId parameter: " + destinationGroupIdFromSession);
      }
      GroupManager groupManager = new GroupManager(locale,session);
      destinationGroup  = groupManager.getGroup((Long)destinationGroupIdFromSession);
      if (destinationGroup == null){
        throw new BugException("invalid destination group id: " + destinationGroupIdFromSession);
      }
    }
   
    // get mappings from session
    Object mappingSetFromSession = req.getSession().getAttribute("mappingSet");
    if (!(mappingSetFromSession instanceof MappingSet)) {
      throw new BugException("invalid mappingSet parameter: " + mappingSetFromSession);
    }
    MappingSet mappingSet = (MappingSet) mappingSetFromSession;
    mappingSet.reload(locale, session);
   
    // prepare mapping form and request attributes
View Full Code Here

    Set<UserSet> userSets = new HashSet<UserSet>();
    if (selectedUserSetIds != null) {
      for (String selectedUserSetId : selectedUserSetIds) {
        UserSet userSet = userSetManager.getUserSet(Long.parseLong(selectedUserSetId));
        if (userSet == null) {
          throw new BugException("illegal user set id `"+selectedUserSetId + "`");
        }
        userSets.add(userSet);
      }
    }
    entry.setUserSets(userSets);   
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 SimpleCommandEntry){
      return mapping.findForward("editSimpleInteraction");
    } else if (commandEntry instanceof SmsCommandEntry){
      return mapping.findForward("editSmsInteraction");
    } else if (commandEntry instanceof EmailCommandEntry){
      return mapping.findForward("editEmailInteraction");
    } else if (commandEntry instanceof UserSetCommandEntry){
      return mapping.findForward("editUserSetInteraction");
    } else if (commandEntry instanceof AccessCheckCommandEntry){
      return mapping.findForward("editAccessCheckInteraction");
    } else if (commandEntry instanceof FragmentCommandEntry){
      return mapping.findForward("editFragmentInteraction");
    } else if (commandEntry instanceof IterateCommandEntry){
      return mapping.findForward("editIterateInteraction");
    } else if (commandEntry instanceof InteractionLogCommandEntry){
      return mapping.findForward("editInteractionLogInteraction");
    } else if (commandEntry instanceof BreakCommandEntry){
      return mapping.findForward("editBreakInteraction");
    } else if (commandEntry instanceof ContentParseCommandEntry){
      return mapping.findForward("editContentParserInteraction");
    } else if (commandEntry instanceof Send2DCodeCommandEntry) {
      return mapping.findForward("editSend2DCodeInteraction");     
    } else if(commandEntry instanceof UpcallCommandEntry){
      return mapping.findForward("editUpcallInteraction")
    } else if(commandEntry instanceof BlogCommandEntry){
      return mapping.findForward("editBlogInteraction")
    } else if(commandEntry instanceof HttpCommandEntry){
      return mapping.findForward("editHttpInteraction")
    } else if(commandEntry instanceof CommentCommandEntry){
      return mapping.findForward("editCommentInteraction")
    } else if(commandEntry instanceof ImageRecognitionCommandEntry){
      return mapping.findForward("editImageRecognitionInteraction")
    } else {
      throw new BugException("unknown command entry type: " + commandEntry.getClass().getName());
    }
  }
View Full Code Here

    } else if (timerEvent.getRequestingUserSet() != null){
      requestingUsers = timerEvent.getRequestingUserSet().getUsers();
      LOGGER.info("timer event configured for user set `" + timerEvent.getRequestingUserSet().getName() + "` with " + requestingUsers.size() + " users");
    } else {
      LOGGER.error("configured event #" +timerEvent.getId() + " without requesting user/user set/group => ignoring");
      throw new BugException("There is no requesting user for the timer event " + timerEvent.getId());
    }
   
   
    for (User requestingUser : requestingUsers) {
      if (timerEvent == null){ // user may stop long tasks by deleting the event
View Full Code Here

  protected ActionForward duplicateBasedOnMappingSet(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    FragmentEnterOrEditForm f = (FragmentEnterOrEditForm)form;
    // get mappings from session
    Object mappingSetFromSession = req.getSession().getAttribute("mappingSet");
    if (!(mappingSetFromSession instanceof MappingSet)) {
      throw new BugException("invalid mappingSet parameter: " + mappingSetFromSession);
    }
    MappingSet mappingSet = (MappingSet) mappingSetFromSession;
    mappingSet.reload(locale, session);
   
    Object oldInteractionListId = req.getSession().getAttribute("oldInteractionListId");
View Full Code Here

   */
  protected CommandEntry commandEntryFromRequest(HttpServletRequest req) {
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Object commandEntryIdParameter = req.getAttribute("commandEntryId");
    if (commandEntryIdParameter == null || !(commandEntryIdParameter instanceof Long)){
      throw new BugException("no command entry id passed to the edit action");
    }
    long commandEntryId = ((Long)commandEntryIdParameter).longValue();
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if(commandEntry == null){
      throw new ConfigurationException("There is no command entry with id: " + commandEntryId + " -> cannot edit the interaction");
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.