Putting It All Together
Note
The full code for this sample is available at https://github.com/jcleblanc/programming-social-applications/blob/master/chapter_5/chapter_final.xml.
Now that we understand the importance of the Person
object in an OpenSocial container and the
quantity of information that we can obtain from a user’s friendships, we
can look more closely into these features and fit them neatly together
into an OpenSocial gadget.
To showcase these features, we will create a gadget with the following requirements:
Display profile information for the current viewer, including name, photo, gender, profile URL, and any relevant links associated with the user.
Display a list of the current viewer’s friends.
When the profile image for a viewer’s friend is clicked, that friend’s profile will be displayed in place of the original viewer’s information.
Let’s look at the pieces that will need to be in place to build this gadget.
Get Programming Social Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.