Package com.iisigroup.cap.exception

Examples of com.iisigroup.cap.exception.CapMessageException


        }
      } catch (Throwable t) {
        throw new CapException(t, executeHandler.getClass());
      }
      if (!hasMethod) {
        throw new CapMessageException("action not found", getClass());
      }
      return rtn;
    }
View Full Code Here


    return logMessage;
  }

  public void putError(IRequest request, Exception e) {
    if (e instanceof CapMessageException) {
      CapMessageException ce = (CapMessageException) e;
      logMessage = ce.getMessage();
      if (!CapString.isEmpty(ce.getMessageKey())) {
        logMessage = ce.getMessageKey();
      }
      logMessage = formatMessage(request, logMessage,
          ce.getExtraInformation());
      errorMessage.put(AJAX_MESSAGE_HANDLER_EXCEPTION, logMessage);
    } else if (e instanceof CapClosePageException) {
      CapClosePageException ce = (CapClosePageException) e;
      logMessage = ce.getMessage();
      if (!CapString.isEmpty(ce.getMessageKey())) {
        logMessage = ce.getMessageKey();
      }
      logMessage = formatMessage(request, logMessage,
          ce.getExtraInformation());
      errorMessage.put(AJAX_CLOSE_PAGE_HANDLER_EXCEPTION, logMessage);
    } else if (e instanceof CapSessioniExpireException) {
      CapSessioniExpireException ce = (CapSessioniExpireException) e;
      logMessage = ce.getMessage();
      if (!CapString.isEmpty(ce.getMessageKey())) {
        logMessage = ce.getMessageKey();
      }
      logMessage = formatMessage(request, logMessage,
          ce.getExtraInformation());
      errorMessage.put(AJAX_SESSION_EXPIRE_EXCEPTION, logMessage);
    } else if (e instanceof CapException) {
      CapException ce = (CapException) e;
      logMessage = new StringBuffer(ce.getCauseClass().getName())
          .append(":").append(e.getMessage()).toString();
      errorMessage.put(AJAX_HANDLER_EXCEPTION, logMessage);
    } else {
      logMessage = e.getLocalizedMessage();
      errorMessage.put(AJAX_HANDLER_EXCEPTION, logMessage);
View Full Code Here

                .getBean(CapCaptchaServlet.DEF_RENDERER);
            if (captcha == null
                || !CaptchaStatus.SUCCESS.equals(captcha
                    .valid(params.get(key)))) {
              // 驗証碼無效請重新輸入
              throw new CapMessageException(
                  CapAppContext.getMessage(captcha.getErrorMessage()),
                  getClass());
            }
          }
        }
View Full Code Here

    try {
      String strParams = jobParametersExtractor
          .fromJobParameters(jobService.getLastJobParameters(jobId));
      result.set("jobParams", strParams);
    } catch (NoSuchJobException e) {
      throw new CapMessageException("msg.job.noSuchJob", getClass());
    }
    return result;
  }// ;
View Full Code Here

            jobParameters);
        // new JobExecutionInfo(jobExecution, TimeZone.getDefault());
        batchSrv.updateExecution(jobExecution.getId(),
            CapSecurityContext.getUserId());
      } catch (NoSuchJobException e) {
        throw new CapMessageException("msg.job.noSuchJob", getClass());
      } catch (JobExecutionAlreadyRunningException e) {
        throw new CapMessageException("msg.job.alreadyRunning",
            getClass());
      } catch (JobRestartException e) {
        throw new CapMessageException("msg.job.canNotRestart",
            getClass());
      } catch (JobInstanceAlreadyCompleteException e) {
        throw new CapMessageException("msg.job.alreadyComplete",
            getClass());
      } catch (JobParametersInvalidException e) {
        throw new CapMessageException("msg.job.parametersInvalid",
            getClass());
      }
    }
    return new AjaxFormResult();
  }// ;
View Full Code Here

    long jobExecutionId = Long.parseLong(request.get("jobExeId"));
    try {
      JobExecution jobExecution = jobService.stop(jobExecutionId);
      new JobExecutionInfo(jobExecution, TimeZone.getDefault());
    } catch (NoSuchJobExecutionException e) {
      throw new CapMessageException("msg.job.noSuchJob", getClass());
    } catch (JobExecutionNotRunningException e) {
      JobExecution jobExecution;
      try {
        jobExecution = jobService.getJobExecution(jobExecutionId);
        new JobExecutionInfo(jobExecution, TimeZone.getDefault());
      } catch (NoSuchJobExecutionException e1) {
        e1.getMessage();
      }
      throw new CapMessageException("msg.job.noRunnigJob", getClass())
          .setExtraInformation(new Object[] { jobExecutionId });
    }
    return result;
  }// ;
View Full Code Here

        jobExecution = jobService.restart(jobExecutionId);
        new JobExecutionInfo(jobExecution, TimeZone.getDefault());

      } catch (NoSuchJobExecutionException e) {
        throw new CapMessageException("msg.job.noSuchJob", getClass());
      } catch (JobExecutionAlreadyRunningException e) {
        throw new CapMessageException("msg.job.alreadyRunning",
            getClass());
      } catch (JobRestartException e) {
        throw new CapMessageException("msg.job.restartExecption",
            getClass())
            .setExtraInformation(new Object[] { jobName });
      } catch (JobInstanceAlreadyCompleteException e) {
        throw new CapMessageException("msg.job.alreadyComplete",
            getClass());
      } catch (JobParametersInvalidException e) {
        throw new CapMessageException("msg.job.parametersInvalid",
            getClass())
            .setExtraInformation(new Object[] { jobName });
      }
    } catch (NoSuchJobException e) {
      throw new CapMessageException("msg.job.noSuchJob", getClass());
    }
    return result;
  }// ;
View Full Code Here

        + job.getJobResource();
    try {
      org.springframework.core.io.Resource f = resourceLoader
          .getResource(location);
      if (f == null || !f.exists()) {
        throw new CapMessageException("msg.job.fileNotFund", getClass());
      }
    } catch (NullPointerException e) {
      throw new CapMessageException("msg.job.fileNotFund", getClass());
    } catch (CapMessageException me) {
      throw me;
    } catch (Exception e1) {
      throw new CapException(e1, getClass());
    }
View Full Code Here

        request.get("codeType"), request.get("codeValue"), locale);

    if ("A".equals(type)) {
      if (code != null) {
        // codetype.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("codetype.0001"), getClass());
      }
      code = new CodeType();
    } else {
      if (code != null && !code.getOid().equals(request.get("oid"))) {
        // codetype.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("codetype.0001"), getClass());
      } else if (code == null) {
        code = codeTypeService.getById(request.get("oid"));
      }
    }
View Full Code Here

    if (!CapString.isEmpty(pid)) {
      remind = commonSrv.findById(Remind.class, pid);
    }
    if (remind == null) {
      throw new CapMessageException(
          CapAppContext.getMessage("EXCUE_ERROR"),
          RemindHandler.class);
    }
    Reminds reminds = new Reminds();
    reminds.setPid(pid);
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.exception.CapMessageException

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.