OpenSocial Container Sample - Getting started

Purpose

This sample serves two primary purposes:
  1. To demonstrate how a container can be implemented using a simple example.
  2. To create an environment for easy gadget testing. OpenSocial is all about social APIs, which means that gadget testing usually involves multiple user accounts. This container makes testing easy by letting gadgets specify arbitrary state for any number of users.

How it works? (Theory)

As the gadget developer you need to specify two pieces of information:
  1. URL to the gadget definition; and
  2. initial state of the container in the form of a URL to a state file.
You can find the DTD for the state definition in the docs/state.dtd folder. The state definition file allows you to specify the viewer of the gadget, the owner, the friends and the activities of those users. Once the gadget and its state are loaded you can use the gadget in the same way as any other container. At any point you can also dump a snap shot of the state of the environment to an XML file (with the same format as the state definition file).

Tips/caveats