Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Expand documentation about frameworks

...

Building Plugins with the Connector Framework

The Java connector framework is used within Wookie itself and is therefore considered the reference implementation. Other connector frameworks include PHP, C#, Ruby and Python.

See At the time of writing (Apr 2010) there is a partial implementation of a Java, PHP, C# and Python connector framework see http://svn.apache.org/repos/asf/incubator/wookie/trunk/connector/Image Removed

In order to build a plugin for a Java application you simple need to implement IWookieConnectorService by extending and implementing AbstractWookieConnectorService.

...

for the latest available code.

To use the frmework you will need to do the following:

  • get a WookieConnectorService
  • set the current user
  • get or create a widget instance
  • provide the instance URL to the hosting environment and display it

Using the Java connector frameowrk you would do something like:

Code Block

// Get the wookie service connector
StringBuilder sbUrl = new StringBuilder(request.getScheme());
sbUrl.append("://");
sbUrl.append(request.getServerName());
sbUrl.append(":");
sbUrl.append(request.getServerPort());
sbUrl.append(request.getContextPath());
serverURL = "http://foo.org/wookie";
apiKey = "TEST";
sharedDataKey = "myshareddata";
connectorService = new WookieConnectorService(serverURL, apiKey, sharedDataKey);


// Set the current user
connectorService.setCurrentUser("testuser");


// get or create a widget
instance = connectorService.getOrCreateInstance(guid);


// show widget
showWidget(instance.getUrl());

uilding Plugins without a Connector Framework

We strongly discourage you from building a plugin from scratch without first building a connector framework for your chosen language. By building a connector framework, or even partially implementing one, in your chosen programming language you will be helping others build more plugins as well as being able to share resources with others using the same connector framework.

...