The Apache Rave development team is striving to build rave-portal as a widget-agnostic mash-up engine. This means that a new widget provider can be added to Apache Rave with a few simple steps.
1) Get Apache Rave¶
There are multiple ways to build your custom Apache Rave instance, but the simplest is to use a Maven WAR overlay. See Extending Rave for an example overlay.
2) Define a custom web application context¶
See Adding a custom Application Context
3) Add a widget renderer¶
Add an implementation of org.apache.rave.portal.web.renderer.RegionWidgetRenderer to your custom application context. This renderer will get called during the page render process at the point in the page where the HTML markup for the widget is to be output. If your provider needs to add a script block to the render process, you can autowire in a reference to the ScriptManager.
4) Add a widget provider js file¶
If your widget provider has any javascript that needs to be executed to initialize the widget, you can define a widget provider javascript object. The javascript widget provider must have a TYPE property and an initWidget function as documented in rave.js's registerProvider function.
The easiest way to add a new widget provider javascript file is to create a separate include file in src/main/webapp/script and add a bean with a dependency on the ScriptManager that registers the Global script block. If you are overriding any of the JSPs or adding your own front end, you can obviously add the script include at any point on the page after rave.js.