Show TOC

Responding to EventsLocate this document in the navigation structure

Use

The Module API enables you to extend module functionality by responding to the module lifecycle events, for example, when a module is added to or removed from a workspace, or its runtime settings have been changed.

You can respond to these events by implementing the predefined callback methods that are invoked when these events occur. You implement them in an extension service, which you include in your application as a regular portal service.

You register your portal service for events by adding a corresponding property to the <component-profile> section of the module component in the portalapp.xml, for example:

<property name="com.sap.workspaces.module.metadata.extension~transport" value="prt_service:com.yourname.portal.workspaces.modules.YourModuleExtensionService"/>

You need to create a separate property for each type of event that is handled by your service, as follows:

  • Module lifecycle events ( IModuleLifecycle interface) - com.sap.workspaces.module.metadata.extension~lifecycle

  • Principal events ( IPrincipalLifecycle interface) - com.sap.workspaces.module.metadata.extension~principal

  • Transport events ( IModuleTransport interface) - com.sap.workspaces.module.metadata.extension~transport

  • Settings ( IModuleSettings interface ) - com.sap.workspaces.module.metadata.extension~settings

Note

If you have implemented more than one extension service, set each property value to the name of the appropriate service.

The following examples illustrate how to extend module functionality by responding to the module lifecycle events:

Package

The relevant APIs are contained in the com.sap.workspaces.module.extension and com.sap.workspaces.module.settings packages.