Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Discussions > OpenSocial Application Development > Global vs. Instance vs. Person App Data
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zach  
View profile  
 More options Nov 10 2007, 9:12 pm
From: Zach <zcox...@gmail.com>
Date: Sun, 11 Nov 2007 02:12:00 -0000
Subject: Global vs. Instance vs. Person App Data
I'm sure I'm just not looking in the right place, but I can't seem to
find any description of what the differences between the Global,
Instance, and Person versions of Persistent data are.  Can anyone
explain what each one is?

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin.Jorge@gmail.com  
View profile  
(2 users)  More options Nov 13 2007, 12:42 pm
From: "Dustin.Jo...@gmail.com" <Dustin.Jo...@gmail.com>
Date: Tue, 13 Nov 2007 09:42:16 -0800
Local: Tues, Nov 13 2007 12:42 pm
Subject: Re: Global vs. Instance vs. Person App Data
Imagine you created a game app and would like to store data for it.

Global Data: This data is available on a large scale, that is, it is
available to your application regardless of where it is placed. For
instance, if Jane and Jill both place your game application on their
profile, the global data set and retrieved will be exactly the same
for both Jane and Jill's copy of the game. This could be useful for
storing something like High Scores.

Instance Data: This data is available only to the specific copy
(instance) of the game (app). So if Jane and Jill both place your game
on their profile, the game will be able to store unique data. In this
case, Jane's game cannot access Jill's game's unique data storage
(instance Data) and likewise. An example use for this may be if a game
requires the 'state' of the game to be saved or you would like to keep
High Scores separated for each instance.

Person App Data: relates to a data store for an individual with
relation to the app on a global scale. Meaning that both Jill and
Jane's copy of the game will be able to access the same data for a
Person, but other applications will not have access to your
application's data for that person. The key here is that you're
storing data under a person with relation to an app. So if you try to
access that data for the same person from a different app, it won't
exist. An example use would be 'High Scores for Jill' (or jane), or
allowing users to save their game.

On Nov 10, 6:12 pm, Zach <zcox...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach  
View profile  
 More options Nov 13 2007, 1:21 pm
From: Zach <zcox...@gmail.com>
Date: Tue, 13 Nov 2007 18:21:51 -0000
Local: Tues, Nov 13 2007 1:21 pm
Subject: Re: Global vs. Instance vs. Person App Data
Dustin - thank you for the incredibly useful reply!  I now understand
the differences and this should help those in the future confused by
the same things.

On Nov 13, 12:42 pm, "Dustin.Jo...@gmail.com" <Dustin.Jo...@gmail.com>
wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aaron.chapin@gmail.com  
View profile  
 More options Nov 14 2007, 2:23 pm
From: "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
Date: Wed, 14 Nov 2007 19:23:54 -0000
Local: Wed, Nov 14 2007 2:23 pm
Subject: Re: Global vs. Instance vs. Person App Data
What I'd like to know, though, is want the access restrictions are on
personal and instance data. In the example of the game app. Would Jill
and Jane be able to see each other's high scores (assuming that they
were friends,) if it was personal, or would that data have to be
global?

Another thing I noticed is that although there are methods in
opensocial.DataRequest to update the instance and personal app data,
but there isn't one for global. Is it to be assumed that this feature
is going to be added?


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin Jorge  
View profile  
 More options Nov 14 2007, 2:37 pm
From: Dustin Jorge <dustin.jo...@gmail.com>
Date: Wed, 14 Nov 2007 11:37:54 -0800
Local: Wed, Nov 14 2007 2:37 pm
Subject: Re: [OpenSocial] Re: Global vs. Instance vs. Person App Data
I'm not the person to answer, but I also noticed the lack of update
global app data. I'm curious as well.

I think for your first question, you can do that by retrieving person
app data for OWNER_FRIENDS, so assuming you stored the high score jane,
and jill and jane are friends, jill should be able to grab jane's high
score. Correct me if I'm wrong.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aaron.chapin@gmail.com  
View profile  
 More options Nov 15 2007, 10:34 am
From: "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
Date: Thu, 15 Nov 2007 07:34:13 -0800 (PST)
Local: Thurs, Nov 15 2007 10:34 am
Subject: Re: Global vs. Instance vs. Person App Data
From my testing, I've found that you are correct. You can access
person app data, if they are friends.

I am having a bit of difficulty actually parsing it, though. In my
handler, I get the specific key data (using data = response.get(key)),
and then get the data object (using theobject = data.getData()), but I
can't figure out how to actually get the string value that is stored
in theobject. I've looked through the docs, and just a normal search,
but I couldn't seem to find it. I know that it's returning the correct
data, because I've been checking the responses with Firebug, but still
no dice on actually using it. Any help would be appreciated. Thanks.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aaron.chapin@gmail.com  
View profile  
 More options Nov 15 2007, 11:18 am
