Package com.google.visualization.datasource.base

Examples of com.google.visualization.datasource.base.StatusType


      } else {
        responseStatus = new ResponseStatus(StatusType.OK, null, null);
      }
    }

    StatusType statusType = responseStatus.getStatusType();
    sb.append(",\"status\":\"").append(statusType.lowerCaseString()).append("\"");

    // There are reason and messages if the status is WARNING/ERROR.
    if (statusType != StatusType.OK) {
      // Status is warning or error.
      if (statusType == StatusType.WARNING) {
View Full Code Here


     * @return A simple HTML for the given response status.
     */
    @Override
    public CharSequence error(final DataSourceRequest request, final ResponseStatus status) {
        // Get the responseStatus details.
        StatusType type = status.getStatusType();
        ReasonType reason = status.getReasonType();
        String detailedMessage = status.getDescription();

        // Create an xml document with head and an empty body.
        Document document = createDocument();
        Element bodyElement = appendHeadAndBody(document);

        // Populate the xml document.
        Element oopsElement = document.createElement("h3");
        oopsElement.setTextContent("Oops, an error occured.");
        bodyElement.appendChild(oopsElement);

        if(type != null) {
            String text = "Status: " + type.lowerCaseString();
            appendSimpleText(document, bodyElement, text);
        }

        if(reason != null) {
            String text = "Reason: " + reason.getMessageForReasonType(null);
View Full Code Here

        if(requestId != null) {
            sb.append(",\"reqId\":\"").append(EscapeUtil.jsonEscape(requestId)).append("\"");
        }
        // Check signature.
        String previousSignature = dsParams.getSignature();
        StatusType statusType = status.getStatusType();
        sb.append(",\"status\":\"").append(statusType.lowerCaseString()).append("\"");
        // Status is error.
        sb.append(",\"errors\":[");
        sb.append(getFaultString(status.getReasonType(), status.getDescription()));
        sb.append("]");
        sb.append("}");
View Full Code Here

            }
            else {
                responseStatus = new ResponseStatus(StatusType.OK, null, null);
            }
        }
        StatusType statusType = responseStatus.getStatusType();
        sb.append(",\"status\":\"").append(statusType.lowerCaseString()).append("\"");
        // There are reason and messages if the status is WARNING/ERROR.
        if(statusType != StatusType.OK) {
            // Status is warning or error.
            if(statusType == StatusType.WARNING) {
                List<Warning> warnings = data.getWarnings();
View Full Code Here

      } else {
        responseStatus = new ResponseStatus(StatusType.OK, null, null);
      }
    }

    StatusType statusType = responseStatus.getStatusType();
    sb.append(",status:'").append(statusType.lowerCaseString()).append("'");

    // There are reason and messages if the status is WARNING/ERROR.
    if (statusType != StatusType.OK) {
      // Status is warning or error.
      if (statusType == StatusType.WARNING) {
View Full Code Here

   *
   * @return A simple html for the given responseStatus.
   */
  public static CharSequence renderHtmlError(ResponseStatus responseStatus) {
    // Get the responseStatus details.
    StatusType status = responseStatus.getStatusType();
    ReasonType reason = responseStatus.getReasonType();
    String detailedMessage = responseStatus.getDescription();

    // Create an xml document with head and an empty body.
    Document document = createDocument();
    Element bodyElement = appendHeadAndBody(document);

    // Populate the xml document.
    Element oopsElement = document.createElement("h3");
    oopsElement.setTextContent("Oops, an error occured.");
    bodyElement.appendChild(oopsElement);

    if (status != null) {
      String text = "Status: " + status.lowerCaseString();
      appendSimpleText(document, bodyElement, text);
    }

    if (reason != null) {
      String text = "Reason: " + reason.getMessageForReasonType(null);
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.base.StatusType

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.