Example usage for com.google.gwt.gdata.client.sidewiki SidewikiEntryQuery setMaxResults

List of usage examples for com.google.gwt.gdata.client.sidewiki SidewikiEntryQuery setMaxResults

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.sidewiki SidewikiEntryQuery 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.SidewikiQueryEntriesByAuthorDemo.java

License:Apache License

/**
 * Retrieves a Sidewiki entry feed using a Query object.
 * In GData, feed URIs can contain query string parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the entries feed, we obtain the
 * first author of the first entry and query for Sidewiki entries
 * by that author.//from  ww  w .j a v  a2s  . com
 * 
 * @param entriesFeedUri The items feed uri.
 */
private void queryEntries(String entriesFeedUri) {
    showStatus("Loading entries feed...", false);
    SidewikiEntryQuery query = SidewikiEntryQuery.newInstance(entriesFeedUri);
    query.setMaxResults(25);
    service.getSidewikiEntryFeed(query, new SidewikiEntryFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the entries feed: " + caught.getMessage(), true);
        }

        public void onSuccess(SidewikiEntryFeed result) {
            SidewikiEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("No entries matched the search criteria.", false);
            } else {
                SidewikiAuthor author = (SidewikiAuthor) entries[0].getAuthors()[0];
                queryEntriesByAuthor(author.getResourceId().getValue());
            }
        }
    });
}

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

License:Apache License

/**
 * Retrieves a Sidewiki entry feed using a Query object.
 * In GData, feed URIs can contain query string parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the entries feed, the entries 
 * are displayed to the user via the showData method.
 * /*  w ww. j  av  a  2  s . co m*/
 * @param entriesFeedUri The items feed uri.
 */
private void queryEntriesByAuthor(String authorId) {
    showStatus("Querying entries by author...", false);
    String feedUri = "http://www.google.com/sidewiki/feeds/entries/author/" + authorId + "/full";
    SidewikiEntryQuery query = SidewikiEntryQuery.newInstance(feedUri);
    query.setMaxResults(25);
    service.getSidewikiEntryFeed(query, new SidewikiEntryFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the entries feed: " + caught.getMessage(), true);
        }

        public void onSuccess(SidewikiEntryFeed result) {
            SidewikiEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("No entries matched the search criteria.", false);
            } else {
                showData(entries);
            }
        }
    });
}

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

License:Apache License

/**
 * Retrieves a Sidewiki entry feed using a Query object.
 * In GData, feed URIs can contain query string parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the entries feed, the entries 
 * are displayed to the user via the showData method.
 * /*from  w ww .  j a v  a2  s  .c  om*/
 * @param entriesFeedUri The items feed uri.
 */
private void queryEntries(String entriesFeedUri) {
    showStatus("Loading entries feed...", false);
    SidewikiEntryQuery query = SidewikiEntryQuery.newInstance(entriesFeedUri);
    query.setMaxResults(25);
    service.getSidewikiEntryFeed(query, new SidewikiEntryFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the entries feed: " + caught.getMessage(), true);
        }

        public void onSuccess(SidewikiEntryFeed result) {
            SidewikiEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("No entries matched the search criteria.", false);
            } else {
                showData(entries);
            }
        }
    });
}

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

License:Apache License

/**
 * Retrieves a Sidewiki entry feed using a Query object.
 * In GData, feed URIs can contain query string parameters. The
 * GData query objects aid in building parameterized feed URIs.
 * Upon successfully receiving the entries feed, the entries 
 * are displayed to the user via the showData method.
 * /*from w w w.  j a  va  2 s.c  o m*/
 * @param entriesFeedUri The items feed uri.
 */
private void queryEntries(String entriesFeedUri) {
    showStatus("Loading entries feed...", false);
    SidewikiEntryQuery query = SidewikiEntryQuery.newInstance(entriesFeedUri);
    query.setMaxResults(25);
    service.getSidewikiEntryFeed(query, new SidewikiEntryFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the entries feed: " + caught.getMessage(), true);
        }

        public void onSuccess(SidewikiEntryFeed result) {
            SidewikiEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("You have no Sidewiki entries.", false);
            } else {
                showData(entries);
            }
        }
    });
}