As well as serving W3C Widgets, Wookie can also be used to share OpenSocial gadgets by integrating with http://shindig.apache.org/. There are currently some limitations on this approach - for example, while Wookie quite happily handles preferences for OpenSocial gadgets, it doesn't handle the various services like friends lists that a full Shindig implementation supports, and you'd still need to integrate those yourself using Shindig's API. However you may still find it useful to deploy Wookie and Shindig in this manner.

How to setup Wookie with Shindig

To deploy Wookie with Shindig, you need to deploy the Shindig.war on your server alongside Wookie.

You can either place the Shindig webapp as ROOT or at another webapp location. If deploying elsewhere, note you must change all the URLs in WEB-INF/classes/containers/default.container.js, and also in shindig.properties, which can be found inside the shindig-common-1.1. jar file.

Wookie setup

Once deployed, you need to setup Wookie as follows:

In [WOOKIE]/WEB-INF/classes/widgetserver.properties, set widget.metadata.url to point to the Shindig metadata service (if you've set up Shindig at Root, this is already set)

In [WOOKIE]/WEB-INF/classes/opensocial.properties, set opensocial.enable to true to start sending Shindig security tokens with rendered widgets/gadgets.

Shindig/Wookie features

You can use Wookie to manage the preferences of your Gadgets; to do this you must replace the standard Shindig Features jar with one with some additional Wookie javascript code and make an adjustment to the web.xml for Wookie to allow calls between the two applications.

The files in the folders "/features/core.prefs" replace the Shindig preference handling
stubs with an interface to the Widget.preferences HTML 5 object implemented in Wookie.

In core.prefs:

  • prefs.js has been altered to make the W3C Widget calls
  • features.xml includes links to the wookie core JS injected code.

Note that these are absolute URLs are should be replaced with URLs to your own Wookie server

Edit the URLs in features.xml, and then replace or merge these files with the standard Shindig features files to add W3C widget persistence. A ready-built shindig-features jar is located in the http://svn.apache.org/viewvc/incubator/wookie/trunk/shindig/dist/ folder which you can use as the basis for your own shindig-features.jar file.

To enable this functionality to work it is currently necessary to turn off cross-site session security for DWR, or you will get a "Session Error" whenever using Gadgets with Wookie as the two webapps do not share sessions.

To do this, add the following parameter in web.xml for the dwr-invoker serlvet:

<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>

(You can also avoid this problem by merging the Wookie and Shindig applications into a single webapp, combining the web.xml files into one.)

Proxy configuration

Note that both Wookie and Shindig come with proxy implementations. You can use either or both of these. The setting for W3C widgets can be found in [WOOKIE]/WEB-INF/classes/widgetserver.properties. The setting for Google Gadgets/OpenSocial Apps can be found in [SHINDIG]/WEB-INF/classes/containers/default.container.js. In each case you can set the proxy URL to either:

[WOOKIE]/proxy
[SHINDIG]/gadgets/proxy

  • No labels