Social Widget/Gadget APIs of interest

Hi everyone,

Following the discussion on the call earlier, here are some JavaScript  
APIs of interest for social applications, implemented by Apache  
projects:

Google Wave Gadget API [1] (GWG)
OpenSocial API [2] (OSAPI). (Version 1.0 is considerably clearer and  
simpler than earlier versions, as you can see by comparison with the  
legacy API in Appendix A)

Apache Shindig [3] implements OSAPI (currently v0.9).
Apache Wookie (Incubating) [4] implements GWG.

Shindig and Wookie implement JS APIs in roughly the same fashion: the  
server has a set of supported features that can be added in a modular  
fashion and configured by the server admin. Widgets/Gadgets are  
developed with feature request elements (in gadgets this is <require  
feature="somestring" version="1.0"/> in the gadget xml content, in  
widgets this is <feature name="some iri" [required="true"]/> in  
config.xml). This typically results in JavaScript libraries being  
configured and delivered with the widget at runtime (Shindig injects  
them inline with the gadget content, Wookie adds <script src> tags  
into the HTML <head>).

W3C Widgets, as implemented by Wookie, are widget packages installed  
configured by the Wookie server admin and processed to add injected  
APIs and an authz token for use with a particular container;  
OpenSocial gadgets are web services that are processed online by  
Shindig to inject APIs and authz token for use within a particular  
container.

(By "container" I mean the site where the widget/gadget appears. For  
Shindig this means Orkut, Hi5, etc., for Wookie it means Elgg,  
Wordpress, etc.)

Some key features worth considering for standardisation work:

1. People information
=================

- get viewer (OSAPI, GWG): information about the current user of the  
widget/gadget/app
- get owner (OSAPI): information about the user who owns the context  
the widget/gadget/app appears in (e.g. profile page owner)
- get host (GWG): information about the user who is hosting the wave  
(i.e. the context initiator)
- get viewer friends (OSAPI): information about the friends of the  
current user
- get owner friends (OSAPI): information about the friends of the  
context owner
- participants (GWG): information about participants in the current  
context (wave)
- participant callback (GWG): event triggered when participants are  
added/removed from current context

This clearly relates to W3 DAP contacts API, PortableContacts, FOAF etc.

People information in GWG is limited to: id, display_name, thumbnail_url
People information in OSAPI is quite extensive, but only a few items  
(id, display_name) are mandatory (or reliable for gadget authors)

(In the context of widgets/gadgets, these APIs are really simple as  
all the policy/privacy aspects are handled by the container/context  
rather than in the widget/gadget code itself; e.g. as a gadget author  
you just work with what data you're given.)

((As I mentioned on the call: from Wookie's perspective we don't  
really care what the id is, as long as its reasonably consistent for  
getting the same widget info. It doesn't have to have any meaning  
outside the context of a single container or relate to a real identity))

2. Storage
========

- get app data (OSAPI): get information saved for the gadget  
(key:value pairs)
- update app data (OSAPI): update gadget data (key:value pairs)
- delete app data (OSAPI): delete gadget data (keys)
- state get (GWG): get information shared by all users of the gadget  
(key:value pairs)
- state submit delta (GWG): update shared information (key:value pairs)
- state reset (GWG): clear all shared data
- state callback (GWG): event triggered when state data is altered

There is some relationship here with Widgets: The Widget Interface [5]  
"Preferences" methods, and from there to the HTML 5 Storage interface.

(GWG's state model is great for real-time or near-real-time  
collaboration; appdata is a more traditional asynchronous persistence  
mechanism)

3. Other areas:
===========
- activities/updates
- media items/albums: clearly some relation to DAP and BONDI media  
gallery features
- groups

[1] http://code.google.com/apis/wave/extensions/gadgets/reference.html
[2] http://opensocial-resources.googlecode.com/svn/spec/draft/Social-Gadget.xml
[3] http://shindig.apache.org/
[4] http://incubator.apache.org/wookie/
[5] http://www.w3.org/TR/widgets-apis/

Received on Wednesday, 10 March 2010 19:31:44 UTC