Skip to content

Latest commit

 

History

History
1264 lines (823 loc) · 24.9 KB

deprecated-configuration-api-2acafbf.md

File metadata and controls

1264 lines (823 loc) · 24.9 KB

Deprecated Configuration API

This page describes important aspects of the deprecation of the sap.ui.core.Configuration API facade. It shows a migration path away from the deprecated legacy APIs and towards their future-proof alternatives, provided the functionality is still meant for productive usage.

The following is an alphabetical list of API methods on sap.ui.core.Configuration. Meant as a compact and practical overview, it is derived from the API Reference, which may provide complementary information.

Legacy API Method on Configuration

New Module

Replace With

applySettings

-

Deprecated without replacement.

This API method, which was typically used via sap.ui.getCore().getConfiguration().applySettings(), is superseded by different dedicated facade modules addressing the corresponding topics. It's therefore not possible to use a generic pattern to replace these calls.

Check the API documentation of sap.ui.core.Configuration and use the references below to find the correct replacement.

getAccessibility

sap/ui/core/ControlBehavior

ControlBehavior.isAccessibilityEnabled()

getActiveTerminologies

sap/base/i18n/Localization

Localization.getActiveTerminologies()

getAllowlistService

sap/ui/security/Security

Security.getAllowlistService()

getAnimation

sap/ui/core/ControlBehavior

ControlBehavior.getAnimationMode()

getAnimationMode

sap/ui/core/ControlBehavior

ControlBehavior.getAnimationMode()

getAppCacheBuster

-

Deprecated without replacement

getAppCacheBusterMode

-

Deprecated without replacement

getApplication

-

Deprecated without replacement. Use sap/ui/core/ComponentSupport instead. See also Declarative API for Initial Components.

getAutoAriaBodyRole

-

Deprecated without replacement

getCalendarType

sap/base/i18n/Formatting

Formatting.getCalendarType()

getCalendarWeekNumbering

sap/base/i18n/Formatting

Formatting.getCalendarWeekNumbering()

getCompatibilityVersion

-

Deprecated without replacement

getDebug

-

Deprecated without replacement

getFileShareSupport

-

Deprecated without replacement

getFiori2Adaptation

-

Deprecated without replacement

getFlexibilityServices

-

Deprecated without replacement

getFormatLocale

sap/base/i18n/Formatting

Formatting.getLanguageTag()

The new API returns an sap/base/i18n/LanguageTag. There are two possibilities to replace the deprecated API calls using the new formatting API:

  • Either you replace the deprecated API by transforming the retrieved new LanguageTag into an sap/ui/core/Locale. To do so, require sap/ui/core/Locale and pass the LanguageTag as a parameter to the Locale constructor.

  • Alternatively, you adjust the usage of the locale to the new LanguageTag API.

Example:

// either transform LanguageTag into Locale and use as before
sap.ui.require([
    "sap/base/i18n/Formatting",
    "sap/ui/core/Locale"
], (Formatting, Locale) => {
    // Transform LanguageTag to Locale
    const oFormatLocale = new Locale(Formatting.getLanguageTag());
    const sFormatLanguage = oFormatLocale.getLanguage();
});
 
// or adjust usage of Locale to LanguageTag API
sap.ui.require([
    "sap/base/i18n/Formatting"
], (Formatting) => {
    const oFormatLanguageTag = Formatting.getLanguageTag();
    const sFormatLanguage = oFormatLanguageTag.language;
});

getFormatSettings

sap/base/i18n/Formatting

Formatting

The getFormatSettings API is superseded by the Formatting facade itself.

Example:

sap.ui.require([
    "sap/base/i18n/Formatting",
    "sap/base/i18n/date/CalendarType"
], (Formatting, CalendarType) => {
    Formatting.setCalendarType(CalendarType.Islamic);
});

getFrameOptions

sap/ui/security/Security

Security.getFrameOptions()

getInspect

-

Deprecated without replacement

getLanguage

sap/base/i18n/Localization

Localization.getLanguage()

getLanguageTag

sap/base/i18n/Localization

Localization.getLanguageTag().toString()

getLocale

sap/base/i18n/Localization

Formatting.getLanguageTag()

The new API returns an sap/base/i18n/LanguageTag. There are two possibilities to replace the deprecated API calls using the new formatting API:

  • Either you replace the deprecated API by transforming the retrieved new LanguageTag into an sap/ui/core/Locale. To do so, require sap/ui/core/Locale and pass the LanguageTag as a parameter to the Locale constructor.

  • Alternatively, you adjust the usage of the locale to the new LanguageTag API.

Example:

// either transform LanguageTag into Locale and use as before
sap.ui.require([
    "sap/base/i18n/Localization",
    "sap/ui/core/Locale"
], (Localization, Locale) => {
    // Transform LanguageTag to Locale
    const oLocale = new Locale(Localization.getLanguageTag());
    const sLanguage = oLocale.getLanguage();
});
 
// or adjust usage of Locale to LanguageTag API
sap.ui.require([
    "sap/base/i18n/Localization"
], (Localization) => {
    const oLanguageTag = Localization.getLanguageTag();
    const sLanguage = oLanguageTag.language;
});

getManifestFirst

-

Deprecated without replacement

getNoDuplicateIds

-

Deprecated without replacement

