I am trying to update a contact entry name to include the prefix, middle 
name, and suffix.  I have tried many different approaches including using 
the ProfileEntry object and copying the example from the API documentation, 
but the changes do not commit.  Here is an example (Java) of a simple test 
I have put together along with the output;

        URL profileUrl = new 
URL("https://www.google.com/m8/feeds/profiles/domain/dev.connexcloud.com/full/test.user12";);
        
        ContactEntry contactEntry = contactsService.getEntry(profileUrl, 
ContactEntry.class);
        
        System.out.println(contactEntry.getName().getNamePrefix() + " " 
                                  + contactEntry.getName().getGivenName() + 
" " 
                                  + 
contactEntry.getName().getAdditionalName() + " " 
                                  + contactEntry.getName().getFamilyName() 
+ " " 
                                  + contactEntry.getName().getNameSuffix() 
+ " "
                                  + contactEntry.getName().getFullName() + 
"\n");
        
        contactEntry.getName().setNamePrefix(new NamePrefix("Mr."));
        contactEntry.getName().getGivenName().setValue("Phillip");
        contactEntry.getName().setAdditionalName(new AdditionalName("J.", 
null));
        contactEntry.getName().getFamilyName().setValue("Fry");
        contactEntry.getName().setNameSuffix(new NameSuffix("Jr."));
        contactEntry.getName().getFullName().setValue("Mr. Phillip J. Fry 
Jr.");
        
        
        System.out.println(contactEntry.getName().getNamePrefix() + " " 
                                    + contactEntry.getName().getGivenName() 
+ " " 
                                    + 
contactEntry.getName().getAdditionalName() + " " 
                                    + 
contactEntry.getName().getFamilyName() + " " 
                                    + 
contactEntry.getName().getNameSuffix() + " "
                                    + contactEntry.getName().getFullName() 
+ "\n");
        

        URL updateUrl = new URL(contactEntry.getEditLink().getHref());
        contactEntry = contactsService.update(updateUrl, contactEntry);

        System.out.println("Updated: " + 
contactEntry.getUpdated().toString() + "  " + 
contactEntry.getEditLink().getHref() + "\n");
      
        System.out.println(contactEntry.getName().getNamePrefix() + " " 
                                + contactEntry.getName().getGivenName() + " 
" 
                                + 
contactEntry.getName().getAdditionalName() + " " 
                                + contactEntry.getName().getFamilyName() + 
" " 
                                + contactEntry.getName().getNameSuffix() + 
" "
                                + contactEntry.getName().getFullName());

Here is the output, notice that the changes are not reflected in the 
returned ContactEntry object;

null {GivenName value=Bob yomi=null} null {FamilyName value=Loblaw 
yomi=null} null {FullName value=Bob Loblaw yomi=null}

{NamePrefix value=Mr.} {GivenName value=Phillip yomi=null} {AdditionalName 
value=J. yomi=null} {FamilyName value=Fry yomi=null} {NameSuffix value=Jr.} 
{FullName value=Mr. Phillip J. Fry Jr. yomi=null}

Updated: 2011-11-30T17:44:14.196Z  
https://www.google.com/m8/feeds/profiles/domain/dev.connexcloud.com/full/test.user12

null {GivenName value=Bob yomi=null} null {FamilyName value=Loblaw 
yomi=null} null {FullName value=Bob Loblaw yomi=null}

Any pointers on what I am doing wrong would be greatly appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to