3.3. UDM plugins#

UDM is the part in Nubus for Kubernetes that provides the Directory Manager. It’s responsible for the business logic and data structures. The presentation layer comes from the Management UI that you can customize through UMC plugins.

This section describes how to customize the Directory Manager. If you want to customize existing business logic or add business logic, then the UDM plugins are for you. UDM offers the following plugins for packaged integrations:

  1. UDM syntax

  2. UDM hooks

  3. UDM handlers

Depending on your customization case, you may need to combine various UDM plugins or other plugins to achieve your goal.

Note

Describing how to create every different UDM plugin is beyond the scope of this document.

For an extensive description of UDM customization, refer to Univention Directory Manager (UDM) in Univention Corporate Server - Manual for developers [4].

3.3.1. UDM syntax#

As a developer, you want to define rules to verify user input for plausibility and validity. User input is the data as UDM stores it in the Directory Service. A UDM syntax ensures that the user input matches the expectation regarding that data. If this scenario describes your customization case, then UDM syntax is for you. UDM syntax defines the look and the behavior of an input widget for UDM objects. It applies the verification upon user input. You can combine existing syntax types for your own UDM syntax. In detail, UDM syntax offers the following functionality:

  • Validate the syntax of user input data.

  • Present static values from a predefined list of possible values.

  • Dynamically calculate possible values upon use.

  • Specify the layout and widget type for presentation in the Management UI.

To add a UDM syntax to your packaged integration for Nubus for Kubernetes follow these steps:

  1. Save the UDM syntax in a file and give it a proper name.

  2. Follow the instructions for building the container image in Bundle packaged integrations.

  3. Copy the plugin file to your packaged integration project, for example packaged-integration/udm/syntax.d/. For UDM syntax, the plugin-type is udm-syntax.d. See Add plugins.

    $ export PLUGIN_TYPE="udm-syntax.d"
    $ export PLUGIN_FILE="packaged-integration/udm/syntax.d"
    

Tip

The UDM HTTP REST API mounts your provided UDM syntax to the following directory: /usr/lib/python3/dist-packages/univention/admin/syntax.d.

Example

For UDM syntax, see the following implementation example:

See also

UDM syntax

in Univention Corporate Server - Manual for developers [4] for information about existing syntax types.

3.3.2. UDM hooks#

As a developer, you want to extend existing UDM modules with additional attributes and logic. If this scenario describes your customization case, then UDM hooks are for you.

You can use UDM hooks to inject custom business logic that UDM runs after UDM modified an extended attribute, and add consistency checks, safety fallbacks, or modification of additional objects. They’re Python classes and methods that extend existing UDM modules.

Before you can use UDM hooks, you must first define extended attributes to provide a kind of anchor to which to attach the UDM hook. An extended attribute provides a mapping between the input widget and the UDM attribute. For the definition of extended attributes, refer to UDM data loader.

UDM hooks add process or business logic to the extended attribute. You can define explicit logic for create, modify, and delete actions of a UDM object. The logic has access to the entire UDM object. In addition, UDM hooks can apply plausibility, consistency, and validity checks before saving the UDM object.

To add UDM hooks to Nubus for Kubernetes, use the following steps:

  1. Save the UDM hook in a Python file and give it a proper name with the extension .py.

  2. Follow the instructions for building the container image in Bundle packaged integrations.

  3. Copy the plugin file to your packaged integration project, for example packaged-integration/udm/hooks.d/. For UDM hooks, the plugin-type is udm-hooks.d. See Add plugins.

    $ export PLUGIN_TYPE="udm-hooks.d"
    $ export PLUGIN_FILE="packaged-integration/udm/hooks.d"
    

Tip

The UDM HTTP REST API mounts your provided UDM hook to the following directory: /usr/lib/python3/dist-packages/univention/admin/hooks.d.

Example

For UDM hooks, see the following implementation example:

See also

Expansion of UMC modules with extended attributes

in Univention Corporate Server - Manual for users and administrators [5] for information about how to create extended attributes.

3.3.3. UDM handlers#

As a developer, you want to define a custom UDM object as a representation of a directory object, or a combined representation of several directory objects. If this scenario describes your customization case, then UDM handlers are for you.

A UDM handler defines a UDM object from one or more directory objects. It defines the following aspects:

  • Process or business logic.

  • The mapping to create a UDM object from directory objects.

  • The presentation layout for the Management UI.

You can use existing or custom UDM syntax to enhance your UDM handler.

To add UDM handlers to Nubus for Kubernetes, use the following steps:

  1. Save the UDM handler in a file and give it a proper name.

  2. Follow the instructions for building the container image in Bundle packaged integrations.

  3. Copy the plugin file to your packaged integration project, for example packaged-integration/udm/handlers/. For UDM handlers, the plugin-type is udm-handlers. See Add plugins.

    $ export PLUGIN_TYPE="udm-handlers"
    $ export PLUGIN_FILE="packaged-integration/udm/handlers"
    

Tip

The UDM HTTP REST API mounts your provided UDM handler to the following directory: /usr/lib/python3/dist-packages/univention/admin/handlers.

Example

For UDM handlers, see the following implementation example:

See also

UDM modules

in Univention Corporate Server - Manual for developers [4] for information about the module structure.