Need to load the UI5 Module from Other Host in SAP Fiori
Asked Answered
S

1

8

We have 2 applications one is SAP Fiori App which is deployed in SAP ABAP repository and another app which is written OpenUI5 which is not related to SAP so we have deployed in Apache Tomcat.

We need to Integrate these 2 applications like on clicking of a button in Fiori app need to open the OpenUI5 app.

Problem is the Module (App) Which is deployed on Tomcat is not able open because when we registerModulePath the domian is not taking by Fiori

    jQuery.sap.addUrlWhitelist("http", "tomcat.server.host", "7070", "/tomcatapp/resources/js/ui5widgets");

    jQuery.sap.registerModulePath("com.xxx.yyy", "http://tomcat.server.host:7070/tomcatapp/resources/js/ui5widgets");

when i require

error is

core-min-0-dbg.js:17351 Uncaught Error: failed to load 'com/xxx/yyy/aaa/bbb.js' from /sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js: 

0 - AbortError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://sap.netweaver.net:2020/sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js'.(…)
Sensationalism answered 6/8, 2016 at 6:5 Comment(8)
You are not overridding an existing package name by any chance?Affairs
no, i am using same package namesSensationalism
Does the path of 'com/xxx/yyy/aaa/bbb.js' get resolved correctly if you use a relative path? I just wonder why it fails to load from 'sap.netweaver.net:2020/sap/bc/ui5_ui5/ui2/ushell/resources/…' which is not the path you registered.Affairs
the 'com/xxx/yyy/aaa/bbb.js' in not deployed in the 'sap.netweaver.net:2020' its in tomcat server.Sensationalism
I understood that. Could you anyways temporarily register it under a relative path just to see if the path com.xxx.yyy.aaa.bbb resolves correctly under that circumstances?Affairs
i have deployed a new BSP Application and deployed to it.. i need to do these jQuery.sap.registerResourcePath("com.xxx.yyy", '/sap/bc/ui5_ui5/sap/tomcat_app/'); jQuery.sap.registerModulePath("com.xxx.yyy", '/sap/bc/ui5_ui5/sap/tomcat_app/'); jQuery.sap.require("com.xxx.yyy.aaa.bbb");Sensationalism
and if you run this and open network tab from where does it try to load com.xxx.yyy.aaa.bbb?!Affairs
sap.netweaver.net:2020/sap/bc/ui5_ui5/…Sensationalism
A
1

If I do

jQuery.sap.registerModulePath("test.test", "http://www.google.de");
jQuery.sap.require("test.test.MyTest");

The file is correctly resolved to http://www.google.de/MyTest.js.

Are you sure that your package name is not overridden by something else? e.g. a package name like 'sap.ui.something' will obviously be a bad idea. But there are less obvious examples. May be you show a little more/real code?

Anyways you will have to take care of CORS

Affairs answered 11/8, 2016 at 9:18 Comment(1)
@Sensationalism I don't quite get how this solved your problem but thanks for accepting anyways ;)Affairs

© 2022 - 2024 — McMap. All rights reserved.