Package com.google.visualization.datasource.base

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


     */
    @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);
            appendSimpleText(document, bodyElement, text);
        }

        if(detailedMessage != null) {
            String text = "Description: " + sanitizeDetailedMessage(detailedMessage);
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);
      appendSimpleText(document, bodyElement, text);
    }

    if (detailedMessage != null) {
      String text = "Description: " + sanitizeDetailedMessage(detailedMessage);
View Full Code Here

TOP

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

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.