On 09/03/2012 09:21, Ross Gardler wrote:
On 8 March 2012 23:15, Richard Kettelerij<[email protected]>  wrote:
Hi list,

I'm working with Rave for a few months now and was thinking about the following 
new feature: ability to uploading widgets to the portal. Currently widgets can 
only be added by URL. This raises the question, where do you host your widgets? 
One can think of various solutions but having a simple upload function 
available might come in handy.

Some thoughts:
- W3C widget can be uploaded as .wgt file
- OpenSocial widget can be uploaded as plain XML file, or as a zip file in case 
additional resources (CSS, JS) are required.
- Rave contains a controller/servlet to serve the widget files, optionally 
allow placeholder replacements.
- Rave treats uploaded widgets like any other widget, meaning a reference (e.g. 
http://localhost:8080/widget-repo/mywidget.xml) to the uploaded widget is 
stored in the widget database table.

What do you think?
Getting W3C widgets into Wookie (which provides the W3C widget engine
for Rave) is already supported API (see
http://incubator.apache.org/wookie/docs/api.html). However, this does
not automatically put the widget into the Rave widget store. Either
Rave needs to provide an API to allow this and pass it through to
Wookie or Rave can be configured to query the Wookie server and put
all widgets it finds into the the store (I'm assuming it doesn't do
this at present, it didn't do last time I looked - some time ago).

Although wookie is now bundled with rave, the widgets that are found in a default install of wookie do not appear in raves store. (and there is no way of adding them unless you tweak the database) As an *interim* I created this patch (https://reviews.apache.org/r/4103/) which uses the wookies advert service to allow a user to import widgets from wookie to rave using the "add widget" page. This was meant as a short term fix for rave & wookie 0.9.2. For this fix, the workflow is still to upload new widgets using wookie directly, then in rave you can add the widget to the store. This workflow is obviously different to how rave+shindig import widgets. To achieve a similar workflow with rave+wookie meant that there would have to be some new wiring put in place within wookies REST api. (which 0.9.2 did not yet have)

My idea was to update the wookie REST api for 0.10.0 so that POSTing a widget (*.wgt) file allows the metadata (config.xml) to be sent back as response. (See https://issues.apache.org/jira/browse/WOOKIE-324) This would mean that the workflow of importing a w3c widget into rave could be made a little more similar to how adding a gadget works.

(I'd then rewrite the import/add w3c widget patch for rave & submit it back when wookie-0.10.0 is released.)

Paul

Rave already hosts W3C Widgets via the embedded Wookie server. But I'm
not sure how complete the integration is at this point so there is
likely still some work to do.

Ross

Reply via email to