getOriginInfo

-

Deprecated without replacement

getRootComponent

-

Deprecated without replacement

getRTL

sap/base/i18n/Localization

Localization.getRTL()

getSAPLogonLanguage

sap/base/i18n/Localization

Localization.getSAPLogonLanguage()

getSecurityTokenHandlers

sap/ui/security/Security

Security.getSecurityTokenHandlers()

getStatisticsEnabled

-

Deprecated without replacement

getTheme

sap/ui/core/Theming

Theming.getTheme()

getTimezone

sap/base/i18n/Localization

Localization.getTimezone()

getUIDPrefix

sap/ui/base/ManagedObjectMetadata

ManagedObjectMetadata.getUIDPrefix()

getVersion

sap/ui/VersionInfo

VersionInfo.load()

The getVersion method always returned the OpenUI5 version. Check the samples below on how to get either the SAPUI5 or OpenUI5 version. For more information, see Versioning and Maintenance of SAPUI5.

Example:

sap.ui.require([
    "sap/ui/VersionInfo",
    "sap/base/util/Version"
], function(VersionInfo, VersionUtil) {
    // access the SAPUI5 version at runtime
    VersionInfo.load().then(function(oCurrentVersionInfo) {
        const oSAPUI5Version = new VersionUtil(oCurrentVersionInfo.version);
        // ...
    });
 
    // access the OpenUI5 version (core version) at runtime
    VersionInfo.load("sap.ui.core").then(function(oCurrentVersionInfo) {
        const oOpenUI5Version = new VersionUtil(oCurrentVersionInfo.version);
        // ...
    });
});

getWhitelistService

sap/ui/security/Security

Security.getAllowlistService()

setAnimationMode

sap/ui/core/ControlBehavior

ControlBehavior.setAnimationMode()

setCalendarType

sap/base/i18n/Formatting

Formatting.setCalendarType()

setCalendarWeekNumbering

sap/base/i18n/Formatting

Formatting.setCalendarWeekNumbering()

setFormatLocale

sap/base/i18n/Formatting

Formatting.setLanguageTag()

The deprecated API only accepted a string, whereas the new API also accepts an sap/base/i18n/LanguageTag.

setLanguage

sap/base/i18n/Localization

Localization.setLanguage()

setRTL

sap/base/i18n/Localization

Localization.setRTL()

setSecurityTokenHandlers

sap/ui/security/Security

Security.setSecurityTokenHandlers()

setTheme

sap/ui/core/Theming

Theming.setTheme()

setTimezone

sap/base/i18n/Localization

Localization.setTimezone()

In legacy code, a configuration object that bundled certain format settings of UI5, was often retrieved by calls such as sap.ui.core.Configuration.getFormatSettings(), with the following methods then called on that FormatSettings object.

Legacy API Method on FormatSettings

New Module

Replace With

addCustomCurrencies

sap/base/i18n/Formatting

Formatting.addCustomCurrencies()

getCustomCurrencies

sap/base/i18n/Formatting

Formatting.getCustomCurrencies()

getDatePattern

sap/base/i18n/Formatting

Formatting.getDatePattern()

getFormatLocale

sap/base/i18n/Formatting

Formatting.getLanguageTag()

The new API returns an sap/base/i18n/LanguageTag. There are two possibilities to replace the deprecated API calls using the new formatting API. See the entry for getFormatLocale above.

getLegacyDateCalendarCustomizing

sap/base/i18n/Formatting

Formatting.getCustomIslamicCalendarData()

getNumberSymbol

sap/base/i18n/Formatting

Formatting.getNumberSymbol()

getTimePattern

sap/base/i18n/Formatting

Formatting.getTimePattern()

getTrailingCurrencyCode

sap/base/i18n/Formatting

Formatting.getTrailingCurrencyCode()

setCustomCurrencies

sap/base/i18n/Formatting

Formatting.setCustomCurrencies()

setDatePattern

sap/base/i18n/Formatting

Formatting.setDatePattern()

setFirstDayOfWeek

sap/base/i18n/Formatting

Formatting.setCalendarWeekNumbering()

setLegacyDateCalendarCustomizing

sap/base/i18n/Formatting

Formatting.setCustomIslamicCalendarData()

setLegacyDateFormat

sap/base/i18n/Formatting

Formatting.setABAPDateFormat()

This renaming (along with similar ones for setLegacyNumberFormat and setLegacyTimeFormat), has been done to reflect their relation to SAP ABAP back ends. Consequently, the corresponding change event parameter has been named ABAPDateFormat (and ABAPNumberFormat or ABAPTimeFormat, respectively).

Also refer to sap/base/i18n/Formatting$ChangeEvent for a detailed breakdown of all available change event parameters.

setLegacyNumberFormat

sap/base/i18n/Formatting

Formatting.setABAPNumberFormat()

See information for setLegacyDateFormat.

setLegacyTimeFormat

sap/base/i18n/Formatting

Formatting.setABAPTimeFormat()

See information for setLegacyDateFormat.

setNumberSymbol

sap/base/i18n/Formatting

Formatting.setNumberSymbol()

setTimePattern

sap/base/i18n/Formatting

Formatting.setTimePattern()

setTrailingCurrencyCode

sap/base/i18n/Formatting

Formatting.setTrailingCurrencyCode()