You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Taylor Singletary <ts...@linkedin.com> on 2008/02/26 15:55:06 UTC

Format of State File for more complex data

Greetings,

I am trying to customize the state file for the ShinDig Sample Container and
have a few questions on how to properly define more complex data than just a
list of friends with no meaningful data.

Given this:
<container>
  <viewer>
    <person id="john.doe" name="John Doe"></person>
  </viewer>

  <viewerFriends>
     <person id="jane.doe" name="Jane Doe"></person>
     <person id="george.doe" name="George Doe"></person>
  </viewerFriends>

  <personAppData>
    <data person="george.doe" field="count">2</data>
    <data person="jane.doe" field="count">7</data>
  </personAppData>
</container>

How would I best go about defining Address structures for each of these
friends, and then tying those addresses to each member's currentLocation
attribute?

I've tried going through the state.dtd file to find out how data like this
would be structured but I'm at a loss. Also, what is the significance of the
field "count" in this context? Is that just a representation of an arbitrary
field?

Thank you for any help.

Taylor Singletary,
Reality Technician
http://realitytechnicians.com

Re: Format of State File for more complex data

Posted by Taylor Singletary <ts...@linkedin.com>.
Thank you for the info, Cassie. Looking into slicing some time to possibly
add this in. 

Taylor

On 2/26/08 10:51 AM, "Cassie" <do...@apache.org> wrote:

> Hey Taylor -
> 
> The sample container doesn't currently support any of the complex people
> fields... but only because no one has gotten there yet.
> 
> So, feel free to come up with a syntax, modify the xml dtd [1] and make a
> jira issue with a patch. It would be great if you could also modify the
> statefileparser.js [2] file to read and write your new syntax, but if you
> don't get to it, that's fine. :)
> 
> Thanks!
> 
> - Cassie
> 
> [1]
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/javascript/sampleconta
> iner/state.dtd
> [2]
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/features/opensocial-sa
> mplecontainer/statefileparser.js

Re: Format of State File for more complex data

Posted by Cassie <do...@apache.org>.
Hey Taylor -

The sample container doesn't currently support any of the complex people
fields... but only because no one has gotten there yet.

So, feel free to come up with a syntax, modify the xml dtd [1] and make a
jira issue with a patch. It would be great if you could also modify the
statefileparser.js [2] file to read and write your new syntax, but if you
don't get to it, that's fine. :)

Thanks!

- Cassie

[1]
http://svn.apache.org/repos/asf/incubator/shindig/trunk/javascript/samplecontainer/state.dtd
[2]
http://svn.apache.org/repos/asf/incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js

On Tue, Feb 26, 2008 at 6:55 AM, Taylor Singletary <ts...@linkedin.com>
wrote:

>
> Greetings,
>
> I am trying to customize the state file for the ShinDig Sample Container
> and
> have a few questions on how to properly define more complex data than just
> a
> list of friends with no meaningful data.
>
> Given this:
> <container>
>  <viewer>
>    <person id="john.doe" name="John Doe"></person>
>  </viewer>
>
>  <viewerFriends>
>     <person id="jane.doe" name="Jane Doe"></person>
>     <person id="george.doe" name="George Doe"></person>
>  </viewerFriends>
>
>  <personAppData>
>    <data person="george.doe" field="count">2</data>
>    <data person="jane.doe" field="count">7</data>
>  </personAppData>
> </container>
>
> How would I best go about defining Address structures for each of these
> friends, and then tying those addresses to each member's currentLocation
> attribute?
>
> I've tried going through the state.dtd file to find out how data like this
> would be structured but I'm at a loss. Also, what is the significance of
> the
> field "count" in this context? Is that just a representation of an
> arbitrary
> field?


The count field is just arbitrary person app data. So in this case, the app
has stored a count field for each person with values of 2 and 7. If say, you
had another field called favoriteColor you would add this:

<personAppData>
   <data person="george.doe" field="count">2</data>
   <data person="jane.doe" field="count">7</data>
   <data person="jane.doe" field="favoriteColor">red</data>
   <data person="george.doe" field="favoriteColor">purple</data>
 </personAppData>



>
>
> Thank you for any help.
>
> Taylor Singletary,
> Reality Technician
> http://realitytechnicians.com
>