9 Oracle Metadata Services

This chapter provides a high-level overview of how the Oracle Metadata Services (MDS) framework can be used for seeded customizations and change persistence in an ADF application.

This chapter includes the following sections:

9.1 About Oracle Metadata Services (MDS)

The Oracle Metadata Services (MDS) framework allows you to create applications that your customers can further customize for their users or customers and which the end users can also customize.

As shown in Figure 9-1, MDS can be applied to the range of other components in the ADF technology stack, such as ADF Faces, ADF Controller, ADF Model, and ADF Business Components.

Figure 9-1 ADF Architecture with Metadata Services

This image is described in the surrounding text

You can use MDS to enable the following types of customizations in an application:

  • Seeded customization

    Seeded customization of an application is the process of taking a generalized application and making modifications to suit the needs of a particular group, such as a specific industry or site. Seeded customizations exist as part of the deployed application, and endure for the life of a given deployment.

  • User customization (change persistence).

    User customization allows an end user to change the content of the application at runtime to suit individual preferences (for example, which columns are visible in a table), and have those changes persist across that user's sessions.

9.2 Core Benefits of MDS

The architecture and features of MDS provide the following benefits:

  • You can offer your customers a working application that they can further customize as they see fit.

  • A single application can have different customizations for different users or user segments.

  • The application can be patched or updated without changing or removing the customizations.

9.3 Key Concepts of MDS

The following concepts are central to the understanding of MDS:

  • Customization layers and customization values.

    A customized application contains a base application (the base documents) and one or more layers containing customizations, as illustrated in Figure 9-2. Each layer can have multiple customization layer values, typically only one of which is applied at runtime. When a customized application is launched, the customization content is applied over the base application.

    Figure 9-2 Base Application and Customization Layers

    This image is described in the surrounding text

    Examples of customization layers are industry and site. Examples of values for the industry layer might be financial and healthcare.

    Since the customizations are saved separately from the base, the customizations are upgrade safe; a new patch to the base can be applied without breaking customizations.

  • Static and dynamic customizations.

    Customizations can be categorized as either static or dynamic. Static customizations have only one layer value in effect for all executions of the application, while dynamic customizations can have values that vary based on the execution context (such as the user) of the application.

    Customizations in ADF Business Components objects and data control objects for other business services can only be static. This is because these objects are loaded only once for an application and reused for the duration of the application.

    Customizations at the controller or view level can be either static or dynamic, since they can allow the layer value to be determined at runtime, based on user roles (responsibilities) or other application-specific criteria. For example, you can design an application so that users from different organizations see different sets of fields on a given screen.

  • Customization Developer Role

    JDeveloper provides a special development role for customization developers so that work in customization layers of an application is isolated from the base application code. When you switch JDeveloper to the Customization Developer role, only customizable parts of the application are editable and new objects cannot be created.

  • Change Persistence

    ADF Faces incorporates a change persistence feature, which enables users to make changes to UI components, such as selecting which columns to display in a table, and have those changes persist as long as the session is active. Using MDS, you can extend the change persistence features to work across sessions, so that a user can exit the application with the UI in a given state and then restart the application and see the UI in the state that it was previously.

9.4 Key Components of MDS

The following are the key components of MDS:

  • MDS metadata repository.

    MDS stores the customizations in a metadata repository and retrieves them at runtime to merge the customizations with the base metadata to reveal the customized application.

    An MDS repository can be file-based or database-based. For production environments, a database-based MDS repository is preferable because of advantages such as efficient set-based queries, atomic transaction semantics, versioning, and the ability to isolate and test metadata changes on selected users in a running environment. For more information on setting up a metadata repository, see "Managing the Metadata Repository" in Administering Oracle Fusion Middleware.

  • Customization classes.

    A customization class is the interface that MDS uses to define which customization applies to the base definition metadata. Each customization class defines a customization layer (for example, industry or site) and can contain multiple layer values.

  • Metadata Archive (MAR).

    A MAR file is a compressed archive of selected metadata that is used to deploy an application's customizations to the MDS Repository.

9.5 Overview of the MDS Process Flow

Using MDS in an application consists of the following general steps:

  1. Create the customization classes that will be used and make them available to your application at design time in JDeveloper.

  2. Enable seeded customization for any pages or other artifacts that you want to make customizable.

  3. Specify the customization classes in the adf-config.xml file

  4. Optionally, set any restrictions on runtime customizations on the application.

  5. Optionally, enable end-user customizations and specify which components and which of their properties can be customized. In addition, you can set page-specific customization configurations and implement programmatic customizations for things such as reordering child components.

  6. Specify the customization layers and their values in the CustomizationLayerValues.xml file (to determine the layer values to make available to the customization developer in the Customization Context window).

  7. In JDeveloper, using the Studio Developer or the Customization Developer role, implement any seeded customizations that you want to add.

  8. If it has not already been done, configure an MDS repository on the server on which the customizable applications will be deployed.

  9. Package the customizations in a MAR file and include that MAR as part of the application's EAR file that you deploy to the application server.

9.6 Learning More About MDS

The following resources provide detailed information about using MDS: