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

The OpenSocial Gadget XML Specification

While Shindig and Partuza are tools for building an OpenSocial container, the gadget XML specification is a tool for building application gadgets to run within a container. This XML specification file contains a series of configuration settings and data that allows the container to load the application content and information.

A gadget XML file contains a few main nodes (or elements). The root Module node contains three child nodes, ModulePrefs, UserPref, and a series of Content nodes. ModulePrefsk defines the characteristics (metadata) about the application, UserPref allows gadgets to define user-specific data, and the Content nodes contain the code for the gadget views.

This is the standard format of a gadget XML file:

<?xml version="1.0" encoding="utf-8"?>
<Module>
    <ModulePrefs ... />
    <UserPref ... />
    <Content ...>
        Gadget Content
    </Content>
</Module>

In the sections that follow, we’ll explore the content of each node and the possible configurations for building out a gadget.

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