Lesson 01: A simple HelloWorld
|Back to overview||Lesson 02: Meta data and how it's used|
At their core, social gadgets are XML files, sometimes known as gadget specifications. Here is a simple "Hello World" gadget (helloworld.xml), that illustrates the basic sections of a specification:
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello World!"> <Require feature="opensocial-0.8" /> </ModulePrefs> <Content type="html"> <![CDATA[ Hello, world! ]]> </Content> </Module>
In the "Hello World" example, you can see several sections which control the features and design of the gadget.
<Module>indicates that this XML file contains a gadget.
<ModulePrefs>contains information about the gadget, and its author.
<Require feature="opensocial-0.8" />denotes a required feature of the gadget — in this case, the OpenSocial API (v0.8).
<Content type="html">indicates that the gadget's content type is HTML. This is the recommended content type for OpenSocial containers, but gadgets for other containers such as iGoogle support other content types.
bodytag on a generic HTML page.
Uploading the gadget to the VZ Gadget Sandbox
The Gadget Sandbox is available at studiVZ and meinVZ only. At first you have to upgrade your VZ account to a developer account at our developer portal (http://www.meinvz.net/Developer or http://www.studivz.net/Developer). After a short review of your submission by our Developer Support, you will recieve a confirmation E-Mail that your account has been upgraded.
Now you can create an Gadget and Upload your Hello World Gadget as a new Gadget Revision. You can find more information on our Sandbox at Sandbox_Overview.