SAP C4C url Mashup的跳转工作原理

一个例子:

我在SalesLead TI页面的这个tab里配置了一个url Mashup,点击之后会跳转到bing的页面:

然而从Chrome开发者工具的Elements标签页里并未看到target url.


这个mashupID末尾为10,我在运行时点击之后:

在Chrome开发者工具的network标签页里,看到一个HTTP请求去读取Mashup component:

下图可见,我们在RUI里创建Mashup,保存之后生成的也是一个UI component:





相关的Mashup实现文件:



https://c4cstatic.hana.ondemand.com/resourcesvc/2002.2.1.0.1583807562475/SAP_UI/HTML5/resources/sap/client/mashup/common/util/Util-dbg.js

https://c4cstatic.hana.ondemand.com/resourcesvc/2002.2.1.0.1583807562475/SAP_UI/HTML5/resources/sap/client/mashup/rt/util/InportAdapter-dbg.js

注意,url mashup lazy load,未点超链接之前,没有url生成,也没有上述这些文件的加载。
点击超链接之后:



传递到Mashup的输入参数,在InportAdapter._getSystemParameters里生成:







下面这行代码执行完之后,新的Chrome tab就打开了:

that.emit("inportFired", mData);

InportFire的处理函数:



从inport里解析出action:


跳转的目的地已经维护在oAction变量里了:

oService.createUrl, 开始拼凑Mashup的url了:


https://c4cstatic.hana.ondemand.com/resourcesvc/2002.2.1.0.1583807562475/SAP_UI/HTML5/resources/sap/client/mashup/common/model/MashupComponentModelService-dbg.js?eval

最后打开浏览器新窗口的代码是在window.open里实现的:


要获取更多Jerry的原创文章,请关注公众号"汪子熙":

原文地址:https://www.cnblogs.com/sap-jerry/p/12530139.html