on 01-12-2022 3:47 PM
Hi everybody,
I want to reuse SAPUI5 components of one app in another SAPUI5 app within a Fiori Launchpad in Cloud Foundry. I already implemented a working solution for NEO. I followed this blog post for CF, but it does not use a Launchpad and it does not work for me.
The biggest difference seems to be that in the xs-app.json of the importing app I use the html5-apps-repo-rt service
{
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
}
How do I configure the mta.yaml and the xs-app.json to reuse a component in a Fiori Launchpad?
Kind regards,
Christian.
Hi,
for a test on sap btp trial account I use the following:
in a view of the main app, I use a componentContainer:
<core:ComponentContainer width="100%" id="myComponentContainer" usage="myUsage" height="100%" manifest="true"/>
then in manifest.json I define the usage for the external component:
"sap.ui5": {
"componentUsages": {
"myUsage": {
"name": "my.component",
"settings": {}
}
},
"resourceRoots": {
"my.component": "<path to the component>"
},
...
I did not change mta.yaml or xs-app.json
NOTE: in my case the url for the app which contains the external component is:
https://xxxxxxxxtrial.launchpad.cfapps.us10.hana.ondemand.com/f1dd6008-c7a8-4ca3-b3d0-e3414e98544e.m...
myService is defined in the manifest.json in sap.cloud section with service
myApplication is defined in the manifet.json in sap.app section with id
both without dot
so for me <path to the component> was "../f1dd6008-c7a8-4ca3-b3d0-e3414e98544e.myService.myApplication"
Note that I do not specify the version (here 0.0.1) in order to have the newest version.
I do not know if it is the best solution but I hope it will help you.
Regards
Fabrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much. Your solution is working great.
At the end I changed your solution a little bit and programmatically register the module path in component.js like this:
jQuery.sap.registerModulePath(my.component, <path to the component>);
This way I can change the path to the component according to the environment (e.g. local).
Hi Christian & Fabrice,
Thanks for provide some solutiuon but is it possible for anyone of you to share the manifest.json file of working application.
Thanks & Regards
Wasim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.