2016-11-21 38 views
0

我们有以下的发展环境为菲奥里何时到来:部署UI5应用启动板从菲奥里应用模板

网关7.4
后端:角色的SAP NetWeaver 7.4 SP15
本地Web IDE与猎户座版本160811

我们没有HCP,我们的网关在我们的网络中是本地的,我们也没有Web调度器或Sap路由器,这意味着我们不能直接从Web IDE部署,而是我们必须手动执行将文件夹上传到网关。

我们在Web IDE中从头创建了一个应用程序,并将其导出为zip,以便在启动板中进行部署。 在这种情况下,一切进展顺利,我们将该应用添加到rol或使用独立的url来测试它工作正常。

问题是,我们从Web IDE制作Fiori Worklist Template应用程序,然后尝试以与其他应用程序相同的方式部署它。

当我们运行应用程序的独立的网址,我们得到以下JavaScript错误:

Uncaught TypeError: Cannot read property 'createRenderer' of undefined. 

我们flpSandbox.html是以下(不包含HTML标签):

<script> 
     window["sap-ushell-config"] = { 
      defaultRenderer : "fiori2", 
      renderers: { 
       fiori2: { 
        componentData: { 
         config: { 
          search: "hidden" 
         } 
        } 
       } 
      }, 
      applications: { 
       "Notastest1-display": { 
        additionalInformation: "SAPUI5.Component=appnotatest", 
        applicationType: "URL", 
        url: "../", 
        description: "Despliegue de Notas Alumnos.", 
        title: "Calificaciones Mobile" 
       } 
      } 
     }; 
    </script> 

    <script src="../test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script> 

    <!-- Bootstrap the UI5 core library --> 
    <script id="sap-ui-bootstrap" 
      src="../resources/sap-ui-core.js" 
      data-sap-ui-libs="sap.ushell, sap.collaboration" 
      data-sap-ui-theme="sap_bluecrystal" 
      data-sap-ui-compatVersion="edge" 
      data-sap-ui-resourceroots='{"appnotatest": "../"}' 
      data-sap-ui-frameOptions='allow'> // NON-SECURE setting for testing environment 
    </script> 

    <script> 
     sap.ui.getCore().attachInit(function() { 
      // initialize the ushell sandbox component 
      sap.ushell.Container.createRenderer().placeAt("content"); 
     }); 
    </script> 

我们的清单:

{ 
"_version": "1.3.0", 
"sap.app": { 
    "_version": "1.3.0", 
    "id": "appnotatest", 
    "type": "application", 
    "i18n": "i18n/i18n.properties", 
    "title": "{{appTitle}}", 
    "description": "{{appDescription}}", 
    "applicationVersion": { 
     "version": "1.0.0" 
    }, 
    "dataSources": { 
     "mainService": { 
      "uri": "/sap/opu/odata/sap/ZNOTAS3_SRV/", 
      "type": "OData", 
      "settings": { 
       "odataVersion": "2.0", 
       "localUri": "localService/metadata.xml" 
      } 
     } 
    }, 
    "sourceTemplate": { 
     "id": "sap.ui.ui5-template-plugin.1worklist", 
     "version": "1.36.2" 
    } 
}, 
"sap.ui": { 
    "_version": "1.3.0", 
    "technology": "UI5", 
    "icons": { 
     "icon": "sap-icon://task", 
     "favIcon": "", 
     "phone": "", 
     "[email protected]": "", 
     "tablet": "", 
     "[email protected]": "" 
    }, 
    "deviceTypes": { 
     "desktop": true, 
     "tablet": true, 
     "phone": true 
    }, 
    "supportedThemes": [ 
     "sap_hcb", 
     "sap_bluecrystal" 
    ] 
}, 
"sap.ui5": { 
    "_version": "1.3.0", 
    "rootView": { 
     "viewName": "appnotatest.view.App", 
     "type": "XML", 
     "id": "app" 
    }, 
    "dependencies": { 
     "minUI5Version": "1.36.0", 
     "libs": { 
      "sap.ui.core": { 
       "minVersion": "1.36.0" 
      }, 
      "sap.m": { 
       "minVersion": "1.36.0" 
      }, 
      "sap.ushell": { 
       "minVersion": "1.36.0" 
      }, 
      "sap.collaboration": { 
       "minVersion": "1.36", 
       "lazy": true 
      } 
     } 
    }, 
    "resources": { 
     "css": [ 
      { 
       "uri": "css/style.css" 
      } 
     ] 
    }, 
    "contentDensities": { 
     "compact": true, 
     "cozy": true 
    }, 
    "models": { 
     "i18n": { 
      "type": "sap.ui.model.resource.ResourceModel", 
      "settings": { 
       "bundleName": "appnotatest.i18n.i18n" 
      } 
     }, 
     "": { 
      "dataSource": "mainService", 
      "settings": { 
       "metadataUrlParams": { 
        "sap-documentation": "heading" 
       } 
      } 
     } 
    }, 
    "routing": { 
     "config": { 
      "routerClass": "sap.m.routing.Router", 
      "viewType": "XML", 
      "viewPath": "appnotatest.view", 
      "controlId": "app", 
      "controlAggregation": "pages", 
      "bypassed": { 
       "target": [ 
        "notFound" 
       ] 
      }, 
      "async": true 
     }, 
     "routes": [ 
      { 
       "pattern": "", 
       "name": "worklist", 
       "target": [ 
        "worklist" 
       ] 
      }, 
      { 
       "pattern": "EntityAsignaturasSet/{objectId}", 
       "name": "object", 
       "target": [ 
        "object" 
       ] 
      } 
     ], 
     "targets": { 
      "worklist": { 
       "viewName": "Worklist", 
       "viewId": "worklist", 
       "viewLevel": 1 
      }, 
      "object": { 
       "viewName": "Object", 
       "viewId": "object", 
       "viewLevel": 2 
      }, 
      "objectNotFound": { 
       "viewName": "ObjectNotFound", 
       "viewId": "objectNotFound" 
      }, 
      "notFound": { 
       "viewName": "NotFound", 
       "viewId": "notFound" 
       } 
      } 
     } 
    } 
} 

