Package org.butor.utils

Examples of org.butor.utils.Message


    }
    String jsonArgs = sqlCall.substring(pos+1, ePos);
    Map<String, Object> args = new JsonHelper().deserialize(jsonArgs, Map.class);
    String sql = sqlQueryGenerator.generateQuery(procName, args);
    if (Strings.isNullOrEmpty(sql)) {
      rh.addMessage(new Message(0, MessageType.WARNING, "procedure " +procName +" either it does not exists or it was not invoked yet!"));
    }
    rh.addRow(sql);
  }
View Full Code Here


 
    // captcha first
    HttpSession ss = getHttpSesion();
    String captcha = (String)ss.getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
    if (StringUtil.isEmpty(captcha_)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Please type in image text."));
      return result;
    }
    if (StringUtil.isEmpty(captcha)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Please try again."));
      return result;
    }
    if (!captcha.equals(captcha_)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Wrong image text. Please try again."));
      return result;
    }
   
    try {
      _userManager.register(firstName_, lastName_, password_, email_);
    } catch (Exception e) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          e.getMessage()));
      return result;
    }

    _ajaxStub.setStatus(result);
View Full Code Here

      // set cookie till browser is closed.
      result.put(SSOConstants.SSO_SSO_ID, ssoId);

    } catch (RealmException e) {
      _logger.warn("Failed to authenticate.", e);
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Authetication failed"));
      return result;
    }

    _ajaxStub.setStatus(result);
View Full Code Here

    // captcha first
    HttpSession ss = getHttpSesion();
    String captcha = (String)ss.getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
    if (StringUtil.isEmpty(captcha_)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Please type in image text."));
      return result;
    }
    if (StringUtil.isEmpty(captcha)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Please try again."));
      return result;
    }
    if (!captcha.equals(captcha_)) {
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Wrong image text. Please try again."));
      return result;
    }

    try {
      if (!_userManager.resetPassword(username_)) {
        _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
            "Unable to reset password!"));
        return result;
      }
    } catch (RealmException e) {
      _logger.warn("Failed to reset password.", e);
      _ajaxStub.addMessage(result, new Message(0, MessageType.ERROR,
          "Failed to reset password."));
      return result;
    }

    _ajaxStub.setStatus(result);
View Full Code Here

          jsr.setService(method.getName());
          jsr.setServiceArgsJson(sargs);

          return target.invoke(serviceCaller, serviceArgs);
        } catch (Exception ex) {
          actx.getResponseHandler().addMessage(new Message(0, MessageType.ERROR,
              ex.getCause().toString()));
        }
        return null;
      }
View Full Code Here

          jsr.setService(method.getName());
          jsr.setServiceArgsJson(sargs);

          return target.invoke(serviceCaller, serviceArgs);
        } catch (Exception ex) {
          actx.getResponseHandler().addMessage(new Message(0, MessageType.ERROR,
              ex.getCause().toString()));
        }
        return null;
      }
View Full Code Here

   * @param handler
   */
  public static <T>  void addList(List<T> list, ResponseHandler<T> handler) {
    Preconditions.checkNotNull(handler, "ResponseHandler should not be null");
    Preconditions.checkNotNull(list, "List should not be null");
    Message msg = new Message("totalRows", MessageType.DATA, Integer.toString(list.size()));
    handler.addMessage(msg);
    for (T o : list) {
      if (!handler.addRow(o))
        break;
    }
View Full Code Here

    if (serviceMethod == null) {
      String msg = String.format("No service=%s found with ns=%s",
          serviceName, namespace);
      _logger.info(msg);
      ctx_.getResponseHandler().addMessage(new Message(0, MessageType.ERROR, msg));
      return;
    }

    try {
      final CommonRequestArgs cr = new CommonRequestArgs();
View Full Code Here

    if (serviceMethod == null) {
      String msg = String.format("No service=%s found with ns=%s",
          serviceName, namespace);
      _logger.info(msg);
      ctx_.getResponseHandler().addMessage(new Message(0, MessageType.ERROR, msg));
      return;
    }

    try {
      final CommonRequestArgs cr = new CommonRequestArgs();
View Full Code Here

   * @param handler
   */
  public static <T>  void addList(List<T> list, ResponseHandler<Object> handler) {
    Preconditions.checkNotNull(handler, "ResponseHandler should not be null");
    Preconditions.checkNotNull(list, "List should not be null");
    Message msg = new Message("totalRows", MessageType.DATA, Integer.toString(list.size()));
    handler.addMessage(msg);
    for (Object o : list) {
      if (!handler.addRow(o))
        break;
    }
View Full Code Here

TOP

Related Classes of org.butor.utils.Message

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.