简体   繁体   English

需要从SAP Fiori中的其他主机加载UI5模块

[英]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. 我们有2个应用程序,一个是在SAP ABAP存储库中部署的SAP Fiori应用程序,另一个是与SAP不相关的OpenUI5编写的应用程序,因此我们已在Apache Tomcat中部署了该应用程序。

We need to Integrate these 2 applications like on clicking of a button in Fiori app need to open the OpenUI5 app. 我们需要集成这两个应用程序,例如在Fiori应用程序中单击按钮时需要打开OpenUI5应用程序。

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 问题是部署在Tomcat上的模块(App)无法打开,因为当我们注册ModulePath时,domian不会被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'.(…)

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 . 该文件已正确解析为http://www.google.de/MyTest.js

Are you sure that your package name is not overridden by something else? 您确定您的包裹名称没有被其他东西覆盖吗? eg a package name like 'sap.ui.something' will obviously be a bad idea. 例如,像“ sap.ui.something”这样的软件包名称显然不是一个好主意。 But there are less obvious examples. 但是,没有那么明显的例子。 May be you show a little more/real code? 您可能会显示更多/真实代码吗?

Anyways you will have to take care of CORS 无论如何,您将不得不照顾CORS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM