Skip to content

Latest commit

 

History

History
337 lines (200 loc) · 7.2 KB

File metadata and controls

337 lines (200 loc) · 7.2 KB

Bootstrapping SAPUI5 Flexibility

You can define an alternative route from where to load SAPUI5 flexibility.

If you want SAPUI5 flexibility to be loaded from the default location as part of the SAPUI5 bootstrap, you don't need to do anything.

If you have a specific use case, you can change the default behavior using the flexibilityServices parameter in the SAPUI5 bootstrap. For example, if you'd like to disable SAPUI5 flexibility during SAPUI5 bootstrap, set the value of the flexibilityServices parameter to an empty string. Here's an example

Sample Code:

<script
    id="sap-ui-bootstrap"
    src="resources/sap-ui-core.js"
    data-sap-ui-async="true"
    data-sap-ui-flexibility-services=""
    data-...="...">
</script>

For various use cases, you can also define a list of connectors within flexibilityServices. These connectors are targeted at a specific use case and can be combined.

You provide the list of connectors as a string, because flexibilityServices is a string as well. Example: flexibilityServices ='[{"connector": "SessionStorageConnector"}]'.

Configuring the Connectors for Layering

The connectors control the layers to which changes are written. Every connector has a default layering configuration, but you can limit this default by specifying certain layers. Example: As a result of the following string, only the SessionStorage connector is used for CUSTOMER layer content (see Layering Concept):

flexibilityServices ='[{"connector": "SessionStorageConnector", layers: ["CUSTOMER"]}]'

Connectors for Productive Usage

Name

Supported Layers

Description

BtpServiceConnector

CUSTOMER, PUBLIC, USER

Used to connect key user adaptation, shared views, and end-user personalization on SAP BTP, Cloud Foundry environment.

For more information, see Developing Applications Running Standalone.

KeyUserConnector

CUSTOMER, PUBLIC

Caution:

If you develop apps running standalone on SAP BTP, Cloud Foundry environment, we strongly recommend that you replace the KeyUserConnector with the BtpServiceConnector in your SAPUI5 bootstrap.

Used to connect key user adaptation and shared views on SAP BTP, Cloud Foundry environment.

For more information, see Developing Applications Running in the SAP Cloud Portal Service.

Connectors Used by SAP - Not for Public Usage

Name

Supported Layers

Description

LrepConnector

CUSTOMER, PUBLIC, USER

Default connector used to handle ABAP back-end systems as well as SAP BTP, Neo environment

PersonalizationConnector

USER

Used to connect personalization within an SAPUI5 application on SAP BTP, Cloud Foundry environment

Connectors for Testing and Demo Purposes

Note:

To apply the mocked data correctly, you need a dependency to the sap.ui.fl library. You can establish this through dependencies within the used libraries or via the applications manifest.

Alternatively, add sap.ui.fl to the bootstrap of the test setup:

data-sap-ui-libs = '…,sap.ui.fl'

Name

Supported Layers

Description

LocalStorageConnector

All

Used to store all entries within the local storage of the browser.

Caution:

This storage is shared in case of parallel testing.

SessionStorageConnector

All

Used to store all entries within the session storage of the browser.

Note:

This is the recommended connector for testing.

Example:

If you want to verify that a user can add additional files, the configuration should look like this:

data-sap-ui-flexibility-services = '[{"connector": "SessionStorageConnector"}]'

JsObjectConnector

All

Used to store all entries within a JSON object persisting only for the session.

Note:

This is the recommended connector for testing.

ObjectPathConnector

None

Used to load mocked back-end responses. It needs an additional parameter path, which specifies the absolute path to the mock file.

The mocked file contains the data as JSON with the following structure:

{
    changes: [<list of changes as JSON>],
    compVariants: [<list of filters for comp controls as JSON>]
}

Example:

If you want to verify that a mocked back-end system provides data, the configuration should look like this:

data-sap-ui-flexibility-services = '[{"connector": "ObjectPathConnector", "path": "/some/path/to/the/mocked/data.json"}]'

Example:

If you want to verify both, that a mocked back-end system provides data and a user can add additional files, the configuration should look like this:

data-sap-ui-flexibility-services = '[{"connector": "ObjectPathConnector", "path": "/some/path/to/the/mocked/data.json"},{"connector": "SessionStorageConnector"}]'

Caution:

There are additional connectors for internal usage or super classes which must not be used within a configuration.

Related Information

Layering Concept

Step 2: Bootstrap

Bootstrapping: Loading and Initializing