starting question:
a) did you use fiddler to verify what is send over the wire? I (as not
part of the gmail/apps team) do not know if those backend stores
support extended properties in the first place
b) Case 1 would not work. You can't nest atomentries etc arbitrary
inside. in general above applies: no google backend store is, afaik,
prepared to save arbitrary data inside it's envelope (think about
spamming, size limitations etc, and you easily understand why).
c) Case 2. That should work. The code looks good. Here, go to
fiddlertool, and see if the correct xml is send, and what is returned
d) Case 3. That can not work. CreateExtension only creates extensions
that are registered. So you would have to write an extensionfactory
first (look at the youtube or picasa extensions) to be able to create
this object. That code will all try to create it, not find it, and
hence do nothing....
Frank Mantek
Google
On Nov 25, 2008, at 10:21 PM, FHCIT wrote:
>
> I have tried a few things and have not yet met success.
>
> 1.
> pnickname = new extensioncollection<nicknameelement>(new
> atomentry());
> nicknameelement pnick = new nicknameelement
> ("[EMAIL PROTECTED]");
> pnickname.add(pnick);
>
> messagebox.show("count " + pnickname.count);
> messagebox.show("index " + pnickname.indexof(pnick));
> messagebox.show("is there " + pnickname.contains(pnick));
>
> I cannot figure out how to attach this to an UserEntry to update.
>
> 2.
> ExtendedProperty property = new ExtendedProperty();
> property.Name = "Animal";
> property.Value = "cow";
> gmailUser.ExtensionElements.Add(property);
> gmailUser.Update();
>
> gmailUser = service.RetrieveUser("testuser");
> foreach (object var in gmailUser.ExtensionElements)
> {
> ExtendedProperty p = var as ExtendedProperty;
> if (p != null)
> {
> MessageBox.Show(p.Name);
> }
> }
>
> This code appears to not update the UserEntry with the new
> ExtendedProperty. I assume I am correctly reading the
> ExtendedProperties for a UserEntry.
>
> 3.
> gmailUser.CreateExtension("Pnickname",
> gmailUser.Name.AttributeNamespaces.ToString());
>
> gmailUser.SetExtensionValue("Pnickname",
> gmailUser.Name.AttributeNamespaces.ToString(), "[EMAIL PROTECTED]");
> // tag or namespace inccorrect exception
>
> //gmailUser.ReplaceExtension("Pnickname",
> AppsNameTable.AppsNamespace, xproperites);
> //attempt from looking at google data api sdk
>
> MessageBox.Show("Extended property " +
> gmailUser.FindExtension("Pnickname",
> gmailUser.Name.AttributeNamespaces.ToString()) as String);
> MessageBox.Show("pnickname " + gmailUser.GetExtensionValue
> ("Pnickname", gmailUser.Name.AttributeNamespaces.ToString()));
>
> This code I cannot seem to find the correct namespace I have tried
> ( AppsNameTable.AppsNamespace , gmailUser.Name.ToString(),
> gmailUser.Name.AttributeNamespaces.ToString() ) and a few other
> failures.
>
>
> Can you point me in the right direction. Any code examples would be
> appreciated.
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps 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://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---