• No results found

The Personalization Interface

In document NET311 Advanced ABAP Web Dynpro (Page 147-155)

The personalization interface (implemented by the personalization manager at runtime) allows to load, save, or delete adaptation data sets at runtime. As a reference for this lesson, the personalization interface

IF_WD_PERSONALIZATION and the way of how to access this interface are summarized below.

Figure 81: Accessing the personalization interface from a controller having declared the component controller as a used controller

Figure 82: The personalization interface

Configuration

Configuration is a concept that lets the developer create configuration data sets containing values for UI element properties or context attributes (typically bound to UI element properties). This allows to overwrite many of the statically defined UI element properties, resulting in a different look and feel of the application (UI elements may be set to invisible, tables may have an alternating row color, and so on).

Configuration data sets are related to components or they are related to applications. Component configurations allow you to change properties of UI elements defined in any view of a single component. For each component, an arbitrary number of component configurations can be defined. Application configurations are bound to Web Dynpro applications. They define which component configuration is used for which component in this application. For each application, an arbitrary number of application configurations can be created.

Application changes related to configuration affect every user of this application in every client.

Figure 83: Configuration: Concept

Defining a Component Configuration

Figure 84: Creating / changing a component configuration

Figure 85: Explicit component configuration

Hint: Properties that are configured explicitly may be overwritten by implicit customizing / personalization (if they are not set final).

The single steps of creating a new component configuration are as follows:

1. In the Component Configuration tray, enter the name of the component configuration to be created.

Caution: In a customer system, you may only choose names in the customer name space (beginning with Z or Y).

2. In the Functions tray, choose Create. This will open a dialog where you can change UI element properties.

3. On the Implicit Configuration tab, choose the UI element you want to manipulate. Change the property values and set the Final flag if you do not want this property to be changed by customizing or by personalization.

4. On the Explicit Configuration tab, you can change the values of all attributes defined in the configuration controller. This tab is only selectable, if a configuration controller exists.

5. Enter a description in the form field above the tab strip.

6. Press the Details button in the Changed Configuration tray. In the form fields appearing on the right side, you can choose the package name and the transport request the component configuration will be assigned to.

Hint: For SAP NetWeaver Application Server 7.0 SP12 and later, the Details button does not exist any more. The corresponding dialog is send automatically when the Save button is pressed.

7. Finally, press the Save button in the Changed Configuration tray.

8. Close the browser. In the ABAP Workbench, refresh the object list. The component configuration can be found as a sub-element of the Web Dynpro component.

Using the same configuration tool, existing component configurations can be displayed or changed.

Hint: Existing component configuration data sets for any component can be displayed and deleted using the Web Dynpro application WD_ANALYZE_CONFIG_COMP.

Defining an application configuration is started from the context menu of an existing Web Dynpro application (Create/Change Configuration).

The configuration tool is also implemented by a Web Dynpro application

(configure_application). The single steps of creating an application configuration are as follows:

Figure 86: Creating / changing an application configuration

1. In the Application Configuration tray, enter the name of the application configuration to be created.

Caution: In a customer system you may only choose names in the customer namespace (beginning with Z or Y).

2. In the Functions tray, choose Create. This will open a dialog where you can choose which configuration will be used for which component.

3. In the Assignment to Component Configuration group, choose a component usage. In the group below, choose which configuration should be used for this component usage.

4. Enter a description in the form field on top of the Assignment to Component Configuration group.

5. Press the Details button in the Changed Configuration tray. In the form fields appearing on the right side, you can choose the package name and the transport request the component configuration will be assigned to.

Hint: For SAP NetWeaver Application Server 7.0 SP12 and later, the Details button does not exist any more. The corresponding dialog is send automatically when the Save button is pressed.

6. Finally, press the Save button in the Changed Configuration tray.

7. Close the browser. In the ABAP Workbench, refresh the object list. The application configuration can be found as a sub-element of the Web Dynpro application.

Using the same application configuration tool, existing application configurations can be changed.

Hint: Existing application configuration data sets can be displayed, changed, or deleted using the Web Dynpro application WD_ANALYZE_CONFIG_APPL.

Using an Application Configuration at Runtime

Before an application configuration is used at runtime it has to be assigned to the related Web Dynpro application. There are three ways of doing that:

1. The application configuration can be assigned to the application statically. In this case the parameter WDCONFIGURATIONID has to be added to the application's parameter list and the name of the application configuration (<appl_config>) has to be defined as the value of this parameter.

2. The application configuration can be assigned dynamically by adding the query string sap-wd-configID=<appl_config> to the URL used to start the Web Dynpro application.

3. Using the method load_config_by_key( ) of the interface

IF_WD_PERSONALIZATION, the component configuration for each component of the application can be loaded or replaced at runtime.

Hint: A list of available component configurations for a given component can be obtained from the service class CL_WD_CONFIGURATION_UTILITIES, method get_config_list_4_comp( ).

In document NET311 Advanced ABAP Web Dynpro (Page 147-155)