zoukankan      html  css  js  c++  java
  • 使用nodejs将SAP Fiori应用置于本地Launchpad运行

    In the blog Step by step to run your Fiori application locally on NodeJS the steps to run your Fiori application locally by using NodeJS as server are introduced. In that solution, the Fiori application is launched in a standalone mode where sap.ushell.Container is not available. Additionally there is a requirement to put Fiori application to local launchpad as sandbox for unit test purpose.

    Final archievement is: you can see a tile for your Fiori project in the local launchpad.
    Once tile is clicked, you can see your Fiori application in the local shell.

    The major required six steps are logically the same as previous blog.

    Step 1 ~ Step4: exactly the same as steps in previous blog.
    Step 5: the only needed modification on Gruntfile.js is, you should launch a new html page which creates a local launchpad.

    Step 6: Create another html page Sandbox.html.

    Key points

    (1) declare a dummy render and the navigation target application information when a tile is clicked.

    (2) Include sandbox.js :

    (3) In Sandbox.html, instead of using ComponentContainer, now we should create the configured renderer using API sap.ushell.Container.createRenderer to leverage on local launchpad instead.
    The complete source code of my Sandbox.html for your reference:

    <!DOCTYPE HTML>
    <html>
    
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <title>Jerry's test Fiori application</title>
    
            <script>
            window["sap-ushell-config"] = {
              defaultRenderer : "fiori2",
              renderers: {
                fiori2: {
                  componentData: {
                    config: {
                      search: "hidden"
                    }
                  }
                }
              },
             
              applications: {
                "jerrytestfiori-display": {
                  additionalInformation: "SAPUI5.Component=JerryTest",
                  applicationType: "URL",
                  url: "./",
                  title: "Jerry test Fiori application"
                }
              }
            };
            </script>
    
            <script src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script>
    
    
            <script src="/resources/sap-ui-core.js"
                    id="sap-ui-bootstrap"
                    data-sap-ui-libs="sap.m, sap.ushell, sap.ui.comp"
                    data-sap-ui-theme="sap_bluecrystal"
                    data-sap-ui-xx-bindingSyntax="complex">
            </script>
    
    
            <script>
                sap.ui.getCore().attachInit(function() {
                        sap.ushell.Container.createRenderer().placeAt("content");
                    });
            </script>
        </head>
    
        <body class="sapUiBody" role="application">
            <div id="content"></div>
        </body>
    
    </html>
    

    In the runtime, once the tile is clicked, my Fiori application is opened:

    The creation of configured render “fiori2” could be debugged from here:

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

  • 相关阅读:
    【转】我该 不该学习VULKAN
    游戏开发内功秘籍记录
    VS 配置外部DLL的引用路径【可执行文件的环境路径】
    OpenGL3.x,4.x中使用FreeImage显示图片的BUG-黑色,或颜色分量顺序错乱
    C++风格与C风格文件读写效率测试-vs2015,vs2017
    【转】矩阵的几何解释
    android 线程间通信
    android 网络
    安卓 碎片 如何实现类似 活动 栈的 进栈 出栈
    安卓 内容提供者 观察者 解析器
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13607072.html
Copyright © 2011-2022 走看看