Accessing own Controller Functions With
IPrivate InterfaceBased on its declarative, model-driven development concept Web Dynpro automatically adapts the generated controller classes and interfaces to the user (application developer) definitions.
Whereas the controller class itself only implements custom code, the internal controller class implements additional generic code. The IPrivate-API is the glue between these two classes. It exposes the internal controller class to the self-implemented controller class so that the generated internal controller class and its related interfaces can be invoked by the application developer.

The IPrivate-API is generated for every Web Dynpro controller type.
The next diagram illustrates the role of the IPrivate-API within a practical example:
|
* class and interface diagram only comprises added methods based on declaration |
|
Within the view SampleView the application developer makes some declarations like the usage of the component controller, the outbound plug CancelOut, the action Save or the event handler onSomeEvent(). After this modification of the view’s meta model data the Web Dynpro Code Generator re-generates and adapts the view controller class and its IPrivate interface: Action handler and event handler methods are added to the controller class and to the IPrivate-API of the internal controller class. The IPrivate-API is additionally extended by the methods: ● wdGetSampleCompController() to access the IPublic-API of the used component controller, ● wdFirePlugCancelOut() to fire the navigation event of outbound plug CancelOut, ● wdGetSaveAction() to access the object representing action Save. To access the fully generated IPrivate-API within the self-implemented controller class the shortcut variable wdThis can be used. This private member variable is of type IPrivateSampleView. |

Besides the declaration-based methods the IPrivate interface also exposes the generic methods wdGetAPI() and wdGetContext() to the component controller. The technical details on these functions will be described in the next section. There you will see, that the IPrivate interface extends the IPublic interface, if that one exists. This is the case for all non-view controllers like the window, component and custom controllers.
Implementing a
Component with its Controllers and Interfaces