From: "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
Date: Thu, 15 Nov 2007 08:18:36 -0800 (PST)
Local: Thurs, Nov 15 2007 11:18 am
Subject: Re: Global vs. Instance vs. Person App Data
In testing, I verified that friends can indeed see each other's person
app data, so that's good. It would've been a little crazy having to
use global app data for everyone, I'm glad that provision was in
there.

I am having a bit of an issue with using the returned data, though. I
can verify using firebug that it's coming through, and that it's
correct, but I can't seem to figure out how to display it on the page.
In my handler function, I get the response item from the response data
(using data = response.get(key)), and pull the object out of the
response data (using theobject = data.getData()), but I can't get the
actual string value of theobject to display. If anyone could give me
some advice, I'd appreciate it.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aaron.chapin@gmail.com  
View profile  
 More options Nov 15 2007, 11:59 am
From: "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
Date: Thu, 15 Nov 2007 08:59:38 -0800 (PST)
Local: Thurs, Nov 15 2007 11:59 am
Subject: Re: Global vs. Instance vs. Person App Data
Sorry for the double post, it looked like the first one hadn't gone
through, so I re-posted.

On Nov 15, 11:18 am, "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin Jorge  
View profile  
 More options Nov 15 2007, 1:01 pm
From: Dustin Jorge <dustin.jo...@gmail.com>
Date: Thu, 15 Nov 2007 10:01:34 -0800
Local: Thurs, Nov 15 2007 1:01 pm
Subject: Re: [OpenSocial] Re: Global vs. Instance vs. Person App Data
Well, I'm not sure this is the best way, but this is how I've been doing
it since I haven't figured out how to iterate through the maps.

The data comes back as a map object per the spec (for
newFetchPersonAppDataRequest) "When processed, returns a Map<PersonId
<http://code.google.com/apis/opensocial/docs/javascript/reference/open...>>,
Map<String, String>> object."
So in your example you should be able to access the data by using
data[personID]["dataKeyName"]. Like I said I haven't figured out how to
iterate through these, so in order to grab the data for say
"OWNER_FRIENDS" I first make sure I have a list of owner friends ( from
newFetchPeopleRequest ) and then iterate through them and check to see
if a corresponding value exists in my appdata object. So I would do
something like this:

ownerFriends = ( get a list of friends using newFetchPeopleRequest then
get("key").getData() )
data = ( as you described below, a returned object from
newFetchPersonAppDataRequest )

ownerFriends.each( function(aPerson){ // note that each is a function of
collection which is returned by newFetchPeopleRequest
    if( data[aPerson.getId()] != null ) {
             // do something with data... can be accessed using
data[aPerson.getId()]["dataKey"]
    }

});

This works for me for now, but I'd be in anyone's debt who could explain
map iteration.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aaron.chapin@gmail.com  
View profile  
 More options Nov 15 2007, 1:42 pm
From: "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
Date: Thu, 15 Nov 2007 10:42:43 -0800 (PST)
Local: Thurs, Nov 15 2007 1:42 pm
Subject: Re: Global vs. Instance vs. Person App Data
That absolutely did the trick, thanks! I kept looking for a method,
instead of just using the index. D'oh.

From what I know of maps (which isn't a ton), since you can't just
iterate through them without a list of the keys, since the map itself
doesn't store anything other than the key-value pairings. They seem to
be very similar to Python's dictionaries (which I've worked a bit more
with), which leads me to beleive that there is a method that would
return the list of keys in the map. I've tried some of the obvious
possibilities (getKeys, keys, keyList, listKeys, etc), but no dice so
far.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin.Jorge@gmail.com  
View profile  
 More options Nov 15 2007, 2:45 pm
From: "Dustin.Jo...@gmail.com" <Dustin.Jo...@gmail.com>
Date: Thu, 15 Nov 2007 11:45:56 -0800 (PST)
Local: Thurs, Nov 15 2007 2:45 pm
Subject: Re: Global vs. Instance vs. Person App Data
Just for clarity I wanted to specify that in my example above, data is
an object returned by newFetchPersonAppDataRequest then
get("key").getData() rather than just get("key")... So

var data;
function handleRet(ret){
  data = ret.get("key").getData() == null ? {} :
ret.get("key").getData();

}

On Nov 15, 10:42 am, "aaron.cha...@gmail.com" <aaron.cha...@gmail.com>
wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google