Package com.iisigroup.cap.exception

Examples of com.iisigroup.cap.exception.CapMessageException


   */
  public IResult delete(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    String oid = request.get("oid");
    if (CapString.isEmpty(oid)) {
      throw new CapMessageException(
          CapAppContext.getMessage("EXCUE_ERROR"),
          RemindHandler.class);
    }
    Remind remind = commonSrv.findById(Remind.class, oid);
    if (remind != null) {
View Full Code Here


    AjaxFormResult result = new AjaxFormResult();
    String[] oids = (String[]) request.getParamsAsStringArray("oids");
    List<Reminds> models = new ArrayList<Reminds>();

    if (oids == null) {
      throw new CapMessageException(
          CapAppContext.getMessage("EXCUE_ERROR"),
          RemindHandler.class);
    }
    for (String oid : oids) {
      Reminds reminds = commonSrv.findById(Reminds.class, oid);
View Full Code Here

    DivFtItm ftItm = factorMntService.findByDivFtItmNo(divFtItmNo);

    if ("A".equals(type)) {
      if (ftItm != null) {
        // factorMnt.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("factorMntPage.0001"), getClass());
      }
      ftItm = new DivFtItm();
    } else {
      if (ftItm != null && !ftItm.getOid().equals(request.get("oid"))) {
        // factorMnt.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("factorMntPage.0001"), getClass());
      } else if (ftItm == null && !CapString.isEmpty(request.get("oid"))) {
        ftItm = factorMntService.getById(request.get("oid"));
      } else if (ftItm == null){
        ftItm = new DivFtItm();
View Full Code Here

    DivCtItm ctItm = conditionMntService.findByDivCtItmNo(divCtNo);

    if ("A".equals(type)) {
      if (ctItm != null) {
        // conditionMnt.0001 條件代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("condition.0001"), getClass());
      }
      ctItm = new DivCtItm();
    } else {
      if (ctItm != null && !ctItm.getOid().equals(request.get("oid"))) {
        // conditionMnt.0001 條件代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("condition.0001"), getClass());
      } else if (ctItm == null && !CapString.isEmpty(request.get("oid"))) {
        ctItm = conditionMntService.getById(request.get("oid"));
      } else if (ctItm == null){
        ctItm = new DivCtItm();
View Full Code Here

    DivRlItm rlItm = ruleTbMntService.findByDivRlNo(divCtNo);

    if ("A".equals(type)) {
      if (rlItm != null) {
        // 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("ruleTb.0001"), getClass());
      }
      rlItm = new DivRlItm();
    } else {
      if (rlItm != null && !rlItm.getOid().equals(request.get("oid"))) {
        // 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("ruleTb.0001"), getClass());
      } else if (rlItm == null && !CapString.isEmpty(request.get("oid"))) {
        rlItm = ruleTbMntService.getById(request.get("oid"));
      } else if (rlItm == null){
        rlItm = new DivRlItm();
View Full Code Here

    try {
      Document document = DocumentHelper.parseText(xmlString);
      Element root = document.getRootElement();
      return travelXML(root);
    } catch (DocumentException e) {
      throw new CapMessageException(e, CapXmlUtil.class);
    }
  }
View Full Code Here

   */
  public static Document convertXMLStringToDocument(String xmlString) {
    try {
      return DocumentHelper.parseText(xmlString);
    } catch (DocumentException e) {
      throw new CapMessageException(e, CapXmlUtil.class);
    }
  }
View Full Code Here

    try {
      new XMLWriter(out, new OutputFormat(Constants.EMPTY_STRING, format,
          CharEncoding.UTF_8)).write(doc);
      return out.toString();
    } catch (IOException e) {
      throw new CapMessageException(e, CapXmlUtil.class);
    }
  }
View Full Code Here

    try {
      return multipartResolver
          .resolveMultipart((HttpServletRequest) params
              .getServletRequest());
    } catch (MaxUploadSizeExceededException fe) {
      CapMessageException me = new CapMessageException(
          fileSizeLimitErrorCode, getClass());
      Object[] extra = new Object[] { CapMath.divide(
          String.valueOf(fe.getMaxUploadSize()), "1048576", 2) };
      me.setMessageKey(fileSizeLimitErrorCode);
      me.setExtraInformation(extra);
      throw me;
    } catch (MultipartException e) {
      throw new CapException(e, getClass());
    }
View Full Code Here

    public IResult add(IRequest request) {
        String code = request.get("code");
        User user = userService.findUserByUserCode(code);
        if (user != null) {
            throw new CapMessageException(CapAppContext.getMessage(
                    "users.exist", new Object[] { code }), getClass());
        }
        String name = request.get("name");
        String password = request.get("password");
        String confirm = request.get("confirm");
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.