Example usage for com.google.gwt.gdata.client Email REL_HOME

List of usage examples for com.google.gwt.gdata.client Email REL_HOME

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client Email REL_HOME.

Prototype

String REL_HOME

To view the source code for com.google.gwt.gdata.client Email REL_HOME.

Click Source Link

Document

Home email address.

Usage

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

License:Apache License

/**
 * Create a contact by inserting a contact entry into
 * a contacts feed./*from  w w  w  . j ava 2s .c o m*/
 * Set the contact's title and contents to an arbitrary string. Here
 * we prefix the title with 'GWT-Contacts-Client' so that
 * we can identify which contacts were created by this demo.
 * On success and failure, display a status message.
 * 
 * @param contactFeedUri The uri of the contact feed into which to
 * insert the new contact entry
 */
private void createContact(String contactFeedUri) {
    showStatus("Creating contact...", false);
    ContactEntry entry = ContactEntry.newInstance();
    entry.setTitle(Text.newInstance());
    entry.getTitle().setText("GWT-Contacts-Client - Create Contact");
    entry.setContent(Text.newInstance());
    entry.getContent().setText("content info here");
    Email email = Email.newInstance();
    email.setAddress("GWT-Contacts-Client@domain.com");
    email.setPrimary(true);
    email.setRel(Email.REL_HOME);
    entry.setEmailAddresses(new Email[] { email });
    service.insertEntry(contactFeedUri, entry, new ContactEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while creating a contact: " + caught.getMessage(), true);
        }

        public void onSuccess(ContactEntry result) {
            showStatus("Created a contact.", false);
        }
    });
}