Simple Example Gadget
Do the following to create and deploy a gadget:
-
Use any text editor to write your gadget specification.
-
Host the gadget on any web server. See Enable or Reset 3rdpartygadget Account.
-
Add the gadget to the Finesse Container which can run gadgets. See Upload Third-Party Gadgets.
Example Gadget
Use the following lines of code to build a simple gadget. This gadget displays the message "Hello, world!". Copy the following lines of code into a new file named hello_world.xml:
Note the following about the "Hello World" example:
-
Gadgets are specified in XML. The first line is the standard way to start an XML file. This must be the first line in the file.
-
The <Module> tag indicates that this XML file contains a gadget.
-
The <ModulePrefs> tag contains information about the gadget such as its title, description, author, and other optional features.
-
The line <Content type="html"> indicates that the gadget's content type is HTML.
-
<![CDATA[ ...insert HTML here... ]]> is used to enclose HTML when a gadget's content type is html. It tells the gadget parser that the text within the CDATA section should not be treated as XML. The CDATA section typically contains HTML and JavaScript.
-
</Content> signifies the end of the Content section.
-
</Module> signifies the end of the gadget definition.
Note | For a Finesse specific example, download the LearningSampleGadget from https://github.com/CiscoDevNet/finesse-sample-code/tree/master/LearningSampleGadget, which provides step by step instructions in learning some of the objects in the finesse.min.js library. |
Note | Portions of this page are reproduced from work created and shared by Google, see https://developers.google.com/terms/site-policies and used according to terms described in the Creative Commons 3.0 Attribution License, see https://creativecommons.org/licenses/by/3.0/. For more information about OpenSocial gadgets, see https://developers.google.com/gadgets/docs/overview. Note that not all OpenSocial gadget features are available in the Finesse container. |