Heya,
I have been working a bit on creating an offline Kapsel App on and off in my spare time.
However I have run into some strange things regarding my data when working through the Offline Store.
Take for example the standard Flight Odata example service.
I have mapped it from the SAPES1 environment to my trial HCPms system and made a quick app through the Web IDE.
I have extended that app to use the offline store:
In short:
var properties = {
"name": "AirlinesOfflineStore",
"host": appContext.registrationContext.serverHost,
"port": appContext.registrationContext.serverPort,
"https": appContext.registrationContext.https,
"serviceRoot" : appContext.applicationEndpointURL,
/*
"customHeaders" : {
"X-SMP-APPCID" : pplicationContext.applicationConnectionId
},
"streamParams" : "custom_header=Authorization: Basic " + btoa('username:password') + ";",
*/
"streamParams" : "custom_header=Authorization:Basic " + appContext.Authorization + ";custom_header=X-SMP-APPCID:" + appContext.applicationConnectionId + ";",
"definingRequests" : {
"FlightsDR" : "/FlightCollection",
"CarriersDR" : "/CarrierCollection",
}
};
Now I expect that my standard Master Detail App, still shows my Flights as I had them before I used it through the store.
However where I bind data from the FlightDetails part of a Flight, the text is lost.
Through debugging I discovered that when I log my object to the console. My object according to iOS has the following structure:
----------------------------------
[Log] Object (console-via-logger.js, line 173)
CURRENCY: "USD"
FlightCarrier: Object
PAYMENTSUM: "53747.31"
PLANETYPE: "A310-300"
PRICE: "422.94"
SEATSMAX: 280
SEATSMAX_B: 22
SEATSMAX_F: 10
SEATSOCC: 112
SEATSOCC_B: 8
SEATSOCC_F: 3
__metadata: Object
airportFrom: "SFO"
airportTo: "JFK"
arrivalTime: "PT17H21M0S"
carrid: "AA"
cityFrom: "san francisco"
cityTo: "NEW YORK"
connid: "0064"
countryFrom: "US"
countryTo: "US"
departureTime: "PT9H0M0S"
distance: "2572"
distanceUnit: "SMI"
fldate: Fri Apr 24 2015 02:00:00 GMT+0200 (CEST)
flightBookings: Object
flightDetails: Object
flightTime: 321
flightType: ""
flightbooking: Object
period: 0
__proto__: Object
--------------------------
All the details have transferred to the main object if you compare it with the XML from the SAPES1 server:
----------------------------
<contenttype="application/xml">
Thanks in advance,
Vincent