-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
SandboxModel.js
45 lines (43 loc) · 1.48 KB
/
SandboxModel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*!
* ${copyright}
*/
// The SandboxModel is used in the manifest instead of OData V4 model for the following purposes:
// Certain constructor parameters are taken from URL parameters. For the "non-realOData" case, a
// mock server for the back-end requests is set up.
sap.ui.define([
"sap/ui/core/sample/common/SandboxModelHelper",
"sap/ui/model/odata/v4/ODataModel"
], function (SandboxModelHelper, ODataModel) {
"use strict";
var oMockData = {
mFixture : {
"$metadata?sap-language=EN" : {
source : "metadata.xml"
},
"ContactList(42010aef-0de5-1eea-af8f-5bce865f0879)?$select=ContactGUID,EmailAddress,FirstName,LastName" : {
message : {
"ContactGUID" : "42010aef-0de5-1eea-af8f-5bce865f0879",
"FirstName" : "Karl",
"LastName" : "Müller",
"EmailAddress" : "customer-do.not.reply@sap.com"
}
},
"PATCH ContactList(42010aef-0de5-1eea-af8f-5bce865f0879)" : {
code : 204
},
"ContactList(42010aef-0de5-1eea-af8f-5bce865f0879)?$select=FirstName,LastName" : {
message: {
"FirstName" : "Karl*",
"LastName" : "Müller*"
}
}
},
sFilterBase : "/sap/opu/odata4/sap/zui5_testv4/default/sap/zui5_epm_sample/0002/",
sSourceBase : "sap/ui/core/sample/odata/v4/FieldGroups/data"
};
return ODataModel.extend("sap.ui.core.sample.odata.v4.FieldGroups.SandboxModel", {
constructor : function (mParameters) {
return SandboxModelHelper.adaptModelParametersAndCreateModel(mParameters, oMockData);
}
});
});