The whole point of the OpenSocial Explorer is to provide sample gadgets for developers to learn how to build OpenSocial gadgets, so adding new gadget specs will be a common operation. All of the gadget specs live in the gadget-specs module and are packaged into a Jar file. Each spec in this module has its own folder containing all the resources for that sample gadget. In addition specs may be grouped into categories by creating sub-directories.
The simplest gadget spec will have at least two files, a gadget XML file and then a file called spec.json. The XML file is the actual gadget XML. The spec.json file is a file we use to identify all the resources for a given gadget spec. The spec.json file must have a JSON object containing the following properties.
Here is a sample spec.json
{
"isDefault" : true,
"gadget" : "gadget.xml",
"htmlFiles" : ["welcome.html"],
"cssFiles" : ["welcome.css"],
"jsFiles" : ["welcome.js"],
"title" : "Welcome"
}
When a new spec is added you need to add a reference to it in specs.txt file, so we know which specs should be loaded.