igniteui-webcomponents-datasources 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/igniteui-webcomponents-datasources.umd.js +2279 -1
- package/bundles/igniteui-webcomponents-datasources.umd.min.js +7 -2
- package/esm2015/igniteui-webcomponents-datasources.js +0 -1
- package/esm2015/lib/Entity.js +0 -1
- package/esm2015/lib/EntityProperty.js +0 -1
- package/esm2015/lib/EntitySet.js +0 -1
- package/esm2015/lib/ODataDataSourcePage.js +0 -1
- package/esm2015/lib/ODataSchemaProvider.js +0 -1
- package/esm2015/lib/ODataVirtualDataSource.js +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProvider.js +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
- package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
- package/esm2015/lib/RestVirtualDataSource.js +272 -0
- package/esm2015/lib/RestVirtualDataSourceDataProvider.js +528 -0
- package/esm2015/lib/RestVirtualDataSourceDataProviderWorker.js +744 -0
- package/esm2015/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +154 -0
- package/esm2015/lib/RestVirtualDataSourcePage.js +67 -0
- package/esm2015/lib/RestVirtualDataSourceProviderTaskDataHolder.js +8 -0
- package/esm2015/lib/Schema.js +0 -1
- package/esm2015/lib/util.js +0 -1
- package/esm2015/public_api.js +6 -1
- package/esm5/igniteui-webcomponents-datasources.js +0 -1
- package/esm5/lib/Entity.js +0 -1
- package/esm5/lib/EntityProperty.js +0 -1
- package/esm5/lib/EntitySet.js +0 -1
- package/esm5/lib/ODataDataSourcePage.js +0 -1
- package/esm5/lib/ODataSchemaProvider.js +0 -1
- package/esm5/lib/ODataVirtualDataSource.js +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProvider.js +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +0 -1
- package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +0 -1
- package/esm5/lib/RestVirtualDataSource.js +357 -0
- package/esm5/lib/RestVirtualDataSourceDataProvider.js +675 -0
- package/esm5/lib/RestVirtualDataSourceDataProviderWorker.js +948 -0
- package/esm5/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +240 -0
- package/esm5/lib/RestVirtualDataSourcePage.js +73 -0
- package/esm5/lib/RestVirtualDataSourceProviderTaskDataHolder.js +12 -0
- package/esm5/lib/Schema.js +0 -1
- package/esm5/lib/util.js +0 -1
- package/esm5/public_api.js +6 -1
- package/fesm2015/igniteui-webcomponents-datasources.js +1754 -3
- package/fesm5/igniteui-webcomponents-datasources.js +2275 -3
- package/lib/RestVirtualDataSource.d.ts +60 -0
- package/lib/RestVirtualDataSourceDataProvider.d.ts +135 -0
- package/lib/RestVirtualDataSourceDataProviderWorker.d.ts +69 -0
- package/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +60 -0
- package/lib/RestVirtualDataSourcePage.d.ts +19 -0
- package/lib/RestVirtualDataSourceProviderTaskDataHolder.d.ts +5 -0
- package/package.json +2 -2
- package/public_api.d.ts +6 -0
- package/bundles/igniteui-webcomponents-datasources.umd.js.map +0 -1
- package/bundles/igniteui-webcomponents-datasources.umd.min.js.map +0 -1
- package/esm2015/igniteui-webcomponents-datasources.js.map +0 -1
- package/esm2015/lib/Entity.js.map +0 -1
- package/esm2015/lib/EntityProperty.js.map +0 -1
- package/esm2015/lib/EntitySet.js.map +0 -1
- package/esm2015/lib/ODataDataSourcePage.js.map +0 -1
- package/esm2015/lib/ODataSchemaProvider.js.map +0 -1
- package/esm2015/lib/ODataVirtualDataSource.js.map +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
- package/esm2015/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
- package/esm2015/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
- package/esm2015/lib/Schema.js.map +0 -1
- package/esm2015/lib/util.js.map +0 -1
- package/esm2015/public_api.js.map +0 -1
- package/esm5/igniteui-webcomponents-datasources.js.map +0 -1
- package/esm5/lib/Entity.js.map +0 -1
- package/esm5/lib/EntityProperty.js.map +0 -1
- package/esm5/lib/EntitySet.js.map +0 -1
- package/esm5/lib/ODataDataSourcePage.js.map +0 -1
- package/esm5/lib/ODataSchemaProvider.js.map +0 -1
- package/esm5/lib/ODataVirtualDataSource.js.map +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProvider.js.map +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorker.js.map +0 -1
- package/esm5/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js.map +0 -1
- package/esm5/lib/ODataVirtualDataSourceProviderTaskDataHolder.js.map +0 -1
- package/esm5/lib/Schema.js.map +0 -1
- package/esm5/lib/util.js.map +0 -1
- package/esm5/public_api.js.map +0 -1
- package/fesm2015/igniteui-webcomponents-datasources.js.map +0 -1
- package/fesm5/igniteui-webcomponents-datasources.js.map +0 -1
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
import * as tslib_1 from "tslib";
|
|
2
|
+
import { Base, runOn, markType } from "igniteui-webcomponents-core";
|
|
3
|
+
import { IDataSourceVirtualDataProvider_$type } from "igniteui-webcomponents-core";
|
|
4
|
+
import { SortDescriptionCollection } from "igniteui-webcomponents-core";
|
|
5
|
+
import { FilterExpressionCollection } from "igniteui-webcomponents-core";
|
|
6
|
+
import { LinkedList } from "./util";
|
|
7
|
+
import { DataSourcePageRequestPriority } from "igniteui-webcomponents-core";
|
|
8
|
+
import { RestVirtualDataSourceDataProviderWorker } from "./RestVirtualDataSourceDataProviderWorker";
|
|
9
|
+
import { RestVirtualDataSourceDataProviderWorkerSettings } from "./RestVirtualDataSourceDataProviderWorkerSettings";
|
|
10
|
+
import { DataSourceDataProviderSchemaChangedEventArgs } from "igniteui-webcomponents-core";
|
|
11
|
+
import { DataSourceSchemaPropertyType } from "igniteui-webcomponents-core";
|
|
12
|
+
import { stringContains } from "igniteui-webcomponents-core";
|
|
13
|
+
import { SummaryDescriptionCollection } from "igniteui-webcomponents-core";
|
|
14
|
+
var RestVirtualDataSourceDataProvider = /** @class */ /*@__PURE__*/ (function (_super) {
|
|
15
|
+
tslib_1.__extends(RestVirtualDataSourceDataProvider, _super);
|
|
16
|
+
function RestVirtualDataSourceDataProvider() {
|
|
17
|
+
var _this = _super.call(this) || this;
|
|
18
|
+
_this._worker = null;
|
|
19
|
+
_this._requests = new LinkedList();
|
|
20
|
+
_this._callback = null;
|
|
21
|
+
_this._pageLoaded = null;
|
|
22
|
+
_this._pageSizeRequested = 50;
|
|
23
|
+
_this._baseUri = null;
|
|
24
|
+
_this._entitySet = null;
|
|
25
|
+
_this._timeoutMilliseconds = 10000;
|
|
26
|
+
_this.schemaChanged = null;
|
|
27
|
+
_this._currentFullCount = 0;
|
|
28
|
+
_this._currentSchema = null;
|
|
29
|
+
_this._executionContext = null;
|
|
30
|
+
_this._updateNotifier = null;
|
|
31
|
+
_this._deferAutoRefresh = false;
|
|
32
|
+
_this._sortDescriptions = null;
|
|
33
|
+
_this._groupDescriptions = null;
|
|
34
|
+
_this._propertiesRequested = null;
|
|
35
|
+
_this._filterExpressions = null;
|
|
36
|
+
_this._summaryDescriptions = null;
|
|
37
|
+
_this._enableJsonp = true;
|
|
38
|
+
_this._fixedFullCount = -1;
|
|
39
|
+
_this._provideFullCount = null;
|
|
40
|
+
_this._provideOrderByParameter = null;
|
|
41
|
+
_this._provideFilterParameter = null;
|
|
42
|
+
_this._provideAggregationParameter = null;
|
|
43
|
+
_this._provideAggregatedCount = null;
|
|
44
|
+
_this._provideUri = null;
|
|
45
|
+
_this._performFetch = null;
|
|
46
|
+
_this._providePagingParameter = null;
|
|
47
|
+
_this._provideDesiredPropertiesParameter = null;
|
|
48
|
+
_this._schemaFetchQueued = false;
|
|
49
|
+
_this._autoRefreshQueued = false;
|
|
50
|
+
_this._sortDescriptions = new SortDescriptionCollection();
|
|
51
|
+
_this._sortDescriptions.onChanged = function () { return _this.sortDescriptions_CollectionChanged(null, null); };
|
|
52
|
+
_this._groupDescriptions = new SortDescriptionCollection();
|
|
53
|
+
_this._groupDescriptions.onChanged = function () { return _this.groupDescriptions_CollectionChanged(null, null); };
|
|
54
|
+
_this._filterExpressions = new FilterExpressionCollection();
|
|
55
|
+
_this._filterExpressions.onChanged = function () { return _this.filterExpressions_CollectionChanged(null, null); };
|
|
56
|
+
_this._summaryDescriptions = new SummaryDescriptionCollection();
|
|
57
|
+
_this._summaryDescriptions.onChanged = function () { return _this.summaryDescriptions_CollectionChanged(null, null); };
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
RestVirtualDataSourceDataProvider.prototype.filterExpressions_CollectionChanged = function (sender, e) {
|
|
61
|
+
this.queueAutoRefresh();
|
|
62
|
+
};
|
|
63
|
+
RestVirtualDataSourceDataProvider.prototype.sortDescriptions_CollectionChanged = function (sender, e) {
|
|
64
|
+
this.queueAutoRefresh();
|
|
65
|
+
};
|
|
66
|
+
RestVirtualDataSourceDataProvider.prototype.groupDescriptions_CollectionChanged = function (sender, e) {
|
|
67
|
+
this.queueAutoRefresh();
|
|
68
|
+
};
|
|
69
|
+
RestVirtualDataSourceDataProvider.prototype.summaryDescriptions_CollectionChanged = function (sender, e) {
|
|
70
|
+
this.queueAutoRefresh();
|
|
71
|
+
};
|
|
72
|
+
RestVirtualDataSourceDataProvider.prototype.addPageRequest = function (pageIndex, priority) {
|
|
73
|
+
if (this.deferAutoRefresh) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this._worker != null && this._worker.isShutdown) {
|
|
77
|
+
this._worker = null;
|
|
78
|
+
this._callback = null;
|
|
79
|
+
}
|
|
80
|
+
if (this._worker == null) {
|
|
81
|
+
this.createWorker();
|
|
82
|
+
}
|
|
83
|
+
if (priority == DataSourcePageRequestPriority.High) {
|
|
84
|
+
this._requests.addFirst(pageIndex);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this._requests.addLast(pageIndex);
|
|
88
|
+
}
|
|
89
|
+
if (!this._worker.addPageRequest(pageIndex, priority)) {
|
|
90
|
+
this._worker = null;
|
|
91
|
+
this._callback = null;
|
|
92
|
+
this.addPageRequest(pageIndex, priority);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
RestVirtualDataSourceDataProvider.prototype.createWorker = function () {
|
|
96
|
+
if (!this.valid()) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this._callback = runOn(this, this.raisePageLoaded);
|
|
100
|
+
var settings = this.getWorkerSettings();
|
|
101
|
+
this._worker = new RestVirtualDataSourceDataProviderWorker(settings);
|
|
102
|
+
};
|
|
103
|
+
RestVirtualDataSourceDataProvider.prototype.valid = function () {
|
|
104
|
+
return this.entitySet != null && this.baseUri != null;
|
|
105
|
+
};
|
|
106
|
+
RestVirtualDataSourceDataProvider.prototype.getWorkerSettings = function () {
|
|
107
|
+
var _this = this;
|
|
108
|
+
return ((function () {
|
|
109
|
+
var $ret = new RestVirtualDataSourceDataProviderWorkerSettings();
|
|
110
|
+
$ret.baseUri = _this._baseUri;
|
|
111
|
+
$ret.entitySet = _this._entitySet;
|
|
112
|
+
$ret.pageSizeRequested = _this._pageSizeRequested;
|
|
113
|
+
$ret.timeoutMilliseconds = _this._timeoutMilliseconds;
|
|
114
|
+
$ret.pageLoaded = _this._callback;
|
|
115
|
+
$ret.executionContext = _this._executionContext;
|
|
116
|
+
$ret.sortDescriptions = _this._sortDescriptions;
|
|
117
|
+
$ret.groupDescriptions = _this._groupDescriptions;
|
|
118
|
+
$ret.filterExpressions = _this._filterExpressions;
|
|
119
|
+
$ret.propertiesRequested = _this._propertiesRequested;
|
|
120
|
+
$ret.summaryDescriptions = _this._summaryDescriptions;
|
|
121
|
+
$ret.summaryScope = _this._summaryScope;
|
|
122
|
+
$ret.enableJsonp = _this._enableJsonp;
|
|
123
|
+
$ret.isAggregationSupported = _this.isAggregationSupported;
|
|
124
|
+
$ret.performFetch = _this.performFetch;
|
|
125
|
+
$ret.provideAggregationParameter = _this.provideAggregationParameter;
|
|
126
|
+
$ret.provideAggregatedCount = _this.provideAggregatedCount;
|
|
127
|
+
$ret.provideDesiredPropertiesParameter = _this.provideDesiredPropertiesParameter;
|
|
128
|
+
$ret.provideFilterParameter = _this.provideFilterParameter;
|
|
129
|
+
$ret.provideFullCount = _this.provideFullCount;
|
|
130
|
+
$ret.provideItems = _this.provideItems;
|
|
131
|
+
$ret.provideOrderByParameter = _this.provideOrderByParameter;
|
|
132
|
+
$ret.providePagingParameter = _this.providePagingParameter;
|
|
133
|
+
$ret.provideUri = _this.provideUri;
|
|
134
|
+
$ret.fixedFullCount = _this.fixedFullCount;
|
|
135
|
+
return $ret;
|
|
136
|
+
})());
|
|
137
|
+
};
|
|
138
|
+
RestVirtualDataSourceDataProvider.prototype.removePageRequest = function (pageIndex) {
|
|
139
|
+
var current = this._requests.first;
|
|
140
|
+
while (current != null) {
|
|
141
|
+
if (current.value == pageIndex) {
|
|
142
|
+
this._requests.remove(current);
|
|
143
|
+
}
|
|
144
|
+
current = current.next;
|
|
145
|
+
}
|
|
146
|
+
if (this._worker == null) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this._worker.removePageRequest(pageIndex);
|
|
150
|
+
};
|
|
151
|
+
RestVirtualDataSourceDataProvider.prototype.removeAllPageRequests = function () {
|
|
152
|
+
this._requests.clear();
|
|
153
|
+
if (this._worker == null) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this._worker.removeAllPageRequests();
|
|
157
|
+
};
|
|
158
|
+
RestVirtualDataSourceDataProvider.prototype.close = function () {
|
|
159
|
+
if (this._worker != null) {
|
|
160
|
+
this._worker.shutdown();
|
|
161
|
+
this._worker = null;
|
|
162
|
+
this._callback = null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageLoaded", {
|
|
166
|
+
get: function () {
|
|
167
|
+
return this._pageLoaded;
|
|
168
|
+
},
|
|
169
|
+
set: function (value) {
|
|
170
|
+
this._pageLoaded = value;
|
|
171
|
+
this.queueAutoRefresh();
|
|
172
|
+
},
|
|
173
|
+
enumerable: true,
|
|
174
|
+
configurable: true
|
|
175
|
+
});
|
|
176
|
+
RestVirtualDataSourceDataProvider.prototype.raisePageLoaded = function (page, fullCount, actualPageSize) {
|
|
177
|
+
if (this._pageLoaded != null) {
|
|
178
|
+
this._currentFullCount = fullCount;
|
|
179
|
+
if (this._currentSchema == null) {
|
|
180
|
+
var currentSchema = null;
|
|
181
|
+
if (page != null) {
|
|
182
|
+
currentSchema = page.schema();
|
|
183
|
+
}
|
|
184
|
+
this._currentSchema = currentSchema;
|
|
185
|
+
if (this.schemaChanged != null) {
|
|
186
|
+
this.schemaChanged(this, new DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (page.pageIndex() != RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
|
|
190
|
+
this._pageLoaded(page, fullCount, actualPageSize);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
RestVirtualDataSourceDataProvider.prototype.killWorker = function () {
|
|
195
|
+
if (this._worker != null) {
|
|
196
|
+
this._worker.shutdown();
|
|
197
|
+
this._worker = null;
|
|
198
|
+
this._callback = null;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "pageSizeRequested", {
|
|
202
|
+
get: function () {
|
|
203
|
+
return this._pageSizeRequested;
|
|
204
|
+
},
|
|
205
|
+
set: function (value) {
|
|
206
|
+
this._pageSizeRequested = value;
|
|
207
|
+
this.queueAutoRefresh();
|
|
208
|
+
},
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "baseUri", {
|
|
213
|
+
get: function () {
|
|
214
|
+
return this._baseUri;
|
|
215
|
+
},
|
|
216
|
+
set: function (value) {
|
|
217
|
+
var oldValue = this._baseUri;
|
|
218
|
+
this._baseUri = value;
|
|
219
|
+
if (oldValue != this._baseUri) {
|
|
220
|
+
this.queueAutoRefresh();
|
|
221
|
+
if (this.valid() && this.deferAutoRefresh) {
|
|
222
|
+
this.queueSchemaFetch();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
enumerable: true,
|
|
227
|
+
configurable: true
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "entitySet", {
|
|
230
|
+
get: function () {
|
|
231
|
+
return this._entitySet;
|
|
232
|
+
},
|
|
233
|
+
set: function (value) {
|
|
234
|
+
var oldValue = this._entitySet;
|
|
235
|
+
this._entitySet = value;
|
|
236
|
+
if (oldValue != this._entitySet) {
|
|
237
|
+
this.queueAutoRefresh();
|
|
238
|
+
if (this.valid() && this.deferAutoRefresh) {
|
|
239
|
+
this.queueSchemaFetch();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
enumerable: true,
|
|
244
|
+
configurable: true
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "timeoutMilliseconds", {
|
|
247
|
+
get: function () {
|
|
248
|
+
return this._timeoutMilliseconds;
|
|
249
|
+
},
|
|
250
|
+
set: function (value) {
|
|
251
|
+
this._timeoutMilliseconds = value;
|
|
252
|
+
this.queueAutoRefresh();
|
|
253
|
+
},
|
|
254
|
+
enumerable: true,
|
|
255
|
+
configurable: true
|
|
256
|
+
});
|
|
257
|
+
RestVirtualDataSourceDataProvider.prototype.getItemValue = function (item, valueName) {
|
|
258
|
+
var dic = item;
|
|
259
|
+
if (dic.has(valueName)) {
|
|
260
|
+
return dic.get(valueName);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualCount", {
|
|
267
|
+
get: function () {
|
|
268
|
+
return this._currentFullCount;
|
|
269
|
+
},
|
|
270
|
+
enumerable: true,
|
|
271
|
+
configurable: true
|
|
272
|
+
});
|
|
273
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "actualSchema", {
|
|
274
|
+
get: function () {
|
|
275
|
+
return this._currentSchema;
|
|
276
|
+
},
|
|
277
|
+
enumerable: true,
|
|
278
|
+
configurable: true
|
|
279
|
+
});
|
|
280
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "executionContext", {
|
|
281
|
+
get: function () {
|
|
282
|
+
return this._executionContext;
|
|
283
|
+
},
|
|
284
|
+
set: function (value) {
|
|
285
|
+
this._executionContext = value;
|
|
286
|
+
this.queueAutoRefresh();
|
|
287
|
+
},
|
|
288
|
+
enumerable: true,
|
|
289
|
+
configurable: true
|
|
290
|
+
});
|
|
291
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "updateNotifier", {
|
|
292
|
+
get: function () {
|
|
293
|
+
return this._updateNotifier;
|
|
294
|
+
},
|
|
295
|
+
set: function (value) {
|
|
296
|
+
this._updateNotifier = value;
|
|
297
|
+
},
|
|
298
|
+
enumerable: true,
|
|
299
|
+
configurable: true
|
|
300
|
+
});
|
|
301
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "deferAutoRefresh", {
|
|
302
|
+
get: function () {
|
|
303
|
+
return this._deferAutoRefresh;
|
|
304
|
+
},
|
|
305
|
+
set: function (value) {
|
|
306
|
+
this._deferAutoRefresh = value;
|
|
307
|
+
if (!this._deferAutoRefresh) {
|
|
308
|
+
this.queueAutoRefresh();
|
|
309
|
+
}
|
|
310
|
+
if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
|
|
311
|
+
this.queueSchemaFetch();
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
enumerable: true,
|
|
315
|
+
configurable: true
|
|
316
|
+
});
|
|
317
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isSortingSupported", {
|
|
318
|
+
get: function () {
|
|
319
|
+
return true;
|
|
320
|
+
},
|
|
321
|
+
enumerable: true,
|
|
322
|
+
configurable: true
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isGroupingSupported", {
|
|
325
|
+
get: function () {
|
|
326
|
+
return this.isAggregationSupported;
|
|
327
|
+
},
|
|
328
|
+
enumerable: true,
|
|
329
|
+
configurable: true
|
|
330
|
+
});
|
|
331
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isFilteringSupported", {
|
|
332
|
+
get: function () {
|
|
333
|
+
return true;
|
|
334
|
+
},
|
|
335
|
+
enumerable: true,
|
|
336
|
+
configurable: true
|
|
337
|
+
});
|
|
338
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isAggregationSupported", {
|
|
339
|
+
get: function () {
|
|
340
|
+
return this._isAggregationSupported;
|
|
341
|
+
},
|
|
342
|
+
set: function (isSupported) {
|
|
343
|
+
this._isAggregationSupported = isSupported;
|
|
344
|
+
},
|
|
345
|
+
enumerable: true,
|
|
346
|
+
configurable: true
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "sortDescriptions", {
|
|
349
|
+
get: function () {
|
|
350
|
+
return this._sortDescriptions;
|
|
351
|
+
},
|
|
352
|
+
enumerable: true,
|
|
353
|
+
configurable: true
|
|
354
|
+
});
|
|
355
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "groupDescriptions", {
|
|
356
|
+
get: function () {
|
|
357
|
+
return this._groupDescriptions;
|
|
358
|
+
},
|
|
359
|
+
enumerable: true,
|
|
360
|
+
configurable: true
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "propertiesRequested", {
|
|
363
|
+
get: function () {
|
|
364
|
+
return this._propertiesRequested;
|
|
365
|
+
},
|
|
366
|
+
set: function (value) {
|
|
367
|
+
this._propertiesRequested = value;
|
|
368
|
+
this.queueAutoRefresh();
|
|
369
|
+
},
|
|
370
|
+
enumerable: true,
|
|
371
|
+
configurable: true
|
|
372
|
+
});
|
|
373
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "filterExpressions", {
|
|
374
|
+
get: function () {
|
|
375
|
+
return this._filterExpressions;
|
|
376
|
+
},
|
|
377
|
+
enumerable: true,
|
|
378
|
+
configurable: true
|
|
379
|
+
});
|
|
380
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryDescriptions", {
|
|
381
|
+
get: function () {
|
|
382
|
+
return this._summaryDescriptions;
|
|
383
|
+
},
|
|
384
|
+
enumerable: true,
|
|
385
|
+
configurable: true
|
|
386
|
+
});
|
|
387
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "summaryScope", {
|
|
388
|
+
get: function () {
|
|
389
|
+
return this._summaryScope;
|
|
390
|
+
},
|
|
391
|
+
set: function (value) {
|
|
392
|
+
this._summaryScope = value;
|
|
393
|
+
},
|
|
394
|
+
enumerable: true,
|
|
395
|
+
configurable: true
|
|
396
|
+
});
|
|
397
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "enableJsonp", {
|
|
398
|
+
get: function () {
|
|
399
|
+
return this._enableJsonp;
|
|
400
|
+
},
|
|
401
|
+
set: function (isEnabled) {
|
|
402
|
+
this._enableJsonp = isEnabled;
|
|
403
|
+
},
|
|
404
|
+
enumerable: true,
|
|
405
|
+
configurable: true
|
|
406
|
+
});
|
|
407
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "fixedFullCount", {
|
|
408
|
+
get: function () {
|
|
409
|
+
return this._fixedFullCount;
|
|
410
|
+
},
|
|
411
|
+
set: function (value) {
|
|
412
|
+
this._fixedFullCount = value;
|
|
413
|
+
},
|
|
414
|
+
enumerable: true,
|
|
415
|
+
configurable: true
|
|
416
|
+
});
|
|
417
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFullCount", {
|
|
418
|
+
get: function () {
|
|
419
|
+
return this._provideFullCount;
|
|
420
|
+
},
|
|
421
|
+
set: function (value) {
|
|
422
|
+
this._provideFullCount = value;
|
|
423
|
+
},
|
|
424
|
+
enumerable: true,
|
|
425
|
+
configurable: true
|
|
426
|
+
});
|
|
427
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideOrderByParameter", {
|
|
428
|
+
get: function () {
|
|
429
|
+
return this._provideOrderByParameter;
|
|
430
|
+
},
|
|
431
|
+
set: function (value) {
|
|
432
|
+
this._provideOrderByParameter = value;
|
|
433
|
+
},
|
|
434
|
+
enumerable: true,
|
|
435
|
+
configurable: true
|
|
436
|
+
});
|
|
437
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideFilterParameter", {
|
|
438
|
+
get: function () {
|
|
439
|
+
return this._provideFilterParameter;
|
|
440
|
+
},
|
|
441
|
+
set: function (value) {
|
|
442
|
+
this._provideFilterParameter = value;
|
|
443
|
+
},
|
|
444
|
+
enumerable: true,
|
|
445
|
+
configurable: true
|
|
446
|
+
});
|
|
447
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregationParameter", {
|
|
448
|
+
get: function () {
|
|
449
|
+
return this._provideAggregationParameter;
|
|
450
|
+
},
|
|
451
|
+
set: function (value) {
|
|
452
|
+
this._provideAggregationParameter = value;
|
|
453
|
+
},
|
|
454
|
+
enumerable: true,
|
|
455
|
+
configurable: true
|
|
456
|
+
});
|
|
457
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideAggregatedCount", {
|
|
458
|
+
get: function () {
|
|
459
|
+
return this._provideAggregatedCount;
|
|
460
|
+
},
|
|
461
|
+
set: function (value) {
|
|
462
|
+
this._provideAggregatedCount = value;
|
|
463
|
+
},
|
|
464
|
+
enumerable: true,
|
|
465
|
+
configurable: true
|
|
466
|
+
});
|
|
467
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideUri", {
|
|
468
|
+
get: function () {
|
|
469
|
+
return this._provideUri;
|
|
470
|
+
},
|
|
471
|
+
set: function (value) {
|
|
472
|
+
this._provideUri = value;
|
|
473
|
+
},
|
|
474
|
+
enumerable: true,
|
|
475
|
+
configurable: true
|
|
476
|
+
});
|
|
477
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "performFetch", {
|
|
478
|
+
get: function () {
|
|
479
|
+
return this._performFetch;
|
|
480
|
+
},
|
|
481
|
+
set: function (value) {
|
|
482
|
+
this._performFetch = value;
|
|
483
|
+
},
|
|
484
|
+
enumerable: true,
|
|
485
|
+
configurable: true
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "providePagingParameter", {
|
|
488
|
+
get: function () {
|
|
489
|
+
return this._providePagingParameter;
|
|
490
|
+
},
|
|
491
|
+
set: function (value) {
|
|
492
|
+
this._providePagingParameter = value;
|
|
493
|
+
},
|
|
494
|
+
enumerable: true,
|
|
495
|
+
configurable: true
|
|
496
|
+
});
|
|
497
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideDesiredPropertiesParameter", {
|
|
498
|
+
get: function () {
|
|
499
|
+
return this._provideDesiredPropertiesParameter;
|
|
500
|
+
},
|
|
501
|
+
set: function (value) {
|
|
502
|
+
this._provideDesiredPropertiesParameter = value;
|
|
503
|
+
},
|
|
504
|
+
enumerable: true,
|
|
505
|
+
configurable: true
|
|
506
|
+
});
|
|
507
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "provideItems", {
|
|
508
|
+
get: function () {
|
|
509
|
+
return this._provideItems;
|
|
510
|
+
},
|
|
511
|
+
set: function (value) {
|
|
512
|
+
this._provideItems = value;
|
|
513
|
+
},
|
|
514
|
+
enumerable: true,
|
|
515
|
+
configurable: true
|
|
516
|
+
});
|
|
517
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "notifyUsingSourceIndexes", {
|
|
518
|
+
get: function () {
|
|
519
|
+
return true;
|
|
520
|
+
},
|
|
521
|
+
enumerable: true,
|
|
522
|
+
configurable: true
|
|
523
|
+
});
|
|
524
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isItemIndexLookupSupported", {
|
|
525
|
+
get: function () {
|
|
526
|
+
return false;
|
|
527
|
+
},
|
|
528
|
+
enumerable: true,
|
|
529
|
+
configurable: true
|
|
530
|
+
});
|
|
531
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "isKeyIndexLookupSupported", {
|
|
532
|
+
get: function () {
|
|
533
|
+
return false;
|
|
534
|
+
},
|
|
535
|
+
enumerable: true,
|
|
536
|
+
configurable: true
|
|
537
|
+
});
|
|
538
|
+
RestVirtualDataSourceDataProvider.prototype.notifySetItem = function (index, oldItem, newItem) {
|
|
539
|
+
if (this.updateNotifier != null) {
|
|
540
|
+
this.updateNotifier.notifySetItem(index, oldItem, newItem);
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
RestVirtualDataSourceDataProvider.prototype.notifyClearItems = function () {
|
|
544
|
+
if (this.updateNotifier != null) {
|
|
545
|
+
this.updateNotifier.notifyClearItems();
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
RestVirtualDataSourceDataProvider.prototype.notifyInsertItem = function (index, newItem) {
|
|
549
|
+
if (this.updateNotifier != null) {
|
|
550
|
+
this.updateNotifier.notifyInsertItem(index, newItem);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
RestVirtualDataSourceDataProvider.prototype.notifyRemoveItem = function (index, oldItem) {
|
|
554
|
+
if (this.updateNotifier != null) {
|
|
555
|
+
this.updateNotifier.notifyRemoveItem(index, oldItem);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
RestVirtualDataSourceDataProvider.prototype.queueSchemaFetch = function () {
|
|
559
|
+
if (this._schemaFetchQueued) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (this.executionContext != null) {
|
|
563
|
+
this._schemaFetchQueued = true;
|
|
564
|
+
this.executionContext.enqueueAction(runOn(this, this.doSchemaFetchInternal));
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
RestVirtualDataSourceDataProvider.prototype.doSchemaFetchInternal = function () {
|
|
568
|
+
if (!this._schemaFetchQueued) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
this._schemaFetchQueued = false;
|
|
572
|
+
this.schemaFetchInternal();
|
|
573
|
+
};
|
|
574
|
+
RestVirtualDataSourceDataProvider.prototype.schemaFetchInternal = function () {
|
|
575
|
+
this.schemaFetchInternalOverride();
|
|
576
|
+
};
|
|
577
|
+
RestVirtualDataSourceDataProvider.prototype.schemaFetchInternalOverride = function () {
|
|
578
|
+
if (!this.deferAutoRefresh) {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
this.removeAllPageRequests();
|
|
582
|
+
this.killWorker();
|
|
583
|
+
this.createWorker();
|
|
584
|
+
this.addSchemaRequest();
|
|
585
|
+
};
|
|
586
|
+
RestVirtualDataSourceDataProvider.prototype.addSchemaRequest = function () {
|
|
587
|
+
this._worker.addPageRequest(RestVirtualDataSourceDataProviderWorker.schemaRequestIndex, DataSourcePageRequestPriority.High);
|
|
588
|
+
};
|
|
589
|
+
RestVirtualDataSourceDataProvider.prototype.queueAutoRefresh = function () {
|
|
590
|
+
if (this.deferAutoRefresh) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
if (this._autoRefreshQueued) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
if (this.executionContext != null) {
|
|
597
|
+
this._autoRefreshQueued = true;
|
|
598
|
+
this.executionContext.enqueueAction(runOn(this, this.doRefreshInternal));
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
RestVirtualDataSourceDataProvider.prototype.doRefreshInternal = function () {
|
|
602
|
+
if (this.deferAutoRefresh) {
|
|
603
|
+
this._autoRefreshQueued = false;
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (!this._autoRefreshQueued) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
this._autoRefreshQueued = false;
|
|
610
|
+
this.refreshInternal();
|
|
611
|
+
};
|
|
612
|
+
RestVirtualDataSourceDataProvider.prototype.refreshInternal = function () {
|
|
613
|
+
this.refreshInternalOverride();
|
|
614
|
+
};
|
|
615
|
+
RestVirtualDataSourceDataProvider.prototype.refreshInternalOverride = function () {
|
|
616
|
+
this.removeAllPageRequests();
|
|
617
|
+
this.killWorker();
|
|
618
|
+
this.createWorker();
|
|
619
|
+
this._worker.addPageRequest(0, DataSourcePageRequestPriority.Normal);
|
|
620
|
+
};
|
|
621
|
+
RestVirtualDataSourceDataProvider.prototype.flushAutoRefresh = function () {
|
|
622
|
+
this.doRefreshInternal();
|
|
623
|
+
};
|
|
624
|
+
RestVirtualDataSourceDataProvider.prototype.refresh = function () {
|
|
625
|
+
this.refreshInternal();
|
|
626
|
+
};
|
|
627
|
+
RestVirtualDataSourceDataProvider.prototype.indexOfItem = function (item) {
|
|
628
|
+
return -1;
|
|
629
|
+
};
|
|
630
|
+
RestVirtualDataSourceDataProvider.prototype.indexOfKey = function (key) {
|
|
631
|
+
return -1;
|
|
632
|
+
};
|
|
633
|
+
RestVirtualDataSourceDataProvider.prototype.resolveSchemaPropertyType = function (propertyPath) {
|
|
634
|
+
if (this.actualSchema == null) {
|
|
635
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
636
|
+
}
|
|
637
|
+
if (stringContains(propertyPath, ".")) {
|
|
638
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
639
|
+
}
|
|
640
|
+
for (var i = 0; i < this.actualSchema.propertyNames.length; i++) {
|
|
641
|
+
var name_1 = this.actualSchema.propertyNames[i];
|
|
642
|
+
if (name_1 == propertyPath) {
|
|
643
|
+
return this.actualSchema.propertyTypes[i];
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
647
|
+
};
|
|
648
|
+
RestVirtualDataSourceDataProvider.prototype.setItemValue = function (item, valueName, value) {
|
|
649
|
+
// does nothing.
|
|
650
|
+
};
|
|
651
|
+
RestVirtualDataSourceDataProvider.prototype.removeItem = function (item) {
|
|
652
|
+
// does nothing.
|
|
653
|
+
};
|
|
654
|
+
RestVirtualDataSourceDataProvider.prototype.addItem = function (item) {
|
|
655
|
+
// does nothing.
|
|
656
|
+
};
|
|
657
|
+
RestVirtualDataSourceDataProvider.prototype.createBatchRequest = function (changes) {
|
|
658
|
+
if (this._worker != null) {
|
|
659
|
+
this._worker.createBatchRequest(changes);
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
Object.defineProperty(RestVirtualDataSourceDataProvider.prototype, "batchCompleted", {
|
|
663
|
+
get: function () {
|
|
664
|
+
return this._batchCompleted;
|
|
665
|
+
},
|
|
666
|
+
set: function (v) {
|
|
667
|
+
this._batchCompleted = v;
|
|
668
|
+
},
|
|
669
|
+
enumerable: true,
|
|
670
|
+
configurable: true
|
|
671
|
+
});
|
|
672
|
+
RestVirtualDataSourceDataProvider.$t = markType(RestVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', Base.$type, [IDataSourceVirtualDataProvider_$type]);
|
|
673
|
+
return RestVirtualDataSourceDataProvider;
|
|
674
|
+
}(Base));
|
|
675
|
+
export { RestVirtualDataSourceDataProvider };
|