最后但并非最不重要的是这是我们的component.js:

sap.ui.define([ 
    "sap/ui/core/UIComponent", 
    "sap/ui/Device", 
    "appnotatest/model/models", 
    "appnotatest/controller/ErrorHandler" 
], function (UIComponent, Device, models, ErrorHandler) { 
    "use strict"; 

    return UIComponent.extend("appnotatest.Component", { 

     metadata : { 
      manifest: "json" 
     }, 

     /** 
     * The component is initialized by UI5 automatically during the startup of the app and calls the init method once. 
     * In this function, the FLP and device models are set and the router is initialized. 
     * @public 
     * @override 
     */ 
     init : function() { 
      // call the base component's init function 
      UIComponent.prototype.init.apply(this, arguments); 

      // initialize the error handler with the component 
      this._oErrorHandler = new ErrorHandler(this); 

      // set the device model 
      this.setModel(models.createDeviceModel(), "device"); 
      // set the FLP model 
      this.setModel(models.createFLPModel(), "FLP"); 

      // create the views based on the url/hash 
      this.getRouter().initialize(); 
     }, 

     /** 
     * The component is destroyed by UI5 automatically. 
     * In this method, the ErrorHandler is destroyed. 
     * @public 
     * @override 
     */ 
     destroy : function() { 
      this._oErrorHandler.destroy(); 
      // call the base component's destroy function 
      UIComponent.prototype.destroy.apply(this, arguments); 
     }, 

     /** 
     * This method can be called to determine whether the sapUiSizeCompact or sapUiSizeCozy 
     * design mode class should be set, which influences the size appearance of some controls. 
     * @public 
     * @return {string} css class, either 'sapUiSizeCompact' or 'sapUiSizeCozy' - or an empty string if no css class should be set 
     */ 
     getContentDensityClass : function() { 
      /*if (this._sContentDensityClass === undefined) { 
       // check whether FLP has already set the content density class; do nothing in this case 
       if (jQuery(document.body).hasClass("sapUiSizeCozy") || jQuery(document.body).hasClass("sapUiSizeCompact")) { 
        this._sContentDensityClass = ""; 
       } else if (!Device.support.touch) { // apply "compact" mode if touch is not supported 
        this._sContentDensityClass = "sapUiSizeCompact"; 
       } else { 
        // "cozy" in case of touch support; default for most sap.m controls, but needed for desktop-first controls like sap.ui.table.Table 
        this._sContentDensityClass = "sapUiSizeCozy"; 
       } 
      } 
      return this._sContentDensityClass;*/ 
      } 

     }); 

    } 
); 

我们尝试创建另一个index.html来解决创建渲染,我们解决了错误,但应用程序仍然不起作用,它只显示没有瓦片的启动板。请记住,当我们从本地Web IDE测试应用程序时,首先会打开一个包含应用程序图块的启动板。

非常感谢您的帮助。

回答

1

这可能是与Netweaver系统上的UI5版本有关的问题。要测试此理论,请在Web IDE中使用Netweaver系统上的相同UI5版本运行该应用程序,以查看是否发生相同的错误。为了实现这一点,在Web IDE中右键单击你的项目 - >运行 - >运行配置... - >选择一个现有的运行配置或添加一个新的 - >高级设置选项卡 - >将ui5版本更改为与您的Netweaver系统上运行的相同 - >保存并运行。

如果遇到同样的问题,可能需要在Netweaver系统上更新UI5版本,或尝试在UI5应用中为此问题构建解决方法。

+0

试图找到高级设置选项卡,但我不能。显然,本地Web IDE没有这个选项,只有Web IDE的hcp版本。 –

+0

也许你可以同时运行,并使用浏览器控制台,手动检查版本: – donovantc

+0

sap.ui.versioninfo – donovantc