JavaScript Extension Development API for Oracle Visual Builder Cloud Service - Classic Applications

Object Literal: components.dt/js/api/ComponentProviderRegistry.ComponentRegistration

Component registration object containing info about component providers. Describes what ABCS Component services the component provides and wants to plug into ABCS and thus the component lifecycle it supports.

Custom UI components consists of several related services plugged into ABCS that define its lifecycle and behavior and specify how the component renders its model, how it is registered in the Component Palette, what view hierarchy representing the component model it creates or how it lets users modify its behavior in the Property Inspector UI.

Create an object described by this interface and register into ABCS with ComponentProviderRegistry.registerComponent.
ABCS lets you register the following providers returning ABCS component SPI implementations describing the lifecycle of your custom component:

creatorProvider

Returns instances of your component creator.
Creator is called when ABCS makes new instances of your component, either when dropped from the Component Palette or made programatically via the Creator API.

You should always register an instance of CreatorProvider as without it ABCS will not be able to create your components.

paletteRegistrationProvider

Returns palette registration configuration defining the way your component is registered inside the ABCS Component Palette and how it behaves when being dropped into the ABCS designer (a page).

Not all components need to be registered in the Component Palette as some may only be instantiated programatically through the Creator API meaning they will not be standalone components but will live only as part of a composite white-box component.

generatorProvider

Returns component's generator transforming your component views into DOM elements browser can then render in the page.

propertyInspectorProvider

Returns an instance of a property inspector. A property inspector defines how (and if) users are allowed to modify the component's behaviour inside the ABCS Property Inspector UI. It defines the view and model for the component's implementation of a Property inspector that will show when the component is selected in the ABCS designer.

If you do not want to allow users to modify your component properties and behavior you do not need to register this provider in which case no Property Inspector UI will be displayed when the component is selected.

deleterProvider

Returns an instance of a deleter. This service is responsible for a cleanup of any artifacts created by your component during its lifecycle when the component is deleted from a page.

Registering its instance is not always necessary, it is required only when the component creates artifacts that you no longer want to be part of the parent ABCS application.
It may also come in handy if you want to display a removal confirmation dialog prior to the actual removal.

The component lifecycle usually consists of:

  • User looks the component up in the Component Palette where it is registered using a PaletteRegistrationProvider.
  • User drag and drops the component from the palette into the ABCS designer and at that point ABCS calls the component's Creator returned by registered CreatorProvider. The creator creates component's views and combines them into the componet's view hierarchy (consisting of either one view or more complex treeish structure).
  • ABCS renders the current page with component views created by the component's Creator and calls the component's Generator returned by the registered GeneratorProvider to take care of transforming the views into DOM elements (wrapped in jQuery elements) browser then can properly render.
  • When user selects the component (one of its views) ABCS calls the PropertyInspector (if supported and returned by the component) returned by the registered PropertyInspectorProvider and renders the Property Inspector UI according to the view and model defined by it.
  • Finally when the component is deleted from a page ABCS lets the component's Deleter (if supported and returned) returned by the registered DeleterProvider to clean up and artifacts created during the component's lifecycle that need to be removed along with the component.
Version:
  • 16.3.5
Source:
See:

Example

Registering component services

define([
    'components.dt/js/api/ComponentProviderRegistry',
    'myComponent/PaletteRegistrationProvider',
    'myComponent/CreatorProvider',
    'myComponent/GeneratorProvider',
    'myComponent/PropertyInspectorProvider',
    'myComponent/DeleterProvider'
], function (
    componentProviderRegistry,
    myPaletteRegistrationProviderInstance,
    myCreatorProviderInstance,
    myGeneratorProviderInstance,
    myPropertyInspectorProviderInstance,
    myDeleterProviderInstance
) {
    // create registration object with all service providers to register
    var myComponentRegistration = {
        id: 'com.my.MyComponent',
        displayName: 'My Cool Component',
        paletteRegistrationProvider: myPaletteRegistrationProviderInstance,
        creatorProvider: myCreatorProviderInstance,
        generatorProvider: myGeneratorProviderInstance,
        propertyInspectorProvider: myPropertyInspectorProviderInstance,
        deleterProvider: myDeleterProviderInstance
    };

    // register the component registration into ABCS
    componentProviderRegistry.registerComponent(myComponentRegistration);
});

Members

creatorProvider :components.dt/js/spi/registration/CreatorProvider

stable API

Provider of component's creator.

Returns instances of your component creator.
Creator is called when ABCS makes new instances of your component, either when dropped from the Component Palette or made programatically via the Creator API.

Type:
Version:
  • 16.3.5
Source:
See:

deleterProvider :components.dt/js/spi/registration/DeleterProvider

stable API

Provider of component's deleter.

Returns an instance of a deleter.
This service is responsible for a cleanup of any artifacts created by your component during its lifecycle when the component is deleted from a page.

Registering its instance is not always necessary, it is required only when the component creates artifacts that you no longer want to be part of the parent ABCS application.

Type:
Version:
  • 16.3.5
Source:
See:

displayName :String

stable API

Specifies the component's display name.

The display name will be show up in various places in ABCS where the component takes place (such as in the Component Palette from where it may be dropped into the designer).

Must be specified.

Type:
  • String
Version:
  • 16.3.5
Source:

generatorProvider :components.dt/js/spi/registration/GeneratorProvider

stable API

Provider of component's generator.

Returns component's generator.
Generator transforms your component views into DOM elements browser can then render in the page.

Type:
Version:
  • 16.3.5
Source:
See:

id :String

stable API

Specifies the component ID.

Must be provided and must be a globally unique identifier.

Type:
  • String
Version:
  • 16.3.5
Source:

paletteRegistrationProvider :components.dt/js/spi/registration/PaletteRegistrationProvider

stable API

Provider of component's palette registration.

Returns palette registration configuration defining the way your component is registered inside the ABCS Component Palette and how it behaves when being dropped into the ABCS designer (a page).

Not all components need to be registered in the Component Palette as some may only be instantiated programatically through the Creator API meaning they will not be standalone components but will live only as part of a composite white-box component.

Type:
Version:
  • 16.3.5
Source:
See:

propertyInspectorProvider :components.dt/js/spi/registration/PropertyInspectorProvider

stable API

Provider of component's property inspector.

Returns an instance of a property inspector.
A property inspector defines how (and if) users are allowed to modify the component's behaviour inside the ABCS Property Inspector UI. It defines the view and model for the component's implementation of a Property inspector that will show when the component is selected in the ABCS designer.

If you do not want to allow users to modify your component properties and behavior you do not need to register this provider in which case no Property Inspector UI will be displayed when the component is selected.

Type:
Version:
  • 16.3.5
Source:
See: