Excellent question. I am facing just the same problem: as I see, the
OWNER would customize my app (that is, save options to *his*
PersonAppData) and whomever sees the gadget on the OWNER's profile
should see it as configured by the OWNER.

But the lack of the ability of passing OWNER to
newUpdatePersonAppDataRequest simply makes that impossible. I also
tried to "cheat" (getting the OWNER's ID and passing), and even tried
to improvise with "instance" appdata - of which I am not entirely sure
of the precise scope, maybe I missed something on the docs.

And what puzzles me more is the dubious language in
http://code.google.com/apis/opensocial/docs/javascript/reference/opensocial.DataRequest.html#newUpdatePersonAppDataRequest
:

  "String id  - The ID of the person to update; only the special
VIEWER ID is currently allowed."

What does "currently" mean? That the final version will have other
possibilities? Is it an OpenSocial limitation, or just of Orkut's
implementation?

:-(

On 7 nov, 12:59, Clayton Scott <[EMAIL PROTECTED]> wrote:
> I get failure when persisting data with "OWNER" which is documented in
> the open social documentation for it.
> Since you can't store AppData asOWNERyou will never be able to
> retrieve as anOWNER
>
> How am I supposed to persist my per use configuration? I'm not doing
> it on my server, no without the
> serverside APIs and authentication.
>
> Clayton
>
> On Nov 6, 10:02 pm, Mike <[EMAIL PROTECTED]> wrote:
>
> > Have you been able to get this working? I am able to make the
> > newFetchPersonAppDataRequest request using "VIEWER" but it always
> > fails in the callback when using "OWNER" with null returned for
>
> > varowner= data.get("owner").getData();
>
> > ???
>
> > On Nov 6, 9:55 am, Clayton Scott <[EMAIL PROTECTED]> wrote:
>
> > > Am I handling the response object correctly? Does this work in the
> > > Orkut sandbox?
>
> > > In my gadget I have a required UserPref whose value is used when
> > > rendering the profile view. My issue is that when I view a friends
> > > profile, _my_ preference is used instead
> > > of
> > > When browsing as a VISITOR, I need the
> > > OWNERs pref so that I can render the data from the right point of
> > > view.
>
> > > The pref is not set via the API it is set via the "edit settings"
> > > feature in
> > > Orkut.
>
> > > When I try to fetch the userpref data, there are no keys in that sub-
> > > response
> > > object, just the top level key in main response.
>
> > > Sample code:
>
> > > My user pref is called tweb_uid.
>
> > > <UserPref name='tweb_uid' display_name='Your Id' datatype='string'
> > > required='true' />
>
> > > Here is my javascript for accessing it:
>
> > > <script>
> > > function getOwnerData() {
> > >   var req = opensocial.newDataRequest();
> > >   req.add(req.newFetchPersonRequest("OWNER"), "owner");
> > >   req.add(req.newFetchPersonAppDataRequest("OWNER", "tweb_uid"),
> > > "owner_data");
> > >   req.send(handleResponse);
>
> > > }
>
> > > function handleResponse(data) {
> > >   varowner     = data.get("owner").getData();
> > >   var owner_data = data.get("owner_data")
> > >   if (owner_data.hadError()) {
> > >     //Handle error using owner_data.getError()...
> > >     alert( "Error: " + owner_data.getError);
> > >     return;
> > >   }
>
> > >   var owner_data1 = owner_data.getData()[owner.getId()];
>
> > >   alert( "ID: " + owner_data1["tweb_uid"] );
>
> > > }
>
> > > document.body.onload =  getOwnerData();
>
> > > </script>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Developers" group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to