Created by Wang, Jerry on Oct 23, 2016
<!DOCTYPE html>
<html class="sapUShellFullHeight">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<script>
window["sap-hana-uis-build-timestamp"] = "bk.timestamp";
window["sap-hana-uis-fiori-config"] = {
defaultFioriSiteID: "sap|hana|uis|content|hanahome|HANAHomePage"
};
</script>
<script type="text/javascript">
window["sap-ushell-config"] = {
platform: "fiori",
defaultRenderer: "fiori2",
renderers: {
fiori2: {
componentData: {
config: {
header: "hidden"
}
}
}
}
};
window["useODataPrefix"] = true;
(function(){
"use strict";
var initSite = {
bootTaskIsDoneCallback: undefined,
redirectToLoginPage: false,
finishLoadingAppSiteJSON: false,
getBootstrapScriptTags: function getBootstrapScriptTags(){
return ['<script src="../../bootstrap/uis_fiori.js?ts=' + window["sap-hana-uis-build-timestamp"] +'"><\/script>',
'<script id="sap-ui-bootstrap" src="/sap/ui5/1/resources/sap/fiori/core-min-0.js?ts=' + window["sap-hana-uis-build-timestamp"] +'"',
'data-sap-ui-evt-oninit="main(); ',
'"data-sap-ui-xx-bindingSyntax="complex" ',
'data-sap-ui-libs="sap.fiori,sap.m,sap.hana.uis" ',
'data-sap-ui-theme="sap_bluecrystal" ',
'data-sap-ui-compatVersion="1.16" ',
'data-sap-ui-logLevel=ERROR>',
'<\/script>'].join('');
},
getDebugCoresScriptTags: function getDebugCoresScriptTags(){
return ['<script src="/sap/ui5/1/resources/sap/fiori/core-min-1.js?ts=' + window["sap-hana-uis-build-timestamp"] +'"><\/script>',
'<script src="/sap/ui5/1/resources/sap/fiori/core-min-2.js?ts=' + window["sap-hana-uis-build-timestamp"] +'"><\/script>',
'<script src="/sap/ui5/1/resources/sap/fiori/core-min-3.js?ts=' + window["sap-hana-uis-build-timestamp"] +'"><\/script>'].join('');
},
loadBootstrapAndCores: function loadBootstrapAndCores(){
var bDebugSources = /sap-ui-debug=(true|x|X)/.test(window.location.search),
sScriptTags;
try {
bDebugSources = bDebugSources || (window.localStorage.getItem("sap-ui-debug") == "X");
}catch(e) {
if (window.console && window.console.log){
console.log('failed to read debug mode from local storage');
}
}
window["sap-ui-debug"] = bDebugSources;
sScriptTags = this.getBootstrapScriptTags();
if (!window["sap-ui-debug"]) {
sScriptTags += this.getDebugCoresScriptTags();
}
window.document.write(sScriptTags);
},
requestSite: function requestSite(sURL, fnCallback) {
var oXHR = new XMLHttpRequest();
oXHR.open("GET", sURL + "?_=" + new Date().getTime(), true);
oXHR.setRequestHeader("X-CSRF-Token", "fetch");
oXHR.setRequestHeader("Accept", "application/json");
oXHR.onreadystatechange = function onReadyStateChange() {
if (this.readyState === 2) {
if (oXHR.getResponseHeader('x-sap-login-page')){
initSite.redirectToLoginPage = true;
}
}
if (this.readyState !== 4) {
return;
}
if (initSite.redirectToLoginPage){
initSite.redirectLoginPage(oXHR);
return;
}
var responsecsrftoken = oXHR.getResponseHeader('responsecsrftoken');
if( oXHR.getResponseHeader('content-type').indexOf('text/html') >= 0 ) {
}
if (typeof sap !== "undefined" && sap.hana !== undefined && sap.hana.uis.CRUDManager !== undefined) {
sap.hana.uis.CRUDManager.updateConfig({csrfToken: responsecsrftoken});
} else {
window.csrfToken = responsecsrftoken;
}
fnCallback(
oXHR.status,
responsecsrftoken,
oXHR.responseText
);
};
oXHR.send();
},
getURLParameter: function getURLParameter(name) {
var value = (new RegExp(name + '=' + '(.+?)(&|$)', 'i').exec(location.search) || [null, null])[1];
return value !== null ? decodeURIComponent(value) : undefined;
},
isRTLLocale: function isRTLLocale(sLocale) {
var aRTL_LOCALES = ['ar', 'fa', 'he', 'iw'];
sLocale = sLocale.toLowerCase().substring(0, 2);
return aRTL_LOCALES.indexOf(sLocale) >= 0;
},
createCSSLinkTag: function createCSSLinkTag(oStartUpResult) {
var sThemePath = oStartUpResult.theme.rootPath || '',
sThemeName = oStartUpResult.theme.name || '',
sLanguage = oStartUpResult.languageBcp47 || '',
bIsRTL = this.isRTLLocale(sLanguage),
sFileName,
oLink;
if (sThemePath && !initSite.getURLParameter('sap-theme')) {
oLink = window.document.createElement('link');
sFileName = bIsRTL ? "library-RTL.css" : "library.css";
var fixPath = 'sap/fiori/themes/';
oLink.setAttribute('href', sThemePath + fixPath + sThemeName + '/' + sFileName);
oLink.setAttribute('rel', 'stylesheet');
oLink.setAttribute('id', 'sap-ui-theme-sap.fiori');
window.document.head.appendChild(oLink);
}
},
getSiteJson: function getSiteJson(successCallback, failCallback){
var fioriConfig = window["sap-hana-uis-fiori-config"] || {};
var fioriSiteID = fioriConfig.defaultFioriSiteID || "sap|hana|uis|content|hanahome|HANAHomePage";
var GET_SITE_V2 = "/sap/hana/uis/server/rest/v2/sites/";
fioriSiteID = this.getURLParameter('siteID') || fioriSiteID;
var sUrl = GET_SITE_V2 + fioriSiteID;
window["sap-hana-uis-fiori-model-preload-status"] = "loading";
this.requestSite(sUrl, function(iStatus, sCsrfToken, sResponse) {
if (iStatus !== 200) {
failCallback(iStatus);
return;
}
successCallback.bind(this)(sResponse);
});
},
loadAppSite: function loadAppSite(){
this.getSiteJson(function successCallback(sResponse){
try{
window["sap-hana-uis-fiori-model"] = JSON.parse(sResponse);
}catch(e){
window["sap-hana-uis-fiori-model-preload-status"] = "failed";
if (window.console && window.console.log) {
console.log('JSON parse failure: ' + e);
}
}
window["sap-hana-uis-fiori-model-preload-status"] = "loaded";
if (window["sap-hana-uis-fiori-model"] && window["sap-hana-uis-fiori-model"].site.theme !== undefined){
initSite.createCSSLinkTag({
theme: window["sap-hana-uis-fiori-model"].site.theme
});
}
initSite.finishLoadingAppSiteJSON = true;
if (initSite.bootTaskIsDoneCallback !== undefined){
initSite.bootTaskIsDoneCallback.bind(window)();
}
},
function failCallback(iStatus){
if (window.console && window.console.log) {
console.log('Unable to get app site JSON, server response code is: ' + iStatus);
}
window["sap-hana-uis-fiori-model-preload-status"] = "failed";
});
},
redirectLoginPage: function redirectLoginPage(xhr) {
var loginUrl = xhr.getResponseHeader('x-sap-login-page');
var r = new RegExp('^(?:[a-z]+:)?//', 'i');
if (loginUrl.indexOf('/') === 0 && !r.test(loginUrl)) {
var href = window.location.pathname + window.location.search + window.location.hash;
window.location.href = loginUrl + '?x-sap-origin-location=' + encodeURIComponent(href);
}
}
};
window['sap-ui-config'] = {
"xx-bootTask": function (fnCallback) {
window.initFioriModulePaths();
var bootstrap = function bootstrap() {
if (window["sap-hana-uis-fiori-model"]
&& window["sap-hana-uis-fiori-model"].site.theme !== undefined
&& window["sap-hana-uis-fiori-model"].site.theme.name !== undefined
&& window["sap-hana-uis-fiori-model"].site.theme.rootPath !== undefined) {
sap.ui.getCore().applyTheme(
window["sap-hana-uis-fiori-model"].site.theme.name,
window["sap-hana-uis-fiori-model"].site.theme.rootPath
);
}
fnCallback();
};
if (initSite.finishLoadingAppSiteJSON || !!initSite.getURLParameter('sap-theme')){
bootstrap();
}else{
initSite.bootTaskIsDoneCallback = bootstrap;
}
}
};
initSite.loadBootstrapAndCores();
initSite.loadAppSite();
}());
</script>
<script type="text/javascript">
function main() {
"use strict";
sap.ushell.bootstrap("fiori").done( function(){
var oFactory = sap.ushell.Container.getService("PageBuilding").getFactory();
oFactory.createChipDefinition("/sap/hana/uis/clients/ushell-app/external-files/chips/applauncher.chip.xml",function(){},function(){});
oFactory.createChipDefinition("/sap/hana/uis/clients/ushell-app/external-files/chips/applauncher_dynamic.chip.xml",function(){},function(){});
jQuery.sap.require("sap.ushell.iconfonts");
jQuery.sap.require("sap.ui2.srvc.contracts.bag");
jQuery.sap.require("sap.ui2.srvc.contracts.configuration");
jQuery.sap.require("sap.ui2.srvc.contracts.configurationUi");
jQuery.sap.require("sap.ui2.srvc.contracts.fullscreen");
jQuery.sap.require("sap.ui2.srvc.contracts.preview");
jQuery.sap.require("sap.ui2.srvc.contracts.visible");
jQuery.sap.require("sap.ui2.srvc.contracts.refresh");
jQuery.sap.require("sap.ui2.srvc.contracts.searchProvider");
jQuery.sap.require("sap.ui2.srvc.contracts.search");
jQuery.sap.require("sap.ui2.srvc.contracts.url");
sap.ui2.srvc.Chip.addContract("navigation", function(oChipInstance) {
this.navigateToUrl = function(sUrl, oSettings) {
jQuery.sap.require("sap.ui2.srvc.error");
throw new sap.ui2.srvc.Error("'navigation' contract not implemented!",
"sap.ushell.adapters.abap.LaunchPageAdapter");
};
});
sap.ushell.iconfonts.registerFiori2IconFont();
jQuery.sap.require("sap.ushell.functionBindPrototype");
var oContent = sap.ushell.Container.createRenderer("fiori2");
jQuery("#canvas").empty();
oContent.placeAt("canvas");
sap.ushell.Container.logout = function logout() {
var platform = "fiori";
var sAdapterName = "sap.ushell.adapters." + platform + ".ContainerAdapter";
jQuery.sap.require(sAdapterName);
var adapter = new (jQuery.sap.getObject(sAdapterName))(new sap.ushell.System({
alias: "",
platform: platform
}), {});
adapter.logout(true);
};
jQuery(document).keydown(function (e) {
if (e.ctrlKey && e.altKey && e.keyCode === 71) {
jQuery("#dbg_grid_overlay").toggle();
}
});
});
}
</script>
</head>
<body class="sapUiBody sapUShellFullHeight" role="application">
<div id="canvas" class="sapUShellFullHeight">
<div id="fiori2-startup-flower" class="demo">
<div class="fiori2-blossom">
<div class="fiori2-leafContainer fiori2-leafContainer1">
<div class="fiori2-leaf fiori2-leaf1"></div>
</div>
<div class="fiori2-leafContainer fiori2-leafContainer2">
<div class="fiori2-leaf fiori2-leaf2"></div>
</div>
<div class="fiori2-leafContainer fiori2-leafContainer3">
<div class="fiori2-leaf fiori2-leaf3"></div>
</div>
<div class="fiori2-leafContainer fiori2-leafContainer4">
<div class="fiori2-leaf fiori2-leaf4"></div>
</div>
<div class="fiori2-leafContainer fiori2-leafContainer5">
<div class="fiori2-leaf fiori2-leaf5"></div>
</div>
</div>
</div>
</div>
<div id="dbg_grid_overlay" style="position: absolute;z-index: 1000;background-image: url('../fiori/img/grid.png');
width: 100%;height: 100%;opacity: 0.1;top: 0;left: 0;display:none;"></div>
</body>
</html>