SAP OData offline store在Android平台的技术实现 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
I am studying Kapsel OData offline plugin recently. In SAP help the source code of OData.js is provided:
The source code clearly conveys the idea documented in SAP help: “When an offline store is first opened, it synchronizes with the OData producer. OData requests made against this plugin use the available open offline stores.“.
And I am curious how this offline store is opened in the real application. So I use a CRM Fiori offline application to have a look.
(1) In offline project folder there is a config.xml, which defines the entry point for offline application access, the index.html file.
(2) Open this index.html, there is a script file “createStores.js”:
This file has constructed an object sap.smp.registration:
There is a public method setup exposed which accepts an array for offline store collection and call a private method _setupStore one by one. Once the asynchronous setup process is done successfully, callback success is called.
In implementation of _setupStore, the sap.OData.createOfflineStore(properties) and sap.OData.applyHttpClient() mentioned in sap help could be found.
(3) back to index.html, there is a file contentplace.js:
In this file, offline store will be opened in line 14, and application specific initialization is called in callback function defined in line 5.
(4) finally, the createContentPlaceFunction is called in index.html in line 196:
(5) Now check how OfflineStore open is implemented in Android platform via Java:
In line 215, offline store instance is created and a listener is registered, since open operation is done asynchronously:
And open operation is started here:
Check in ODataOfflineStore class, a new thread is created to perform open action:
In run method, the call is delegated back to ODataOfflineStore.openStoreSync:
The core open operation is done in this.store.open:
If open is done successfully, the listener registered in ODataOfflineStore instance will be notified with ODataOfflineStoreOpen state:
The core implementation of open method in Store class is implemented natively and could not be visible in Java stack:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
下一篇: Ieda配置类、方法注释模板
推荐阅读
-
Product settype在CRM WebClient UI架构中的地位 SAPCRMSAP成都研究院SAP Cloud PlatformSAP云平台
-
使用SAP CRM中间件从ERP下载Customer的错误消息 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
SAP云平台上的Low Code Development(低代码开发)解决方案 SAPSAP云平台SAP Cloud PlatformSAP成都研究院C4C
-
SAP OData服务性能测量的四种办法 SAPSAP云平台SAP Cloud PlatformSAP成都研究院ABAP
-
一个有用的Chrome扩展应用:SAP UI5 Inspector SAP UI5SAPSAP云平台SAP Cloud PlatformSAP成都研究院
-
SAP Fiori应用里出现http request错误的原因分析 SAPSAP云平台SAP Cloud PlatformSAP成都研究院C4C
-
使用nodejs实现OData的batch操作在Marketing Cloud里读取contact信息 nodejsSAP成都研究院SAP Cloud PlatformSAP云平台Marketing Cloud
-
使用SAP CRM中间件从ERP下载Customer的错误消息 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
在S/4HANA扩展字段的Available Fields列表里,看不到自己创建的扩展字段该怎么办 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
SAP CRM Location Assignment的实现原理 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud