class sap.ui.core.Manifest

Control sample: sap.ui.core.Manifest
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/Manifest
Application Component: CA-UI5-COR

The Manifest class.


Constructor

Creates and initializes a manifest wrapper which provides API access to the content of the manifest.

new sap.ui.core.Manifest(oManifest, mOptions?)
Param Type Default Value Description
oManifest object

the manifest object

mOptions? object

(optional) the configuration options

componentName? string

(optional) the name of the component

baseUrl? string

(optional) the base URL which is used to resolve relative URLs against

process? boolean true

(optional) Flag whether the manifest object should be processed or not which means that the placeholders will be replaced with resource bundle values

activeTerminologies? string[]

(optional) A list of active terminologies. If the mOptions.process flag is set to true, the given terminologies will be respected when replacing placeholders with resource bundle values. To use active terminologies, the sap.app.i18n section in the manifest must be defined in object syntax as described here: Text Verticalization. The order of the given active terminologies is significant. The ResourceBundle API documentation describes the processing behavior in more detail.


Methods Overview

Method Description
_preprocess

Generic preprocessing function. Current features: - resolve "ui5://..." urls. - collect "i18n placeholder properties"

_processResourceConfiguration

Function that loops through the model config and resolves the bundle urls of terminologies relative to the component or relative to the manifest

sap.ui.core.Manifest.extend

Creates a new subclass of class sap.ui.core.Manifest with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

getComponentName

Returns the Component name which is defined in the manifest as sap.ui5/componentName or sap.app/id

getEntry

Returns the configuration of a manifest section or the value for a specific path. If no key is specified, the return value is null.

Example: { "sap.ui5": { "dependencies": { "libs": { "sap.m": {} }, "components": { "my.component.a": {} } } });

The configuration above can be accessed in the following ways:

  • By section/namespace: oManifest.getEntry("sap.ui5")
  • By path: oManifest.getEntry("/sap.ui5/dependencies/libs")

By section/namespace returns the configuration for the specified manifest section and by path allows to specify a concrete path to a dedicated entry inside the manifest. The path syntax always starts with a slash (/).

getJson

Returns the manifest defined in the metadata of the component. If not specified, the return value is null.

sap.ui.core.Manifest.getMetadata

Returns a metadata object for class sap.ui.core.Manifest.

getRawJson

Returns the raw manifest defined in the metadata of the component. If not specified, the return value is null.

sap.ui.core.Manifest.load

Function to load the manifest by URL

resolveUri

Resolves the given URI relative to the Component by default or optional relative to the manifest when passing 'manifest' as second parameter.

_preprocess

Generic preprocessing function. Current features: - resolve "ui5://..." urls. - collect "i18n placeholder properties"

Param Type DefaultValue Description
args object

arguments map

resolveUI5Urls boolean

whether "ui5://..." URLs should be resolved

i18nProperties array

an array into which all i18n placeholders will be pushed

_processResourceConfiguration

Function that loops through the model config and resolves the bundle urls of terminologies relative to the component or relative to the manifest

Param Type DefaultValue Description
mSettings object

Map with model config settings

sBaseBundleUrlRelativeTo string

BundleUrlRelativeTo info from base config

bAlreadyResolvedOnRoot boolean

Whether the bundleUrl was already resolved (usually by the sap.ui.core.Component)

sap.ui.core.Manifest.extend

Creates a new subclass of class sap.ui.core.Manifest with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getComponentName

Returns the Component name which is defined in the manifest as sap.ui5/componentName or sap.app/id

getEntry

Returns the configuration of a manifest section or the value for a specific path. If no key is specified, the return value is null.

Example: { "sap.ui5": { "dependencies": { "libs": { "sap.m": {} }, "components": { "my.component.a": {} } } });

The configuration above can be accessed in the following ways:

By section/namespace returns the configuration for the specified manifest section and by path allows to specify a concrete path to a dedicated entry inside the manifest. The path syntax always starts with a slash (/).

Param Type DefaultValue Description
sPath string

Either the manifest section name (namespace) or a concrete path

getJson

Returns the manifest defined in the metadata of the component. If not specified, the return value is null.

sap.ui.core.Manifest.getMetadata

Returns a metadata object for class sap.ui.core.Manifest.

getRawJson

Returns the raw manifest defined in the metadata of the component. If not specified, the return value is null.

sap.ui.core.Manifest.load

Function to load the manifest by URL

Param Type DefaultValue Description
mOptions object

the configuration options

manifestUrl string

URL of the manifest

componentName string

name of the component

async boolean false

Flag whether to load the manifest async or not

failOnError boolean true

Flag whether to fail if an error occurs or not If set to false, errors during the loading of the manifest.json file (e.g. 404) will be ignored and the resulting manifest object will be null. For asynchronous calls the returned Promise will not reject but resolve with null.

processJson function

Callback for asynchronous processing of the loaded manifest. The callback receives the parsed manifest object and must return a Promise which resolves with an object. It allows to early access and modify the manifest object.

activeTerminologies string[]

A list of active terminologies. The order of the given active terminologies is significant. The ResourceBundle API documentation describes the processing behavior in more detail. Please have a look at this dev-guide chapter for general usage instructions: Text Verticalization.

resolveUri

Resolves the given URI relative to the Component by default or optional relative to the manifest when passing 'manifest' as second parameter.

Param Type DefaultValue Description
sUri string

URI to resolve as string

sRelativeTo string 'component'

defines to which base URI the given URI will be resolved to; one of ‘component' (default) or 'manifest'