Wookie Meetup

Post on 19-May-2015

2.159 views 0 download

Transcript of Wookie Meetup

Widgets Meetup, London, 13 Oct 2009

Wookies and Widgets

Scott Wilson (University of Bolton)

Scott.bradley.wilson@gmail.com

Twitter: scottbw

Wookie is not a clever acronym

(so if you spell it WOOKIE you’re shouting!)

Apache Wookie (incubating)

• Entered incubator July ‘09

• originally developed in Framework 6 IP– Funded projects tend to build prototypes,

not communities

• http://incubator.apache.org/wookie/

How Wookie Works

• Servlet, runs in Tomcat or Jetty• Provides REST API for applications to

access widgets using a plug-in• Provides JavaScript API objects for

widgets at runtime• Admin UI for installing and managing

W3C Widgets• Server-side storage, and push events

Wookie REST API

• GET /widgets gets the list of widgets installed• POST /widgetinstances instantiates a widget• POST /participants adds a participant to a

widget instance• Lots more at

http://incubator.apache.org/wookie/wookie-rest-api.html

Typical lifecycle

• GET /widgets -> render as a gallery for the user to pick which one to add

• POST /widgetinstances -> create an instance of the widget for the user, returns the URI and widget height/width

• POST /participants -> add user as a participant in the instance

• Create iframe with src, height and width set

Plugins

• LAMS

• Moodle

• Wordpress (needs improving)

• Elgg 1.0 (needs improving)

Widget APIs

<feature name="http://wave.google.com" required="true"/>

• W3C Widget Object (default)• Google Wave Gadget API• Bondi camera API• SCORM CMI API• … anything else!

Shindig integration

• Basic integration, adds Shindig servlet in install

• Wookie generates tokens for shindig opensocial applications

• Wookie handles getPref/setPref using W3C Widget object

• Doesn’t handle Shindig data interface• Needs more work!

Proposed features

• Inter-widget communications (IWC)

• More bondi/DAP APIs

Anatomy of a Widget

• Config.xml <- W3C Widgets P&C Spec

• Icon

• HTML start file

• JavaScript code

• Zip it up, change ext to .wgt, and you’re done

A Silly Example: config.xml

<?xml version="1.0" encoding="utf-8"?><widget xmlns="http://www.w3.org/ns/widgets"

id="http://www.getwookie.org/widgets/tea" version="1.0” height="150” width="125"><name>Tea</name><description>A silly Tea widget</description><icon src="tea.jpg"/><content src="index.htm"/><feature name="http://wave.google.com" required="true"/><author>Scott Wilson</author>

</widget>

A Silly Example: HTML & JS

<html><body onload="document.getElementById(‘name’).innerText=wave.getViewer().getDisplayName()">

<img src="tea.jpg" /> <p style="font-size:9pt">Time for a break, <span id="name">mate</span></p>

</body></html>

Cooler example: webcam<html>

<head><script>

function takePicture(){ var camera = bondi.camera.getCameras()[0]; camera.takePicture(function(x){document.getElementById("picture").src=x;},function(){alert("nope");}); }

</script> </head> <body>

<button onclick="takePicture()">Take Picture</button><img id="picture" src="" width="64" height="64"/>

</body></html>

Future stuff

• Wookie hosting? UK/EU App Store?

• SocialSite integration

• Better Shindig integration

• OpenAjax stuff?

Get involved!

• Send subscribe message to wookie-dev-subscribe@incubator.apache.org

• Submit issue reports, feature requests, patches: http://issues.apache.org/jira/browse/WOOKIE