Putting It All Together

Note

The full code for the samples in this section is available at https://github.com/jcleblanc/programming-social-applications/blob/master/chapter_3/chapter_final.xml.

In this chapter, we have examined several core concepts surrounding OpenSocial application gadgets, including:

  • Building an environment to host OpenSocial gadgets

  • Expanding on that environment by applying a full social network on top of the gadget host

  • Having multiple gadget views, working with subviews, passing data between views, and building error states into the views

  • Comparing inline and proxied content within an OpenSocial gadget

Using the lessons we’ve learned from the previous sections, we will now build a base-level gadget with the features usually implemented within an application and allowed by a container. We will implement a ModulePrefs node to define the gadget’s metadata, as well as some locality and link-based information, and then include a number of Content sections to define the application’s content. We will create a Content section that displays only the canvas view content; define a second Content section that will act as a standard footer for the gadget in the canvas, home, and profile views; and then define a final Content section to display an error fallback view should there be a problem with any of our content:

<?xml version="1.0" encoding="utf-8"?> <Module> <ModulePrefs title="Chapter 3 rollup example" title_url="http://www.jcleblanc.com" description="Displays the concepts ...

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.