首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Cloud for Customer的主页加载逻辑

Cloud for Customer的主页加载逻辑

作者头像
Jerry Wang
发布2019-05-31 08:48:38
7580
发布2019-05-31 08:48:38
举报

先看源代码:

<!DOCTYPE HTML>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!--
		If you change the scaling here, dont forget to change it at sap.client.controls.core.Application.prototype._adjustViewPort as well
	 -->
	<meta name="viewport" content="width=device-width, minimum-scale=1.25, maximum-scale=1.25"/>
	<script src="resources/sap-ui-cachebuster/sap-ui-core.js" type="text/javascript"
			id="sap-ui-bootstrap"
			data-sap-ui-libs="sap.ui.layout, sap.ui.commons"
			data-sap-ui-preload="async"
			data-sap-ui-xx-bindingSyntax="complex"
			data-sap-ui-theme="skyline" >
	</script>

	<script type="text/javascript" id="sap-client-application"
		data-sap-client-gitCommitId="ef2e7f1c05c452bf6236641fc226cea497b68e0e"
		data-sap-client-mavenArtifactVersion="SNAPSHOT version" 
		data-sap-client-buildTimestamp="254" 
			data-sap-byd-debugMode="false"
			data-sap-client-language="en"
			data-sap-client-application-name="SAP Business ByDesign"
			src="resources/sap/client/ApplicationStarter.js">
	</script>
	<script>jQuery.sap.require("sap.client.thirdparty.jqueryui.jquery-ui-min");</script>
	<style type="text/css">
		html, body {
			height: 100%;
			margin: 0;
			padding: 0;
		}
	</style>

	<!-- make myself the window owner for 1308!-->
	<style type="text/css"> html{display : none ; } </style>
	<script type="text/javascript">

		if (self == top) {
			document.documentElement.style.display = 'block';
		} else {
			top.location = self.location;
		}
	</script>

</head>
<body class="sapUiBody" role="application">
<div id="content" style="height: 100%"></div>
</body>
</html>

这个index.html加载的请求url:

https://sap/public/ap/ui/repository/SAP_UI/HTML5/client.html?app.component=/SAP_UI_CT/Main/root.uiccwoc&rootWindow=X&redirectUrl=/sap/public/byd/runtime

因为Cloud for Customer的UI也是基于UI5框架实现的,故接下来需要加载sap-ui-core.js:

https://sap/public/ap/ui/repository/SAP_UI/HTML5/resources/sap-ui-cachebuster/sap-ui-core.js

使用document.write动态加载新的jscript标签:

clipboard3
clipboard3
clipboard4
clipboard4

下面这段代码是SAP UI5里对调试版本的JavaScript文件的加载实现:

clipboard5
clipboard5

client.html?app…i/byd/runtime UIArea-dbg.js?eva sap-ui-core.js sap-ui-core.js:formatted jquery.sap.global-dbgjs × |>window [“sap-ui-debug”] = vDebugInfo =vDebugInfo I1 true; 56957057357257574575570575755798058158583 if (window[“sap-ui-optimized”] && vDebugInfo ) {// if current sources are optimized and any debug sources should be used, enable the “-dbg” suffixindow [“sap-ui-loaddbg”] = true;11 if debug sources should be used in general, restart with debug URif (vDebuginfo === true ) {var sDebugurl =_oBootstrap.url.replace(八/(?:sap-ui-cachebuster/)? ([^/]+).js/, “/$1-dbg.js”);window [“sap-ui-optimized”] = falseHocument.write("<script type=“text/javascript” src="" + sDebugurl + “”");var oRestart =new Error ("This is not a real error. Aborting UI5 bootstrap and restarting from: " + sDebugurl);oRestart.name = “Restart”:throw oRestart;

WorkCenter WorkCenterModel ComponentModel sap/client/nav then a http post: https://sap/ap/ui/json

然后是一个HTTP post请求:

{"fuba":{"name":"00163E01065F02DE83D0F2780D8BC056","imports":{"IV_CACHE_KEY":"E$BC135D2FF914825F2728E7B636C5828F3DDD078C$X","IV_WOC_SEQ":true,"IV_INCLUDE_CC":true,"IV_INCLUDE_INV":false,"IV_WITH_COMMON_TASKS":"X"}}}
clipboard7
clipboard7
clipboard8
clipboard8
clipboard9
clipboard9
clipboard10
clipboard10

https://sap/ap/ui/json?app.component=/SAP_UI_CT/Main/root.uiccwoc&h=47078d04baa8890e992100506a0f3276&g=b0181c02b0aec5337da81f77b15fbb85 FM_MASS_CHECK_RAW_CACHE_KEY

clipboard11
clipboard11
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年04月22日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档