SAP OData offline store在Android平台的技术实现

简介: SAP OData offline store在Android平台的技术实现

I am studying Kapsel OData offline plugin recently. In SAP help the source code of OData.js is provided:image.pngThe 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.image.png(2) Open this index.html, there is a script file “createStores.js”:image.pngThis file has constructed an object sap.smp.registratiimage.pngThere 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.image.pngIn implementation of _setupStore, the sap.OData.createOfflineStore(properties) and sap.OData.applyHttpClient() mentioned in sap help could be found.image.png(3) back to index.html, there is a file contentplace.js:

image.pngIn this file, offline store will be opened in line 14, and application specific initialization is called in callback function defined in line 5.image.png(4) finally, the createContentPlaceFunction is called in index.html in line 196:

image.png(5) Now check how OfflineStore open is implemented in Android platform via Java:

image.pngimage.pngAnd open operation is started here:image.pngCheck in ODataOfflineStore class, a new thread is created to perform open action:image.pngIn run method, the call is delegated back to ODataOfflineStore.openStoreSync:image.pngThe core open operation is done in this.store.open:image.pngIf open is done successfully, the listener registered in ODataOfflineStore instance will be notified with ODataOfflineStoreOpen state:image.pnghe core implementation of open method in Store class is implemented natively and could not be visible in Java stack:image.png



相关文章
|
6月前
|
BI
123. SAP ABAP 显式增强技术之 New BAdI 的技术原理介绍
123. SAP ABAP 显式增强技术之 New BAdI 的技术原理介绍
|
6月前
|
XML 数据处理 数据格式
什么是 SAP UI5 XML Templating 技术
什么是 SAP UI5 XML Templating 技术
|
6月前
|
BI
SAP ABAP 显式增强技术之 New BAdI 的技术原理介绍试读版
SAP ABAP 显式增强技术之 New BAdI 的技术原理介绍试读版
SAP ABAP 各种增强技术(Enhancement)概述 - 所谓第一代,第二代,第三代增强技术的出处试读版
SAP ABAP 各种增强技术(Enhancement)概述 - 所谓第一代,第二代,第三代增强技术的出处试读版
|
6月前
|
存储 对象存储 开发者
SAP CRM attachment 存储模型的技术属性详解
SAP CRM attachment 存储模型的技术属性详解
SAP CRM attachment 存储模型的技术属性详解
SAP ABAP ALV 的分组显示和 Subtotal 显示实现的技术步骤试读版
SAP ABAP ALV 的分组显示和 Subtotal 显示实现的技术步骤试读版
122. SAP ABAP 各种增强技术(Enhancement)概述 - 所谓第一代,第二代,第三代增强技术的出处是?
122. SAP ABAP 各种增强技术(Enhancement)概述 - 所谓第一代,第二代,第三代增强技术的出处是?
|
6月前
|
机器学习/深度学习 人工智能 监控
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
|
6月前
|
前端开发 JavaScript NoSQL
【2023版】作为一名 ABAP 资深顾问,下一步可以选择哪一门 SAP 技术作为主攻方向?
【2023版】作为一名 ABAP 资深顾问,下一步可以选择哪一门 SAP 技术作为主攻方向?
|
6月前
|
BI
SAP ABAP 显式增强技术之 New BAdI 的实战介绍 - 如何创建和激活增强实现试读版
SAP ABAP 显式增强技术之 New BAdI 的实战介绍 - 如何创建和激活增强实现试读版