Package com.google.visualization.datasource.base

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


  private void createDataSourceParametersFromRequest(HttpServletRequest req)
      throws DataSourceException {
    // Set the data source parameters.
    String dataSourceParamsString = req.getParameter(DATASOURCE_REQUEST_PARAMETER);

    dsParams = new DataSourceParameters(dataSourceParamsString);
    // For backward compatibility, set the OutputType to be 'jsonp' in case the request is cross
    // domain and the 'out' property in the 'tqx' parameter is 'json'.
    if (dsParams.getOutputType() == OutputType.JSON && !sameOrigin) {
      dsParams.setOutputType(OutputType.JSONP);
    }
View Full Code Here


   *
   * @throws IOException In case an error happened trying to write to the servlet response.
   */
  public static void setServletResponse(String responseMessage,
      DataSourceRequest dataSourceRequest, HttpServletResponse res) throws IOException {
    DataSourceParameters dataSourceParameters = dataSourceRequest.getDataSourceParameters();
    ResponseWriter.setServletResponse(responseMessage, dataSourceParameters, res);
  }
View Full Code Here

   *
   * @throws IOException In case if I/O errors.
   */
  public static String generateErrorResponse(ResponseStatus responseStatus,
      DataSourceRequest dsRequest) throws IOException {
    DataSourceParameters dsParameters = dsRequest.getDataSourceParameters();
    CharSequence response;
    switch (dsParameters.getOutputType()) {
      case CSV:
      case TSV_EXCEL:
        response = CsvRenderer.renderCsvError(responseStatus);
        break;
      case HTML:
View Full Code Here

      "Missing feed info in configuration");
    }
    Feed dataFeed = super.retrieveFeed(request);

    DataTable dataTable = null;
    DataSourceParameters dataSourceParameters = null;
    String response = null;
    try {
      dataTable = getDataTable(dataFeed, feedInfo);
      Query query = DataSourceHelper.parseQuery(tq);
      dataTable = DataSourceHelper.applyQuery(query, dataTable, ULocale.getDefault());
      dataSourceParameters = new DataSourceParameters(tqx);
      response = JsonRenderer.renderJsonResponse(
          dataSourceParameters,
          new ResponseStatus(StatusType.OK),
          dataTable,
          true).toString();
View Full Code Here

TOP

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

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.