cancel
Showing results for 
Search instead for 
Did you mean: 

how to use more then one manifest.json for UI5 app

santoshgowda
Participant

how can I use more than 1 manifest.json files for UI5 application,

and what is the advantage of using more manifest.json files in application.

Accepted Solutions (1)

Accepted Solutions (1)

joltdx
Active Contributor

Refer to this link in the SAPUI5 documentation: Descriptor for Applications, Components, and Libraries.

There we can read, among other things:

  • In general, the app descriptor describes the behavior of an app through attributes
  • The data of the app descriptor is stored in JSON format in the manifest.json file
  • It contains, for example, the app ID, the version, the data sources used, along with the required components and libraries. The existence of the manifest.json file must be declared in the component metadata, which is then delivered as part of the application archive

It says nothing about a possibility to split this into several files. And I don't see the use as it would make no sense describing the app differently in different places either. So there is one manifest.json app descriptor per app.

Are you possibly thinking about Descriptor for Libraries or Descriptor for Components (Inside Libraries)? But you would still only have one descriptor per each object...

Answers (3)

Answers (3)

mariusobert
Developer Advocate
Developer Advocate

I always just use one manifest.json per application or library. Why would you consider using more than one?

santoshgowda
Participant
0 Kudos

for knowledge purposes I want to try it.

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

I don't think that's possible

former_member243834
Active Participant
0 Kudos

Idea is to use different look and feel for cases of error. Lets say one manifest is for representation for KPI (in % and some text) and it can use header of Integration Card and another manifest is to use error handling (which might be icon and some text), which can use body of integration card. But I don't want header and body in the same manifest. Any idea how to do that?

samer_aldefai
Explorer
0 Kudos

you can have multiple html entry points each with own data version.

you could pass componentData through your index.html.

<body role="application" data-sap-ui-component
data-name="your.component.name"
data-settings='{"id": "one",
"componentData": {
"foo": "bar"
}}'>

in index2.html you pass different componentData.

<body role="application" data-sap-ui-component
data-name="your.component.name"
data-settings='{"id": "two",
"componentData": {
"foo": "pub"
}}'>

in your component override init & process your ComponentData

sap.ui.define([
"sap/ui/core/UIComponent"
], function(jQuery, UIComponent) {
"use strict";
var YourComponent = UIComponent.extend("your.component.name", {
metadata: {
manifest: "json",
library: "your.library.name",
version: "1.0",
}
});
YourComponent.prototype.init = function() {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
alert(this.getComponentData()?.foo == "pub" ? "beer" : "gin");
};
return YourComponent; });
junwu
Active Contributor
0 Kudos

what function you are trying to achieve with multiple manifest?

santoshgowda
Participant
0 Kudos

for most of sample application there will be more then one manifest file so I need to know what is the use of it and how to use it.

junwu
Active Contributor
0 Kudos

really? show me one that has multiple manifest.