2 つのアプリケーションがあります。
- hrportalcore : BaseController を備えたコア アプリケーション、...
- hrportalrequestleave : hrportalcore アプリケーションから拡張されたサンプル アプリケーション
hrportalcore には名前空間de.example.coreがあり、dataSourcesも維持されています。( sap.app.dataSources
manifest.json 内)。データソースは次のとおりです。
[...]
"HRPOJavaLeave": {
"uri": "<path>",
"type": "OData",
"settings": {
"annotations": [],
"odataVersion": "2.0",
"localUri": ""
}
}
[...]
データソースは拡張アプリケーションで問題なく使用できますが、コンソールには次のエラーが表示されます。
データソースにエラーが含まれていると表示されますが、使用できます (変ですか?)。
もう 1 つの問題は、Component-preload.js ファイルが一度間違った場所からロードされることです。アプリケーションは問題なく動作しますが、前述のように、間違った場所から 1 回読み込まれますか?
私の hrportalrequestleave の manifest.json は、拡張部分 ( sap.ui5.extends
)のようになります。
[...]
"extends": {
"component": "de.example.core",
"extensions": {}
},
[...]
親は、 hrportalcore に表示されるように、 neo-app.json/parent
で正しく定義されています。
jQuery.sap.declare("de.example.request.leave.Component");
// use the load function for getting the optimized preload file if present
if (!jQuery.sap.isDeclared("de.example.core.Component")) {
sap.ui.component.load({
name: "de.example.core",
// Use the below URL to run the extended application when SAP-delivered application is deployed on cloud
url: jQuery.sap.getModulePath("de.example.request.leave") + "/parent"
// we use a URL relative to our own component
// extension application is deployed with customer namespace
});
}
this.de.example.core.Component.extend("de.example.request.leave.Component", {
metadata: {
manifest: "json"
}
});
これはすべて、HANA Cloud Platform の Fiori Launchpad で行われます