In this release of Webcenter, we finaly have support for JSR 286 portlets. This means that we can make use of the extended portlet standard. This enable us to have portlets that can easily communicate with each other without needing to configure lots of parameters or setting partialTriggers.
JDeveloper also has a new interface to manage the portlet.xml. This contains all the features to configure JSR286 portlets.
When you create a portlet in a portlet producing application, the wizard has not changed much. We still have the 8 known steps:
You notice that the checkbox is gone for enable inter portlet communication.
When you finish the wizard, all the default files will be created like the portlet class, jsp or jspx pages and portlet.xml. The oracle-portlet.xml is no longer generated because everything is now configured in the portlet.xml
On the left you have different tabs:
Here you can define some default preferences and attributes like the possible modes you will use in the portlets in the producer.
You can also define a resource bundle for the provider here.
In the portlets tab, you configure the actual portlets. When you select a portlet from the list, you can edit the configuration.
You are able to change the portlet information, select the events, parameters.
You can also define security and in the advanced tab you can define the preferences for the portlet.
In the events tab you can define events that you can use in your portlets. Events are a way to enable inter portlet communication. You can add a payload to events so you can add object that need to be passed by the object.
A portlet can register itself to listen for the events so when another portlet fires the event, the portlet will notice this and act accordingly.
Public render parameters are another way to enable inter portlet communication. Instead of triggering an event, you can also set and get values for parameters of the provider. These parameters are shared among the portlets of the same provider so when one portlet sets the value of a parameter, the other portlet can read the new value.
In the filter tab you can define filters that need to be applied to your producer.
The filter mapping goes together with the filters. In this section you can define the filters that need to be applied to which portlets.
In the previous version, you had to do a lot to achieve inter-portlet-communication. First you had to define the events or parameters in the oracle-portlet.xml which was an extension on the portlet.xml. A next thing you need to do was to map the parameters from both portlets to the same page parameters. This needs to be done in the page bindings of the page or when you do it during runtime, using the properties of the portlet.
You also need to set a partialTrigger on the receiving portlet so you need to find out the ID of the sending portlet.
With this release of Webcenter, all this hasle is not needed anymore. When you add events to a producer and add this to the portlets, they will automaticly be notifed when a portlet fires that event. So no need to modify the page bindings or set partial triggers. Now it is realy easy to wire two portlets together.
In the future I will write some more detailed posts about how to create JSR 286 portlets and how to use the events and parameters to enable inter portlet communication.