Example usage for com.google.gwt.gdata.client.contacts ContactQuery setStringParam

List of usage examples for com.google.gwt.gdata.client.contacts ContactQuery setStringParam

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.contacts ContactQuery setStringParam.

Prototype

public final native void setStringParam(String name, String value) ;

Source Link

Document

Sets a parameter of the query.

Usage

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

License:Apache License

/**
 * Retrieves a contacts feed for a group 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 contacts feed, the contact
 * entries are displayed to the user via the showData method.
 * A string parameter is used to indicate the ID of the group
 * to query.//from w  w w.  java 2 s.  c o  m
 * 
 * @param contactGroupId The id of the group for which to retrieve
 * the contacts
 */
private void queryContacts(String contactGroupId) {
    showStatus("Loading contacts feed...", false);
    ContactQuery query = ContactQuery.newInstance("http://www.google.com/m8/feeds/contacts/default/full");
    query.setStringParam("group", contactGroupId);
    service.getContactFeed(query, new ContactFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the Contacts feed: " + caught.getMessage(), true);
        }

        public void onSuccess(ContactFeed result) {
            ContactEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("The contact group has no member contacts.", false);
            } else {
                showData(entries);
            }
        }
    });
}