The descriptor provides a central, machine-readable, and easy-to-access location for storing metadata associated with a component.
The data of the descriptor is stored in JSON format in the manifest.json file.
The existence of the manifest.json file must be declared in the metadata defined in the Component.js file (see below). The declaration in the component metadata makes the component load the manifest.json file and read the relevant entries for SAPUI5.
The content of the descriptor is structured using namespaces, amongst others, the sap.app, sap.ui, and sap.ui5 namespaces (see the figure Structure of the Descriptor):
- The sap.app namespace provides application-specific attributes.
- The sap.ui namespace provides UI-specific attributes.
- The sap.ui5 namespace provides SAPUI5-specific attributes.
Each new SAPUI5 version implies a new version of the descriptor. This descriptor format version is described by the value of the mandatory _version property at root level of the descriptor (see the figure Structure of the Descriptor). How the value of this property is exactly related to the SAPUI5 version, and the descriptor version can be found in the documentation.
The figure, sap.app Namespace, shows some attributes from the sap.app namespace. A complete listing of all attributes can be found in the documentation.
The id attribute is a mandatory attribute that must be provided in dot notation and specifies a unique Id for the project. It must match the namespace provided in the corresponding Component.js file.
If the component controller is created there, for example, via
1
UIComponent.extend("sap.training.exc.Component", { . . . });
the id attribute must have the value sap.training.exc.
The title and description of the project are maintained using the title and description attributes of the sap.app namespace. To make the attribute values language dependent, a key value is specified in double curly braces: {{key}}
The specified keys are maintained in a file with the extension .properties. The i18n attribute can then be used to specify the URL to this file. The URL is interpreted relative to the manifest.json file. The way in which the maintained texts can be made available in other languages will be discussed later in the course.
The texts referenced in the descriptor for title and description can be read by the SAP Fiori launchpad, for example.
The figure, sap.ui5 Namespace, shows some attributes from the sap.ui5 namespace.
The dependencies attribute contains the external dependencies to libraries and components that are loaded by the SAPUI5 core during the initialization phase of the component. Everything referenced here can be used directly in the component's code.
The libs property contains the libraries that the SAPUI5 core should load for use in the component. In the example, among others, the sap.ui.core and the sap.m library are loaded initially.
The minUI5Version property specifies the minimum SAPUI5 version that the component requires. Since SAPUI5 does not currently enforce the use of the correct version, minUI5Version is used for informational purposes only. If the minimum SAPUI5 version criterion is not met, a warning is issued in the console log.
The rootView attribute specifies the root view to open. The value of this attribute can be the view name as a string for XML views, or the view configuration object with viewName for the view name and type for the view type, id, async and other properties of sap.ui.core.mvc.View.
In the example shown, the XML view with the module name sap.training.exc.view.App is set as the root view of the component. It is loaded asynchronously via the module system and has the id App. This means that when the component is instantiated and embedded in the UI, the App view is automatically displayed as the initial view.