SAP OData请求是如何通过OData Plugin路由到OData Offline Data Store的-阿里云开发者社区

开发者社区> 开发者小助手-bz4> 正文

SAP OData请求是如何通过OData Plugin路由到OData Offline Data Store的

简介: SAP OData请求是如何通过OData Plugin路由到OData Offline Data Store的
+关注继续查看

I am reading Offline OData plugin introduction from SAP Help, There is one sentence “OData requests made against this plugin use the available open offline stores.“, and I am very curious about how this is done. As a result I had a look at my offline application project. I have found a plugin.xml file in folder kapsel-plugin-odata.



image.pngInside this xml another two JavaScript files are mentioned. According to plugin.xml specification provided in Cordova website, the window.sap.OData and window.sap.OfflineStore are so called JavaScript interfaces which can marshal a request from the WebView ( container of Offline application) to device native API.



image.pngSo open OData.js:image.pngkey implementation of OData.js and OfflineStore.js

(1) define a custom http request which will delegate the OData request to device native API.

A new httpClient is defined. Inside its request method, the requested url is compared against each offline supported url configured in array openStores. If matched, a flag handle is set as true.



image.pngimage.pngodata.request will call Cordova library’s exec method to access offline data store.image.png(2) configure this custom http client as default client. As a result every time a new OData request is in, by default this custom http client is called so offline data store is always tried to access first.



image.png(3) In my application project all urls which are supported for Offline access scenario are defined in manifest.json:

image.pngIn the runtime, this json object will be passed as input parameter for OData offline store implemented by function createOfflineStore.image.pngBy looking at implementation of OfflineStore(), we can know that this constructor does not perform Offline store initialization, but just parse every url specified by properties argument.


Instead, OfflineStore.open must be called and only after that, the offline store will then be available for mobile device to use.


image.png

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
Kubernetes + Spring Cloud 集成链路追踪 SkyWalking
分布式系统的应用程序性能监视工具,专为微服务、云原生架构和基于容器(Docker、K8s、Mesos)架构而设计。 提供分布式追踪、服务网格遥测分析、度量聚合和可视化一体化解决方案。
9 0
xshell+阿里云linux+vue+mysql开发练习
这篇文章记录了我在阿里云进行Linux基础学习的过程,以及根据阿里云进行一些简单的开发实践。
8 0
Java 简介(Java 发展概述)|学习笔记
快速学习 Java 简介(Java 发展概述)
5 0
冬季实战营第一期学习总结
冬季实战营第一期:https://developer.aliyun.com/adc/series/wintercamplist1
12 0
从零到一上手玩转云服务器
从零到一上手玩转云服务器
16 0
10S
冬季实战营第一期:从零到一上手玩转云服务器的学习报告
训练营日期:2022年1月17日 - 2022年1月23日,通过前五日从零学习云服务器,还能领取限量版盲盒等奖品
5 0
jquery获取多个相同name的input的value值
jquery获取多个相同name的input的value值
10 0
冬季实战营第一期:从零到一上手玩转云服务器实战
冬季实战营第一期:从零到一上手玩转云服务器实战记录
5 0
飞天加速计划·高校学生在家实践
我用阿里云服务器的一些心得
17 0
“冬季实战营第一期”之从零到一上手玩转云服务器——学习报告
动手实战、专家带练。由浅及深,逐渐提升动手实操能力。
18 0
2315
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载