!--a11y-->
Configuring Event SubscriptionIf a portal application wants to be notified about modifications to its configuration, this application has to implement the interface IConfigEventListener.

public class HelloWorld extends AbstractPortalComponent implements IConfigEventListener { ... } |
Add the required methods. There are two methods that have to be implemented:
· public String getConfigListenerId() – returns the Id of the listener

public String getConfigListenerId() { return "com.sap.portal.prt.config.prototype.HelloWorld"; } |
This uniquely identifies the listener’s application throughout all the applications.
It is a good idea to use a combination of the application name and the component name. In this case com.sap.portal.prt.config.prototype is the application name and HelloWorld is the component name. If there is a need for only one Config listener within an application, the application can just use its name.
· public void configEvent(ConfigEvent event) – is called when an action occurred on the specified configuration

public void configEvent(ConfigEvent event) { if (event.getType() == ConfigEvent.CONFIGURABLE_ADDED) { ... } else if (event.getType() == ConfigEvent.CONFIGURABLE_UPDATED) { ... } else if ( ... } |
Event |
Description |
CONFIGMANAGER_INITIALIZED |
A config manager has been initialized |
CONFIGMANAGER_TERMINATED |
A config manager has been terminated |
CONFIGURABLE_ADDED |
A new configurable has been added |
CONFIGURABLE_DELETED |
A configurable has been deleted |
CONFIGURABLE_LOADED |
A new configurable has been loaded from store |
CONFIGURABLE_UPDATED |
A configurable has been updated |
CONFIGURATION_UPDATED |
The configuration has been updated (by a queued update) |
See also:
