Working with events
In a JSR 286 portlet project, you can create an event.
You can also publish and process events with the help of a wizard.
About this task
- To create an event using the Portlet Deployment Descriptor:
- Double click Portlet Deployment Descriptor (PDD) in the Project Navigator.
- In the PDD editor, click the Events tab. You can define all the events that you would like to declared for the portlet application.
- Click Add.
- Enter a string or namespace-qualified name in the Event name field.
- Select either the default namespace or the custom namespace option.
- In Value type, select a fully qualified Java™ class name of the value to be transferred with the event.
- In Description, enter a descriptive text about the events that are declared for the portlet application.
- In Language, select the language in which the description needs to be displayed.
- In Aliases, specify a namespace qualified name for events. Click Add. This is to enable portals to perform automatic wiring between portlets.
- To create and publish an event using the Enable this portlet to
publish events wizard.
- Right click on the Portlet Deployment Descriptor in the Project Navigator, and select Events > Enable this portlet to publish events.
- In the Enable this portlet to publish events dialog box, select the portlet that needs to publish an event.
- Enter a string or namespace-qualified name in the Event name field.
- Select either the default namespace or the custom namespace option.
- Select Action Phase or Event Phase, to specify the phase in which you want to publish the events.
- In Alias Names, specify a namespace qualified name for events. This is to enable portals to perform automatic wiring between portlets.
- In Description, enter a descriptive text about the events that are declared for the portlet application.
- In Value type, select a fully qualified Java class name of the value to be transferred with the event.
- Click Finish.
- To process an event using the Enable this portlet to process events
wizard:
- Right click on the Portlet Deployment Descriptor in the Project Navigator, and select Events > Enable this portlet to process events. The Enable this portlet to process events wizard is displayed.
- In the Enable this portlet to process events dialog box, select the Portlet which needs to process an event.
- Select the event that you would like to process, in the Event name field.
- Select either the default namespace or the custom namespace option.
- In Alias Names, specify a namespace qualified name for events. This is to enable portals to perform automatic wiring between portlets.
- In Description, enter a descriptive text about the events that are processed for the portlet application.
- In Value type, select a fully qualified Java class name of the value to be transferred with the event.
- Click Finish.
Note: Initially, when you place a portlet on a page,
it will not be able to publish or receive any events. You must use
the portlet wiring tool link, on the Websphere Portal Server, to connect
the events declared by the portlet to outputs or inputs of other portlets.