igniteui-webcomponents-datasources 7.1.1-beta.2 → 7.1.1-beta.3
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/esm2022/lib/Entity.d.ts +14 -0
- package/esm2022/lib/Entity.js +65 -0
- package/esm2022/lib/EntityProperty.d.ts +12 -0
- package/esm2022/lib/EntityProperty.js +27 -0
- package/esm2022/lib/EntitySet.d.ts +15 -0
- package/esm2022/lib/EntitySet.js +50 -0
- package/esm2022/lib/ODataDataSourcePage.d.ts +19 -0
- package/esm2022/lib/ODataDataSourcePage.js +67 -0
- package/esm2022/lib/ODataSchemaProvider.d.ts +12 -0
- package/esm2022/lib/ODataSchemaProvider.js +120 -0
- package/esm2022/lib/ODataVirtualDataSource.d.ts +28 -0
- package/esm2022/lib/ODataVirtualDataSource.js +132 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProvider.d.ts +120 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProvider.js +450 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProviderWorker.d.ts +57 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProviderWorker.js +710 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProviderWorkerSettings.d.ts +42 -0
- package/esm2022/lib/ODataVirtualDataSourceDataProviderWorkerSettings.js +83 -0
- package/esm2022/lib/ODataVirtualDataSourceProviderTaskDataHolder.d.ts +5 -0
- package/esm2022/lib/ODataVirtualDataSourceProviderTaskDataHolder.js +6 -0
- package/esm2022/lib/RestVirtualDataSource.d.ts +86 -0
- package/esm2022/lib/RestVirtualDataSource.js +272 -0
- package/esm2022/lib/RestVirtualDataSourceDataProvider.d.ts +171 -0
- package/esm2022/lib/RestVirtualDataSourceDataProvider.js +535 -0
- package/esm2022/lib/RestVirtualDataSourceDataProviderWorker.d.ts +70 -0
- package/esm2022/lib/RestVirtualDataSourceDataProviderWorker.js +762 -0
- package/esm2022/lib/RestVirtualDataSourceDataProviderWorkerSettings.d.ts +93 -0
- package/esm2022/lib/RestVirtualDataSourceDataProviderWorkerSettings.js +159 -0
- package/esm2022/lib/RestVirtualDataSourcePage.d.ts +19 -0
- package/esm2022/lib/RestVirtualDataSourcePage.js +67 -0
- package/esm2022/lib/RestVirtualDataSourceProviderTaskDataHolder.d.ts +5 -0
- package/esm2022/lib/RestVirtualDataSourceProviderTaskDataHolder.js +6 -0
- package/esm2022/lib/Schema.d.ts +15 -0
- package/esm2022/lib/Schema.js +54 -0
- package/esm2022/lib/util.d.ts +27 -0
- package/esm2022/lib/util.js +116 -0
- package/esm2022/public_api.d.ts +18 -0
- package/esm2022/public_api.js +18 -0
- package/package.json +7 -7
- package/fesm2022/igniteui-webcomponents-datasources.mjs +0 -3611
- package/igniteui-webcomponents-datasources.d.ts +0 -754
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import { Base, runOn, markType } from "igniteui-webcomponents-core";
|
|
2
|
+
import { IDataSourceVirtualDataProvider_$type } from "igniteui-webcomponents-core";
|
|
3
|
+
import { SortDescriptionCollection } from "igniteui-webcomponents-core";
|
|
4
|
+
import { FilterExpressionCollection } from "igniteui-webcomponents-core";
|
|
5
|
+
import { LinkedList } from "./util";
|
|
6
|
+
import { DataSourcePageRequestPriority } from "igniteui-webcomponents-core";
|
|
7
|
+
import { RestVirtualDataSourceDataProviderWorker } from "./RestVirtualDataSourceDataProviderWorker";
|
|
8
|
+
import { RestVirtualDataSourceDataProviderWorkerSettings } from "./RestVirtualDataSourceDataProviderWorkerSettings";
|
|
9
|
+
import { DataSourceDataProviderSchemaChangedEventArgs } from "igniteui-webcomponents-core";
|
|
10
|
+
import { DataSourceSchemaPropertyType } from "igniteui-webcomponents-core";
|
|
11
|
+
import { stringContains } from "igniteui-webcomponents-core";
|
|
12
|
+
import { SummaryDescriptionCollection } from "igniteui-webcomponents-core";
|
|
13
|
+
class RestVirtualDataSourceDataProvider extends Base {
|
|
14
|
+
static { this.$t = markType(RestVirtualDataSourceDataProvider, 'ODataVirtualDataSourceDataProvider', Base.$type, [IDataSourceVirtualDataProvider_$type]); }
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this._worker = null;
|
|
18
|
+
this._requests = new LinkedList();
|
|
19
|
+
this._callback = null;
|
|
20
|
+
this._pageLoaded = null;
|
|
21
|
+
this._pageSizeRequested = 50;
|
|
22
|
+
this._baseUri = null;
|
|
23
|
+
this._entitySet = null;
|
|
24
|
+
this._timeoutMilliseconds = 10000;
|
|
25
|
+
this.schemaChanged = null;
|
|
26
|
+
this._currentFullCount = 0;
|
|
27
|
+
this._currentSchema = null;
|
|
28
|
+
this._executionContext = null;
|
|
29
|
+
this._updateNotifier = null;
|
|
30
|
+
this._deferAutoRefresh = false;
|
|
31
|
+
this._sortDescriptions = null;
|
|
32
|
+
this._groupDescriptions = null;
|
|
33
|
+
this._propertiesRequested = null;
|
|
34
|
+
this._schemaIncludedProperties = 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 = () => this.sortDescriptions_CollectionChanged(null, null);
|
|
52
|
+
this._groupDescriptions = new SortDescriptionCollection();
|
|
53
|
+
this._groupDescriptions.onChanged = () => this.groupDescriptions_CollectionChanged(null, null);
|
|
54
|
+
this._filterExpressions = new FilterExpressionCollection();
|
|
55
|
+
this._filterExpressions.onChanged = () => this.filterExpressions_CollectionChanged(null, null);
|
|
56
|
+
this._summaryDescriptions = new SummaryDescriptionCollection();
|
|
57
|
+
this._summaryDescriptions.onChanged = () => this.summaryDescriptions_CollectionChanged(null, null);
|
|
58
|
+
}
|
|
59
|
+
filterExpressions_CollectionChanged(sender, e) {
|
|
60
|
+
this.queueAutoRefresh();
|
|
61
|
+
}
|
|
62
|
+
sortDescriptions_CollectionChanged(sender, e) {
|
|
63
|
+
this.queueAutoRefresh();
|
|
64
|
+
}
|
|
65
|
+
groupDescriptions_CollectionChanged(sender, e) {
|
|
66
|
+
this.queueAutoRefresh();
|
|
67
|
+
}
|
|
68
|
+
summaryDescriptions_CollectionChanged(sender, e) {
|
|
69
|
+
this.queueAutoRefresh();
|
|
70
|
+
}
|
|
71
|
+
addPageRequest(pageIndex, priority) {
|
|
72
|
+
if (this.deferAutoRefresh) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (this._worker != null && this._worker.isShutdown) {
|
|
76
|
+
this._worker = null;
|
|
77
|
+
this._callback = null;
|
|
78
|
+
}
|
|
79
|
+
if (this._worker == null) {
|
|
80
|
+
this.createWorker();
|
|
81
|
+
}
|
|
82
|
+
if (priority == DataSourcePageRequestPriority.High) {
|
|
83
|
+
this._requests.addFirst(pageIndex);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this._requests.addLast(pageIndex);
|
|
87
|
+
}
|
|
88
|
+
if (!this._worker.addPageRequest(pageIndex, priority)) {
|
|
89
|
+
this._worker = null;
|
|
90
|
+
this._callback = null;
|
|
91
|
+
this.addPageRequest(pageIndex, priority);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
createWorker() {
|
|
95
|
+
if (!this.valid()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this._callback = runOn(this, this.raisePageLoaded);
|
|
99
|
+
let settings = this.getWorkerSettings();
|
|
100
|
+
this._worker = new RestVirtualDataSourceDataProviderWorker(settings);
|
|
101
|
+
}
|
|
102
|
+
valid() {
|
|
103
|
+
return this.entitySet != null && this.baseUri != null;
|
|
104
|
+
}
|
|
105
|
+
getWorkerSettings() {
|
|
106
|
+
return ((() => {
|
|
107
|
+
let $ret = new RestVirtualDataSourceDataProviderWorkerSettings();
|
|
108
|
+
$ret.baseUri = this._baseUri;
|
|
109
|
+
$ret.entitySet = this._entitySet;
|
|
110
|
+
$ret.pageSizeRequested = this._pageSizeRequested;
|
|
111
|
+
$ret.timeoutMilliseconds = this._timeoutMilliseconds;
|
|
112
|
+
$ret.pageLoaded = this._callback;
|
|
113
|
+
$ret.executionContext = this._executionContext;
|
|
114
|
+
$ret.sortDescriptions = this._sortDescriptions;
|
|
115
|
+
$ret.groupDescriptions = this._groupDescriptions;
|
|
116
|
+
$ret.filterExpressions = this._filterExpressions;
|
|
117
|
+
$ret.propertiesRequested = this._propertiesRequested;
|
|
118
|
+
$ret.schemaIncludedProperties = this._schemaIncludedProperties;
|
|
119
|
+
$ret.summaryDescriptions = this._summaryDescriptions;
|
|
120
|
+
$ret.summaryScope = this._summaryScope;
|
|
121
|
+
$ret.enableJsonp = this._enableJsonp;
|
|
122
|
+
$ret.isAggregationSupported = this.isAggregationSupported;
|
|
123
|
+
$ret.performFetch = this.performFetch;
|
|
124
|
+
$ret.provideAggregationParameter = this.provideAggregationParameter;
|
|
125
|
+
$ret.provideAggregatedCount = this.provideAggregatedCount;
|
|
126
|
+
$ret.provideDesiredPropertiesParameter = this.provideDesiredPropertiesParameter;
|
|
127
|
+
$ret.provideFilterParameter = this.provideFilterParameter;
|
|
128
|
+
$ret.provideFullCount = this.provideFullCount;
|
|
129
|
+
$ret.provideItems = this.provideItems;
|
|
130
|
+
$ret.provideOrderByParameter = this.provideOrderByParameter;
|
|
131
|
+
$ret.providePagingParameter = this.providePagingParameter;
|
|
132
|
+
$ret.provideUri = this.provideUri;
|
|
133
|
+
$ret.fixedFullCount = this.fixedFullCount;
|
|
134
|
+
return $ret;
|
|
135
|
+
})());
|
|
136
|
+
}
|
|
137
|
+
removePageRequest(pageIndex) {
|
|
138
|
+
let current = this._requests.first;
|
|
139
|
+
while (current != null) {
|
|
140
|
+
if (current.value == pageIndex) {
|
|
141
|
+
this._requests.remove(current);
|
|
142
|
+
}
|
|
143
|
+
current = current.next;
|
|
144
|
+
}
|
|
145
|
+
if (this._worker == null) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this._worker.removePageRequest(pageIndex);
|
|
149
|
+
}
|
|
150
|
+
removeAllPageRequests() {
|
|
151
|
+
this._requests.clear();
|
|
152
|
+
if (this._worker == null) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this._worker.removeAllPageRequests();
|
|
156
|
+
}
|
|
157
|
+
close() {
|
|
158
|
+
if (this._worker != null) {
|
|
159
|
+
this._worker.shutdown();
|
|
160
|
+
this._worker = null;
|
|
161
|
+
this._callback = null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
get pageLoaded() {
|
|
165
|
+
return this._pageLoaded;
|
|
166
|
+
}
|
|
167
|
+
set pageLoaded(value) {
|
|
168
|
+
this._pageLoaded = value;
|
|
169
|
+
this.queueAutoRefresh();
|
|
170
|
+
}
|
|
171
|
+
raisePageLoaded(page, fullCount, actualPageSize) {
|
|
172
|
+
if (this._pageLoaded != null) {
|
|
173
|
+
this._currentFullCount = fullCount;
|
|
174
|
+
if (this._currentSchema == null) {
|
|
175
|
+
let currentSchema = null;
|
|
176
|
+
if (page != null) {
|
|
177
|
+
currentSchema = page.schema();
|
|
178
|
+
}
|
|
179
|
+
this._currentSchema = currentSchema;
|
|
180
|
+
if (this.schemaChanged != null) {
|
|
181
|
+
this.schemaChanged(this, new DataSourceDataProviderSchemaChangedEventArgs(this._currentSchema, this._currentFullCount));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (page.pageIndex() != RestVirtualDataSourceDataProviderWorker.schemaRequestIndex) {
|
|
185
|
+
this._pageLoaded(page, fullCount, actualPageSize);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
killWorker() {
|
|
190
|
+
if (this._worker != null) {
|
|
191
|
+
this._worker.shutdown();
|
|
192
|
+
this._worker = null;
|
|
193
|
+
this._callback = null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
get pageSizeRequested() {
|
|
197
|
+
return this._pageSizeRequested;
|
|
198
|
+
}
|
|
199
|
+
set pageSizeRequested(value) {
|
|
200
|
+
this._pageSizeRequested = value;
|
|
201
|
+
this.queueAutoRefresh();
|
|
202
|
+
}
|
|
203
|
+
get baseUri() {
|
|
204
|
+
return this._baseUri;
|
|
205
|
+
}
|
|
206
|
+
set baseUri(value) {
|
|
207
|
+
let oldValue = this._baseUri;
|
|
208
|
+
this._baseUri = value;
|
|
209
|
+
if (oldValue != this._baseUri) {
|
|
210
|
+
this.queueAutoRefresh();
|
|
211
|
+
if (this.valid() && this.deferAutoRefresh) {
|
|
212
|
+
this.queueSchemaFetch();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
get entitySet() {
|
|
217
|
+
return this._entitySet;
|
|
218
|
+
}
|
|
219
|
+
set entitySet(value) {
|
|
220
|
+
let oldValue = this._entitySet;
|
|
221
|
+
this._entitySet = value;
|
|
222
|
+
if (oldValue != this._entitySet) {
|
|
223
|
+
this.queueAutoRefresh();
|
|
224
|
+
if (this.valid() && this.deferAutoRefresh) {
|
|
225
|
+
this.queueSchemaFetch();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
get timeoutMilliseconds() {
|
|
230
|
+
return this._timeoutMilliseconds;
|
|
231
|
+
}
|
|
232
|
+
set timeoutMilliseconds(value) {
|
|
233
|
+
this._timeoutMilliseconds = value;
|
|
234
|
+
this.queueAutoRefresh();
|
|
235
|
+
}
|
|
236
|
+
getItemValue(item, valueName) {
|
|
237
|
+
let dic = item;
|
|
238
|
+
if (dic.has(valueName)) {
|
|
239
|
+
return dic.get(valueName);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
get actualCount() {
|
|
246
|
+
return this._currentFullCount;
|
|
247
|
+
}
|
|
248
|
+
get actualSchema() {
|
|
249
|
+
return this._currentSchema;
|
|
250
|
+
}
|
|
251
|
+
get executionContext() {
|
|
252
|
+
return this._executionContext;
|
|
253
|
+
}
|
|
254
|
+
set executionContext(value) {
|
|
255
|
+
this._executionContext = value;
|
|
256
|
+
this.queueAutoRefresh();
|
|
257
|
+
}
|
|
258
|
+
get updateNotifier() {
|
|
259
|
+
return this._updateNotifier;
|
|
260
|
+
}
|
|
261
|
+
set updateNotifier(value) {
|
|
262
|
+
this._updateNotifier = value;
|
|
263
|
+
}
|
|
264
|
+
get deferAutoRefresh() {
|
|
265
|
+
return this._deferAutoRefresh;
|
|
266
|
+
}
|
|
267
|
+
set deferAutoRefresh(value) {
|
|
268
|
+
this._deferAutoRefresh = value;
|
|
269
|
+
if (!this._deferAutoRefresh) {
|
|
270
|
+
this.queueAutoRefresh();
|
|
271
|
+
}
|
|
272
|
+
if (this._deferAutoRefresh && this.valid() && this._currentSchema == null) {
|
|
273
|
+
this.queueSchemaFetch();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
get isSortingSupported() {
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
get isGroupingSupported() {
|
|
280
|
+
return this.isAggregationSupported;
|
|
281
|
+
}
|
|
282
|
+
get isFilteringSupported() {
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
get isAggregationSupported() {
|
|
286
|
+
return this._isAggregationSupported;
|
|
287
|
+
}
|
|
288
|
+
set isAggregationSupported(isSupported) {
|
|
289
|
+
this._isAggregationSupported = isSupported;
|
|
290
|
+
}
|
|
291
|
+
get sortDescriptions() {
|
|
292
|
+
return this._sortDescriptions;
|
|
293
|
+
}
|
|
294
|
+
get groupDescriptions() {
|
|
295
|
+
return this._groupDescriptions;
|
|
296
|
+
}
|
|
297
|
+
get propertiesRequested() {
|
|
298
|
+
return this._propertiesRequested;
|
|
299
|
+
}
|
|
300
|
+
set propertiesRequested(value) {
|
|
301
|
+
this._propertiesRequested = value;
|
|
302
|
+
this.queueAutoRefresh();
|
|
303
|
+
}
|
|
304
|
+
get schemaIncludedProperties() {
|
|
305
|
+
return this._schemaIncludedProperties;
|
|
306
|
+
}
|
|
307
|
+
set schemaIncludedProperties(value) {
|
|
308
|
+
this._schemaIncludedProperties = value;
|
|
309
|
+
this.queueAutoRefresh();
|
|
310
|
+
}
|
|
311
|
+
get filterExpressions() {
|
|
312
|
+
return this._filterExpressions;
|
|
313
|
+
}
|
|
314
|
+
get summaryDescriptions() {
|
|
315
|
+
return this._summaryDescriptions;
|
|
316
|
+
}
|
|
317
|
+
get summaryScope() {
|
|
318
|
+
return this._summaryScope;
|
|
319
|
+
}
|
|
320
|
+
set summaryScope(value) {
|
|
321
|
+
this._summaryScope = value;
|
|
322
|
+
}
|
|
323
|
+
get enableJsonp() {
|
|
324
|
+
return this._enableJsonp;
|
|
325
|
+
}
|
|
326
|
+
set enableJsonp(isEnabled) {
|
|
327
|
+
this._enableJsonp = isEnabled;
|
|
328
|
+
}
|
|
329
|
+
get fixedFullCount() {
|
|
330
|
+
return this._fixedFullCount;
|
|
331
|
+
}
|
|
332
|
+
set fixedFullCount(value) {
|
|
333
|
+
this._fixedFullCount = value;
|
|
334
|
+
}
|
|
335
|
+
get provideFullCount() {
|
|
336
|
+
return this._provideFullCount;
|
|
337
|
+
}
|
|
338
|
+
set provideFullCount(value) {
|
|
339
|
+
this._provideFullCount = value;
|
|
340
|
+
}
|
|
341
|
+
get provideOrderByParameter() {
|
|
342
|
+
return this._provideOrderByParameter;
|
|
343
|
+
}
|
|
344
|
+
set provideOrderByParameter(value) {
|
|
345
|
+
this._provideOrderByParameter = value;
|
|
346
|
+
}
|
|
347
|
+
get provideFilterParameter() {
|
|
348
|
+
return this._provideFilterParameter;
|
|
349
|
+
}
|
|
350
|
+
set provideFilterParameter(value) {
|
|
351
|
+
this._provideFilterParameter = value;
|
|
352
|
+
}
|
|
353
|
+
get provideAggregationParameter() {
|
|
354
|
+
return this._provideAggregationParameter;
|
|
355
|
+
}
|
|
356
|
+
set provideAggregationParameter(value) {
|
|
357
|
+
this._provideAggregationParameter = value;
|
|
358
|
+
}
|
|
359
|
+
get provideAggregatedCount() {
|
|
360
|
+
return this._provideAggregatedCount;
|
|
361
|
+
}
|
|
362
|
+
set provideAggregatedCount(value) {
|
|
363
|
+
this._provideAggregatedCount = value;
|
|
364
|
+
}
|
|
365
|
+
get provideUri() {
|
|
366
|
+
return this._provideUri;
|
|
367
|
+
}
|
|
368
|
+
set provideUri(value) {
|
|
369
|
+
this._provideUri = value;
|
|
370
|
+
}
|
|
371
|
+
get performFetch() {
|
|
372
|
+
return this._performFetch;
|
|
373
|
+
}
|
|
374
|
+
set performFetch(value) {
|
|
375
|
+
this._performFetch = value;
|
|
376
|
+
}
|
|
377
|
+
get providePagingParameter() {
|
|
378
|
+
return this._providePagingParameter;
|
|
379
|
+
}
|
|
380
|
+
set providePagingParameter(value) {
|
|
381
|
+
this._providePagingParameter = value;
|
|
382
|
+
}
|
|
383
|
+
get provideDesiredPropertiesParameter() {
|
|
384
|
+
return this._provideDesiredPropertiesParameter;
|
|
385
|
+
}
|
|
386
|
+
set provideDesiredPropertiesParameter(value) {
|
|
387
|
+
this._provideDesiredPropertiesParameter = value;
|
|
388
|
+
}
|
|
389
|
+
get provideItems() {
|
|
390
|
+
return this._provideItems;
|
|
391
|
+
}
|
|
392
|
+
set provideItems(value) {
|
|
393
|
+
this._provideItems = value;
|
|
394
|
+
}
|
|
395
|
+
get notifyUsingSourceIndexes() {
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
get isItemIndexLookupSupported() {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
get isKeyIndexLookupSupported() {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
notifySetItem(index, oldItem, newItem) {
|
|
405
|
+
if (this.updateNotifier != null) {
|
|
406
|
+
this.updateNotifier.notifySetItem(index, oldItem, newItem);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
notifyClearItems() {
|
|
410
|
+
if (this.updateNotifier != null) {
|
|
411
|
+
this.updateNotifier.notifyClearItems();
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
notifyInsertItem(index, newItem) {
|
|
415
|
+
if (this.updateNotifier != null) {
|
|
416
|
+
this.updateNotifier.notifyInsertItem(index, newItem);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
notifyRemoveItem(index, oldItem) {
|
|
420
|
+
if (this.updateNotifier != null) {
|
|
421
|
+
this.updateNotifier.notifyRemoveItem(index, oldItem);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
queueSchemaFetch() {
|
|
425
|
+
if (this._schemaFetchQueued) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (this.executionContext != null) {
|
|
429
|
+
this._schemaFetchQueued = true;
|
|
430
|
+
this.executionContext.enqueueAction(runOn(this, this.doSchemaFetchInternal));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
doSchemaFetchInternal() {
|
|
434
|
+
if (!this._schemaFetchQueued) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
this._schemaFetchQueued = false;
|
|
438
|
+
this.schemaFetchInternal();
|
|
439
|
+
}
|
|
440
|
+
schemaFetchInternal() {
|
|
441
|
+
this.schemaFetchInternalOverride();
|
|
442
|
+
}
|
|
443
|
+
schemaFetchInternalOverride() {
|
|
444
|
+
if (!this.deferAutoRefresh) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this.removeAllPageRequests();
|
|
448
|
+
this.killWorker();
|
|
449
|
+
this.createWorker();
|
|
450
|
+
this.addSchemaRequest();
|
|
451
|
+
}
|
|
452
|
+
addSchemaRequest() {
|
|
453
|
+
this._worker.addPageRequest(RestVirtualDataSourceDataProviderWorker.schemaRequestIndex, DataSourcePageRequestPriority.High);
|
|
454
|
+
}
|
|
455
|
+
queueAutoRefresh() {
|
|
456
|
+
if (this.deferAutoRefresh) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (this._autoRefreshQueued) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (this.executionContext != null) {
|
|
463
|
+
this._autoRefreshQueued = true;
|
|
464
|
+
this.executionContext.enqueueAction(runOn(this, this.doRefreshInternal));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
doRefreshInternal() {
|
|
468
|
+
if (this.deferAutoRefresh) {
|
|
469
|
+
this._autoRefreshQueued = false;
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (!this._autoRefreshQueued) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
this._autoRefreshQueued = false;
|
|
476
|
+
this.refreshInternal();
|
|
477
|
+
}
|
|
478
|
+
refreshInternal() {
|
|
479
|
+
this.refreshInternalOverride();
|
|
480
|
+
}
|
|
481
|
+
refreshInternalOverride() {
|
|
482
|
+
this.removeAllPageRequests();
|
|
483
|
+
this.killWorker();
|
|
484
|
+
this.createWorker();
|
|
485
|
+
this._worker.addPageRequest(0, DataSourcePageRequestPriority.Normal);
|
|
486
|
+
}
|
|
487
|
+
flushAutoRefresh() {
|
|
488
|
+
this.doRefreshInternal();
|
|
489
|
+
}
|
|
490
|
+
refresh() {
|
|
491
|
+
this.refreshInternal();
|
|
492
|
+
}
|
|
493
|
+
indexOfItem(item) {
|
|
494
|
+
return -1;
|
|
495
|
+
}
|
|
496
|
+
indexOfKey(key) {
|
|
497
|
+
return -1;
|
|
498
|
+
}
|
|
499
|
+
resolveSchemaPropertyType(propertyPath) {
|
|
500
|
+
if (this.actualSchema == null) {
|
|
501
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
502
|
+
}
|
|
503
|
+
if (stringContains(propertyPath, ".")) {
|
|
504
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
505
|
+
}
|
|
506
|
+
for (let i = 0; i < this.actualSchema.propertyNames.length; i++) {
|
|
507
|
+
let name = this.actualSchema.propertyNames[i];
|
|
508
|
+
if (name == propertyPath) {
|
|
509
|
+
return this.actualSchema.propertyTypes[i];
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return DataSourceSchemaPropertyType.ObjectValue;
|
|
513
|
+
}
|
|
514
|
+
setItemValue(item, valueName, value) {
|
|
515
|
+
// does nothing.
|
|
516
|
+
}
|
|
517
|
+
removeItem(item) {
|
|
518
|
+
// does nothing.
|
|
519
|
+
}
|
|
520
|
+
addItem(item) {
|
|
521
|
+
// does nothing.
|
|
522
|
+
}
|
|
523
|
+
createBatchRequest(changes) {
|
|
524
|
+
if (this._worker != null) {
|
|
525
|
+
this._worker.createBatchRequest(changes);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
get batchCompleted() {
|
|
529
|
+
return this._batchCompleted;
|
|
530
|
+
}
|
|
531
|
+
set batchCompleted(v) {
|
|
532
|
+
this._batchCompleted = v;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
export { RestVirtualDataSourceDataProvider };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AsyncVirtualDataSourceProviderWorker } from "igniteui-webcomponents-core";
|
|
2
|
+
import { SortDescriptionCollection } from "igniteui-webcomponents-core";
|
|
3
|
+
import { FilterExpressionCollection } from "igniteui-webcomponents-core";
|
|
4
|
+
import { AsyncVirtualDataSourceProviderTaskDataHolder } from "igniteui-webcomponents-core";
|
|
5
|
+
import { RestVirtualDataSourceDataProviderWorkerSettings } from "./RestVirtualDataSourceDataProviderWorkerSettings";
|
|
6
|
+
import { AsyncDataSourcePageTaskHolder } from "igniteui-webcomponents-core";
|
|
7
|
+
import { AsyncDataSourcePageRequest } from "igniteui-webcomponents-core";
|
|
8
|
+
import { TransactionState } from "igniteui-webcomponents-core";
|
|
9
|
+
export declare class RestVirtualDataSourceDataProviderWorker extends AsyncVirtualDataSourceProviderWorker {
|
|
10
|
+
private _baseUri;
|
|
11
|
+
private _entitySet;
|
|
12
|
+
private _sortDescriptions;
|
|
13
|
+
private _groupDescriptions;
|
|
14
|
+
private _filterExpressions;
|
|
15
|
+
private _summaryDescriptions;
|
|
16
|
+
private _summaryScope;
|
|
17
|
+
private _desiredPropeties;
|
|
18
|
+
private _schemaIncludedProperties;
|
|
19
|
+
private _enableJsonp;
|
|
20
|
+
private _isAggregationSupported;
|
|
21
|
+
private _provideFullCount;
|
|
22
|
+
private _provideOrderByParameter;
|
|
23
|
+
private _provideFilterParameter;
|
|
24
|
+
private _provideAggregationParameter;
|
|
25
|
+
private _provideAggregatedCount;
|
|
26
|
+
private _providePagingParameter;
|
|
27
|
+
private _provideDesiredPropertiesParameter;
|
|
28
|
+
private _provideItems;
|
|
29
|
+
private _provideUri;
|
|
30
|
+
private _performFetch;
|
|
31
|
+
private _fixedFullCount;
|
|
32
|
+
protected get sortDescriptions(): SortDescriptionCollection;
|
|
33
|
+
protected get filterExpressions(): FilterExpressionCollection;
|
|
34
|
+
protected get desiredProperties(): string[];
|
|
35
|
+
protected initialize(): void;
|
|
36
|
+
protected getTaskDataHolder(): AsyncVirtualDataSourceProviderTaskDataHolder;
|
|
37
|
+
protected getCompletedTaskData(holder: AsyncVirtualDataSourceProviderTaskDataHolder, completed: number): void;
|
|
38
|
+
protected removeCompletedTaskData(holder: AsyncVirtualDataSourceProviderTaskDataHolder, completed: number): void;
|
|
39
|
+
protected getTasksData(holder: AsyncVirtualDataSourceProviderTaskDataHolder): void;
|
|
40
|
+
private iter;
|
|
41
|
+
private iterFilter;
|
|
42
|
+
private iterSummaries;
|
|
43
|
+
constructor(settings: RestVirtualDataSourceDataProviderWorkerSettings);
|
|
44
|
+
protected processCompletedTask(completedTask: AsyncDataSourcePageTaskHolder, currentDelay: number, pageIndex: number, taskDataHolder: AsyncVirtualDataSourceProviderTaskDataHolder): void;
|
|
45
|
+
private _groupInformation;
|
|
46
|
+
private _summaryInformation;
|
|
47
|
+
private finishProcessingCompletedTask;
|
|
48
|
+
private resolveGroupInformation;
|
|
49
|
+
private fetchUri;
|
|
50
|
+
private groupError;
|
|
51
|
+
private groupSuccess;
|
|
52
|
+
private addGroup;
|
|
53
|
+
private resolveSummaryInformation;
|
|
54
|
+
private summarySuccess;
|
|
55
|
+
private summaryError;
|
|
56
|
+
private getSummaryQueryParameters;
|
|
57
|
+
private createSummaryResults;
|
|
58
|
+
private resolveSchemaFromItems;
|
|
59
|
+
private resolveSchema;
|
|
60
|
+
private _filterString;
|
|
61
|
+
private _selectedString;
|
|
62
|
+
static readonly schemaRequestIndex: number;
|
|
63
|
+
protected makeTaskForRequest(request: AsyncDataSourcePageRequest, retryDelay: number): void;
|
|
64
|
+
private updateFilterString;
|
|
65
|
+
private executeRequest;
|
|
66
|
+
private success;
|
|
67
|
+
private error;
|
|
68
|
+
createBatchRequest(changes: TransactionState[]): void;
|
|
69
|
+
private getRequestUriWithKey;
|
|
70
|
+
}
|