Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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'.(…)
like image 650
chiranjeevigk Avatar asked Aug 06 '16 06:08

chiranjeevigk


People also ask

How do you deploy custom UI5 on the Fiori launchpad?

From the side navigation panel in your Supplier Portal site, click Content Management and select Apps to open the Manage App Configuration editor. Click + at the bottom of the Apps panel to add a new app. The Properties tab is now in focus. Go to the App Resource field and click the browse icon.

How can I use third party library in UI5?

You can create a file named- moment. js and paste the code that has been copied from third party library website. This code can be included in your UI5 app using the library - index. html.

Can external third party libraries advisable to refer in SAP UI5 apps?

Although third party modules don't use UI5 APIs, they still can be listed as dependencies in a sap. ui. define call. They will be requested and executed like UI5 modules, but their module value will be undefined.


1 Answers

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

like image 113
cschuff Avatar answered Sep 28 '22 18:09

cschuff