Working With Offline Stores¶
End users can securely upload local database files from a supported device to the server for analysis.
Send Decrypted Offline Stores to the Server¶
A device’s offline store may be useful for troubleshooting issues in some cases. This feature provides the ability to send the decrypted offline store to the server.
This means that users can open the offline store files without an encryption key and the encryption key being used on the devices remains undisclosed.
Use the following API to send a decrypted offline store to the server:
public void sendStore(OfflineODataProvider provider) throws ODataException {
provider.add(this, new OfflineODataDefiningQuery("req1", "Customers", false));
provider.open(this);
provider.sendStore(this);
}
func SendStore(provider: OfflineODataProvider) -> Void {
provider.sendStore(completionHandler: { (_ error: OfflineODataError?) -> Void in
if let error = error {
printError(error, &errorMessage)
okay = false
} else {
printMessage("The Offline store has been sent successfully.")
}
})
}
When an Application Is Connecting to an SAP Business Technology Platform (NEO) Back End¶
Before consuming the sendStore
function, the offline store upload policy feature needs to be enabled.
For information on enabling the offline store upload policy feature, see Defining Client Offline Store Upload Policy.
Downloading an Uploaded Store on an SAP Mobile Services (NEO) Back End¶
Before consuming the sendStore
function, the offline store upload policy feature needs to be enabled.
For information on enabling the offline store upload policy feature, see Managing Client Database Uploads.
When an application is connecting to an SAP Mobile Services (Cloud Foundry) back end
Before consuming the sendStore
function, the offline store upload policy feature needs to be enabled.
For information on enabling the offline store upload policy feature, see Defining Offline Settings for Applications.
Once the sendStore
function is successfully consumed, the offline store files will be uploaded to the server.
See Procedure 8 on the following help page for information on how to download uploaded files for later investigation: Defining Offline Settings for Applications.
Send Encrypted Offline Stores to the Server¶
A device’s offline store may be useful for troubleshooting issues in some cases. This feature provides the functionality to upload the offline store and a temporary encryption key to the server.
This means that only users who get the temporary key can open the offline store files and the encryption key being used on devices remains undisclosed.
You must have sufficient disk space on the server to ensure that the offline store can be successfully uploaded.
public void sendEncryptedStore(OfflineODataProvider provider) throws ODataException {
provider.add(this, new OfflineODataDefiningQuery("req1", "Customers", false));
provider.open(this);
String newEncryptedKey = "default";
provider.sendEncryptedStore(this, newEncryptedKey);
}
func SendEncyptedStore(_ newEncryptionKey: String, _ provider: OfflineODataProvider) -> Void {
provider.sendEncryptedStore(newEncryptionKey:newEncryptionKey, completionHandler: { (_ error: OfflineODataError?) -> Void in
if let error = error {
printError(error, &errorMessage)
} else {
printMessage("The Offline store has been sent successfully.")
}
})
}
Note
The newEncryptionKey
parameter is case sensitive, and cannot contain leading or trailing spaces or semicolons.
When the application is connecting to an SAP Business Technology Platform (Neo) server
Before consuming the sendEncryptedStore
function, the offline store upload policy feature needs to be enabled.
For information on enabling the offline store upload policy feature, see Defining Client Offline Store Upload Policy.
Download an uploaded store from an SAP Business Technology Platform (Neo) server
Once the sendEncryptedStore
function is successfully consumed, the offline store files will be uploaded to the server.
For information on downloading uploaded files for later investigation, see Managing Client Database Uploads.
When an application is connecting to an SAP Business Technology Platform (Cloud Foundry) server
Before consuming the sendEncryptedStore
function, the offline store upload policy feature needs to be enabled.
For information on enabling the offline store upload policy feature, see Defining Offline Settings for Applications.
Downloading an uploaded offline store from an SAP Business Technology Platform (Cloud Foundry) server
Once the sendEncryptedStore
function has been successfully consumed, the offline store files will be uploaded to the server.
See Procedure 8 on the following help page for information on how to download uploaded files for later investigation: Defining Offline Settings for Applications.
Send Offline Stores with Note to the Server¶
The note
parameter allows for a note to be added to the offline store when it is sent to the server. Using this parameter, a user can add a description as needed. For example, the note could be a symptom description, such as “local update lost after download”. note
can be used in the sendEncryptedStore
and sendStore
APIs. The string cannot exceed 120 characters.
Send Decrypted Offline Stores with Note to the Server¶
public void sendStore(String note, OfflineODataProvider provider) throws ODataException {
provider.add(new OfflineODataDefiningQuery("req1", "Customers", false));
provider.open();
provider.sendStore(note);
}
func SendStore(note: String? = nil, provider: OfflineODataProvider) -> Void {
provider.sendStore(note, completionHandler: { (_ error: OfflineODataError?) -> Void in
if let error = error {
printError(error, &errorMessage)
okay = false
} else {
printMessage("The Offline store has been sent successfully.")
}
})
}
Send Encrypted Offline Stores with Note to the Server¶
public void sendEncryptedStore(String newEncryptedKey, String note, OfflineODataProvider provider) throws ODataException {
provider.add(new OfflineODataDefiningQuery("req1", "Customers", false));
provider.open();
provider.sendEncryptedStore(newEncryptedKey, note);
}
func sendEncryptedStore(_ newEncryptionKey: String, _ note: String? = nil, provider: OfflineODataProvider) -> Void {
provider.sendEncryptedStore(newEncryptionKey, note, completionHandler: { (_ error: OfflineODataError?) -> Void in
if let error = error {
printError(error, &errorMessage)
okay = false
} else {
printMessage("The Offline store has been sent successfully.")
}
})
}