SAP Fiori Elements 应用里 flpSandbox.html 的作用

本人教程里应用加载的这个文件:

SAP Fiori Elements 开发教程 - 从入门到精通

<!DOCTYPE HTML>
<html lang="en">
<!-- Copyright (c) 2015 SAP AG, All Rights Reserved -->
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{
   
   {appTitle}}</title>

    <!-- Bootstrap the unified shell in sandbox mode for standalone usage.

         The renderer is specified in the global Unified Shell configuration object "sap-ushell-config".

         The fiori2 renderer will render the shell header allowing, for instance,
         testing of additional application setting buttons.

         The navigation target resolution service is configured in a way that the empty URL hash is
         resolved to our own application.

         This example uses relative path references for the SAPUI5 resources and test-resources;
         it might be necessary to adapt them depending on the target runtime platform.
         The sandbox platform is restricted to development or demo use cases and must NOT be used
         for productive scenarios.
    -->
    <script type="text/javascript">
        window["sap-ushell-config"] = {
      
      
            defaultRenderer: "fiori2",
            bootstrapPlugins: {
      
      
                "RuntimeAuthoringPlugin": {
      
      
                    component: "sap.ushell.plugins.rta",
                    config: {
      
      
                        validateAppVersion: false
                    }
                }
            },
            renderers: {
      
      
                fiori2: {
      
      
                    componentData: {
      
      
                        config: {
      
      
                            search: "hidden"
                        }
                    }
                }
            },
            applications: {
      
      
                "jerryfiorielement01-tile": {
      
      
                    title: "Jerry Fiori Element 01",
                    description: "Jerry Fiori Element 01",
                    additionalInformation: "SAPUI5.Component=jerryfiorielement01",
                    applicationType: "URL",
                    url: "../"
                }
            }
        };
    </script>

    <script src="../test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script>
    <!-- Bootstrap the UI5 core library. 'data-sap-ui-frameOptions="allow"'' is a NON-SECURE setting for test environments -->
    <script id="sap-ui-bootstrap"
        src="../resources/sap-ui-core.js"
        data-sap-ui-libs="sap.m,sap.ui.core,sap.ushell,sap.f,sap.ui.comp,sap.ui.generic.app,sap.suite.ui.generic.template"
        data-sap-ui-async="true"
        data-sap-ui-preload="async"
        data-sap-ui-theme="sap_horizon"
        data-sap-ui-compatVersion="edge"
        data-sap-ui-language="en"
        data-sap-ui-resourceroots='{"jerryfiorielement01": "../"}'
        data-sap-ui-frameOptions="allow"
        data-sap-ui-flexibilityServices='[{"applyConnector":"jerryfiorielement01/test/changes_loader", "custom":true}]'>
    </script>
    <script id="locate-reuse-libs" src="../utils/locate-reuse-libs.js" data-sap-ui-manifest-uri="../manifest.json">
    </script>

        <script>
            sap.ui.getCore().attachInit(async function() {
      
      
                if (sap && sap.ushell && sap.ushell.Container) {
      
      
                    Promise.all([sap.ushell.Container.getServiceAsync('URLParsing'), sap.ushell.Container.getServiceAsync('AppState')]).then((aPromises) => {
      
      
                        var oURLParser = aPromises[0];
                        var oAppState = aPromises[1];
                        var oURLParams = oURLParser.parseParameters(window.location.search);
                        var sFioriToolsAppState = 'fiori-tools-iapp-state';
                        var sFioriToolsAppStateValue = oURLParams[sFioriToolsAppState] && oURLParams[sFioriToolsAppState][0].toLowerCase();

                        if (sFioriToolsAppStateValue !== "true") {
      
      
                            var aURLParameters = window.location.hash.split("/");
                            var sAppState = 'sap-iapp-state';

                            for (var i = 0; i < aURLParameters.length; i++) {
      
      
                                var oShellParams = oURLParser.parseParameters(aURLParameters[i]);
                                for (var parameter in oShellParams) {
      
      
                                    if (parameter.indexOf(sAppState) !== -1) {
      
      
                                        var sAppStateValue = oShellParams[parameter] && oShellParams[parameter][0];
            
                                        if (sAppStateValue) {
      
      
                                            oAppState.deleteAppState(sAppStateValue);
                                        }

                                    }
                                }
                            }
                        }
                    });
                }
            });
        </script>
    </head>

<!-- UI Content -->

<body class="sapUiBody" id="content">
<script src="//localhost:35729/livereload.js?snipver=1" async="" defer=""></script></body>

</html>

猜你喜欢

转载自blog.csdn.net/i042416/article/details/131656343