The OpenSocial gadgets specification includes multiple APIs that make it easy to authenticate users and access data and core functions on participating social networks. We featured an OpenSocial infographic here as part of our two-part shout out to the folks at OSCON.
Platforms that have OpenSocial compliant application containers can run OpenSocial gadgets, sometimes called ‘plug-ins’. Some of the companies that support OpenSocial plugins in their public environments are: Atlassian (known for JIRA, Confluence and other great systems), SAP, IBM, Salesforce.com, SugarCRM, Yahoo!, Google and many more. These platforms run Apache Shindig to create the container that supports OpenSocial gadgets. The evolution of Shindig is Apache Rave. See the end of this post for more on Apache Shindig and Rave.
This sample will demonstrate a sample of a formed XML gadget descriptor and a live-test. Every gadget is made up of an XML descriptor that calls on functions that the Apache Shindig server supports.
Step 1. get the sample.
In this example we give you a sample XML gadget descriptor here: XML Gadget Descriptor. Download and save it if you want to try the test yourself and have a code sample to alter later.
The main function areas of this sample are: module prefs, user prefs, get and display. The entire OpenSocial gadget specification is here. (Updated, now 2.5)
This sample calls and displays a feed of news articles and relies upon the gadgets.io.ContentType.FEED function.
Step 2. decide to host the sample or use our URL.
Either download the XML sample and place it on a publicly accessible URL of your own or use our URL in step 4 of the demo.
Step 3. test the sample live.
Testing your XML Gadget descriptor is important.
Yahoo! has a sandbox for live OpenSocial plug-ins and it only takes a couple of minutes to set-up. Head to https://developer.apps.yahoo.com/projects and sign up for a dev account, don’t worry-it’s free.
Log in and head to “My Projects”, select “New Project”, choose type “YAP” (Yahoo! Application Project), select “Import New XML”.
Either paste in your own URL that points to the XML sample you downloaded in Step 1. or point to our sample URL, select “Import”.
Step 4. Preview the sample.
Select “Preview” to view the sample as a formed gadget. This is how your gadget will look for users.
A couple of notes about testing with the Yahoo! live sandbox, Yahoo requires a category parameter and value in the module preferences. Without the category parameter the descriptor will generate errors. You can remove this parameter after testing if need be.
<Module> <ModulePrefs title="Google Gadget Dev News" title_url="http://groups.google.com/group/Google-Gadgets-API" category="news" scrolling="true"> </ModulePrefs>
Here is an example of this OpenSocial example gadget in the SAP StreamWork application.
You can use OpenSocial to deliver many types of social data to your users quickly and easily as well as authenticate them for interactions with social data. Customizations and functions for the OpenSocial standard are extensive and growing.
Here are a few ways that you can get started:
Become an “OpenSocial container” by using Apache Rave to host social apps.
Contribute to the evolution of the OpenSocial specification or become an OpenSocial Foundation member.
Author Carol Glennon