Example usage for com.google.gwt.gdata.client.analytics DataQuery setMaxResults

List of usage examples for com.google.gwt.gdata.client.analytics DataQuery setMaxResults

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.analytics DataQuery setMaxResults.

Prototype

public final native void setMaxResults(double maxResults) ;

Source Link

Document

Sets the maximum number of results to be retrieved.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsBounceRateDemo.java

License:Apache License

/**
 * Retrieves a data feed for an Analytics account using a Query object.
 * In GData, feed URIs can contain querystring parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the data feed, the data entries are displayed
 * to the user via the showData method./*from   w ww. jav  a 2 s  .c o m*/
 * Query parameters are specified for start and end dates, dimensions,
 * metrics, sort field and direction, max results and the IDs of the
 * account tables which should be queried.
 * 
 * @param tableId The id of the account table for which to retrieve the
 * Analytics data.
 */
private void queryData(String tableId) {
    DataQuery query = DataQuery.newInstance("https://www.google.com/analytics/feeds/data");
    query.setStartDate("2009-07-01");
    query.setEndDate("2009-07-31");
    query.setDimensions("ga:source,ga:medium");
    query.setMetrics("ga:entrances,ga:bounces");
    query.setSort("-ga:entrances");
    query.setMaxResults(10);
    query.setIds(tableId);
    showStatus("Loading data feed...", false);
    service.getDataFeed(query, new DataFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus(
                    "An error occurred while retrieving the Analytics Data " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(DataFeed result) {
            showData(result.getEntries());
        }
    });
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsLanguagesDemo.java

License:Apache License

/**
 * Retrieves a data feed for an Analytics account using a Query object.
 * In GData, feed URIs can contain querystring parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the data feed, the data entries are displayed
 * to the user via the showData method.//w  ww.  j  a v  a 2 s  . c  o m
 * Query parameters are specified for start and end dates, dimensions,
 * metrics, sort field and direction, query filters and the IDs of the
 * account tables which should be queried.
 * 
 * @param tableId The id of the account table for which to retrieve the
 * Analytics data.
 */
private void queryData(String tableId) {
    DataQuery query = DataQuery.newInstance("https://www.google.com/analytics/feeds/data");
    query.setStartDate("2009-07-01");
    query.setEndDate("2009-07-31");
    query.setDimensions("ga:country,ga:language");
    query.setMetrics("ga:visits");
    query.setSort("ga:country,-ga:visits");
    query.setMaxResults(10);
    query.setFilters("ga:country==United States");
    query.setIds(tableId);
    showStatus("Loading data feed...", false);
    service.getDataFeed(query, new DataFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus(
                    "An error occurred while retrieving the Analytics Data " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(DataFeed result) {
            showData(result.getEntries());
        }
    });
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsTopPagesDemo.java

License:Apache License

/**
 * Retrieves a data feed for an Analytics account using a Query object.
 * In GData, feed URIs can contain querystring parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the data feed, the data entries are displayed
 * to the user via the showData method./*from w ww  .ja  v  a2  s . c om*/
 * Query parameters are specified for start and end dates, dimensions,
 * metrics, sort field and direction, max results and the IDs of the
 * account tables which should be queried.
 * 
 * @param tableId The id of the account table for which to retrieve the
 * Analytics data.
 */
private void queryData(String tableId) {
    DataQuery query = DataQuery.newInstance("https://www.google.com/analytics/feeds/data");
    query.setStartDate("2009-07-01");
    query.setEndDate("2009-07-31");
    query.setDimensions("ga:pageTitle,ga:pagePath");
    query.setMetrics("ga:pageviews");
    query.setSort("-ga:pageviews");
    query.setMaxResults(10);
    query.setIds(tableId);
    showStatus("Loading data feed...", false);
    service.getDataFeed(query, new DataFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus(
                    "An error occurred while retrieving the Analytics Data " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(DataFeed result) {
            showData(result.getEntries());
        }
    });
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsTopSearchesDemo.java

License:Apache License

/**
 * Retrieves a data feed for an Analytics account using a Query object.
 * In GData, feed URIs can contain querystring parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the data feed, the data entries are
 * displayed to the user via the showData method.
 * Query parameters are specified for start and end dates, dimensions,
 * metrics, sort field and direction, max results and the IDs of the
 * account tables which should be queried.
 * //  w  w  w.  j  av a  2  s. c  o  m
 * @param tableId The id of the account table for which to retrieve the
 * Analytics data.
 */
private void queryData(String tableId) {
    DataQuery query = DataQuery.newInstance("https://www.google.com/analytics/feeds/data");
    query.setStartDate("2009-07-01");
    query.setEndDate("2009-07-31");
    query.setDimensions("ga:searchKeyword,ga:searchKeywordRefinement," + "ga:searchDestinationPage");
    query.setMetrics("ga:searchRefinements");
    query.setSort("-ga:searchRefinements");
    query.setMaxResults(10);
    query.setIds(tableId);
    showStatus("Loading data feed...", false);
    service.getDataFeed(query, new DataFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus(
                    "An error occurred while retrieving the Analytics Data " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(DataFeed result) {
            showData(result.getEntries());
        }
    });
}