Adding New Gadgets to Openspace
You can add new gadgets to Openspace. You can do this in one of three ways. You can import an arbitrary web page and use it as a gadget in Openspace, import a gadget spec (in other words, a URL that ends with a filename with a .xml extension), import a gadget spec from a web site where no file .xml is specified (this relies on the web pages’ default document being a gadget spec).
To do this, you must specify the URL of the web page you want to add. The URL must point to an OpenSocial gadget that complies with OpenSocial Specification V0.8/V0.9. An OpenSocial gadget is hosted in a server infrastructure to provide its data.
OpenSocial gadgets are part of the OpenSocial initiative. OpenSocial gadgets are web based UI components. A gadget is defined via an XML file which contains a header with definitions of the gadget and an embedded content payload. This payload is a combination of HTML and JavaScript which defines the gadget’s look and behavior.
A very simple gadget looks like this:
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello OpenSocial Gadgets!"> <Require feature="opensocial-0.8" /> </ModulePrefs> <Content type="html"> <![CDATA[ Hello, OpenSocial Gadgets! </Content> </Module>
A gadget always has the root tag <Module>. This root tag contains a <ModulePrefs> and a <Content> section. The <ModulePrefs> contains information about which OpenSocial features are required by the module and information about the author. The content section contains the actual HTML and JavaScript.
When adding a gadget to Openspace, note the following:
- When specifying a thumbnail or screenshot URL in
<ModulePrefs>:
- If you do not specify a thumbnail or screenshot URL that is a publicly accessible URL, the gadget is displayed in Openspace as shown below:
- If you do not specify any thumbnail or screenshot URL, then Openspace uses its default thumbnail or screenshot and the gadget is displayed in Openspace as shown below:
- If you do not specify a description in <ModulePrefs>, Openspace defaults to Contributed Gadget[n] where n is an incremental number for each gadget you add that has no description.
For more information:
- On the OpenSocial Initiative, see http://opensocial.org.
- On the OpenSocial Gadgets API Specification, see http://opensocial.org.