Show TOC

Offline OData PluginLocate this document in the navigation structure

(Supports OData V2 for Android, iOS, Windows 8.1, and Windows 10). Provides offline OData support to Hybrid SDK (Kapsel) applications.

The plugin provides the client with the ability to define offline stores for an OData producer. The clients can perform (create, update, or delete) operations without internet connectivity and then flush the changes when internet is available. 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.

The plugin uses the OData component from the SAP Mobile Platform SDK.

Custom OData httpclient

The Offline OData plugin provides a OData httpclient based on datajs, a cross-browser JavaScript library. The httpclient resolves requests with the Offline OData plugin if the service root of the request matches one of the open stores. The httpclient defaults to using the original OData.defaultHttpClient if the requests service root does not match any of the currently open stores.

You must explicitly apply the custom httpclient in the JavaScript.

OData Requests outside datajs

An OData request may be made directly with an XMLHttpRequest, or a library other than datajs may be used. For these cases, you must use the sap.OData.request method to perform the request. This method is used by the custom httpclient, which can be used as a reference.

Flushing Offline Outbound Queue

You must explicitly call the flush method on a store to send modifications to the OData producter. Events are provided in the JavaScript for when a flush starts, error occurs, and flush ends.

Refreshing Data

You must explicitly refresh your stores to get changes from the OData producer. The plugin provides a refresh method that you can call to refresh the whole store or a subset of it.

Error Recovery

The event onrequesterror is fired if a request fails against the OData producer.

You can provide detailed information about errors through the ErrorArchive. The ErrorArchive logs business logic errors and ETag mismatch errors. You can configure an offline application to access the ErrorArchive so that end users can read and delete logged errors. See Designing an Offline Application to Handle Conflicts and Errors in Developer < Native OData Application Development.