O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making Data Available to Proxied Data Requests

We talked about the differences between using proxied and inline content within a gadget in Chapter 3 in the section Inline Versus Proxy Content. Depending on the architecture and needs of their application development environment, many developers may prefer the proxied content approach for its ease of use.

If the markup for the Content sections of your gadget is defined with a proxied data source, the way you make container data sources available to that file is very similar to the methods we have used in earlier sections:

<Content type="url" view="canvas" href="http://www.mysite.com/canvas.php">
  <os:PeopleRequest key="ownerFriends" userId="@owner"
                    groupId="@friends" startIndex="10" count="20"
                    fields="name,nickname,gender,birthday" />
</Content>

We define our Content node, with our proxied content being loaded through the file specified in the href attribute. Normally, when using proxied content, we would have a self-closing Content node, but to add the container data we instead embed the data source that we are looking for—in this case, a subset of the application owner’s friends.

Once the proxied content source is fetched, all of the data sources requested will be passed to the file as POSTed JSON objects. If the container cannot also send the opensocial_owner parameter (which contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required