Portal Pack IPC Story Board - Tutorial
The Sun Java System Portal Server 7.x (Now Open Portal)/Open Portal Portlet Container enables portlets to communicate with each other through custom portlet eventing. The new Portal Pack 1.3 Beta for NetBeans 5.5/5.5.1 has a new feature IPC Story Board. Interportlet Communication Story Board(aka "IPC Story Board") provides a visual way of wiring(linking) portlets to listen each other's events. Then these portlet applications can be deployed and tested on Open Portal/Sun Java System Portal Server 7.x which are supported by the Portal Pack.
This blog is intended to help portlet developers to get acquainted with the new IPC Story Board feature in the Portal Pack.
Fig: 1
Before using IPC Story Board, you need to select the target run time for the project as Sun Java System Portal Server 7.x or Open Portal Portlet Container.
Click Window > IPC StoryBoard menu item in the NetBeans IDE to open IPC StoryBoard in NetBeans IDE.
In Project Explorer View, portlet.xml node can be expanded to see all the portlets defined in the portlet.xml. The portlets node shown
under portlet.xml can be dragged and dropped to the IPC Story Board. You can drag portlets from multiple projects to the Story Board. Once a portlet is dragged to the IPC Story Board the corresponding portlet is shown as in Fig : 1.
Fig : 3
User can right click on a Portlet Node in the Story Board and select "Add Event" to add a new event to the portlet. The sun-portlet.xml is also automatically updated for the new event. By default the new event is added with some predefined name. You can double click on the newly added event element and rename it.To remove a portlet node from the story board, select "Remove Portlet From StoryBoard"
Fig : 4
Right click on a event element and select "Generate Source" to generate eventing code in the corresponding portlet java file. User has an option to create a new method for the event or to add the generate event code snippet to an existing method.The dialog box shown in the Fig: 6 is shown to the user for more information regarding code generation.
Fig : 5
Fig: 6
The event generation code looks like the following code snippet in Fig : 7
Fig : 7
Drag an event generated by a portlet and put it on an another portlet to make that event consume by the second portlet. The association between two portlets is shown by an arrow. When a portlet is dragged to the story board, the story board automatically resolves the dependency and updates the view accordingly.
Fig : 8
Right click on a consume event element node of a portlet node and click on the "Generate Consume Event Source" pop up menu item. It creates appropriate consume event source in the corresponding portlet java file. Fig : 11 shows sample generated code snippet for consume event .
Fig : 9
User has an option to change the default method name for the consume event.
Fig :10
Fig : 11
If you want to reset the story board, then right click and select "reset" anywhere inside the IPC StoryBoard.
Posted at 12:54PM Jun 19, 2007 by Satya Ranjan in NetBeans | Comments[1]
Hi Satya,
You wouldn't believe it, but in my installation of the new netbeans 6.0 final release, together with portal pack 2.0 beta (and vwp, of course), the "IPC Story Board" menu item in the Window top menu has vanished.
Is this a known bug? Is there another way to invoke the IPC Story Board designer?
Cheers,
Konrad
Posted by Konrad Wulf on December 12, 2007 at 07:39 PM IST #