@sapui5/sap.ui.export 1.111.2 → 1.112.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/package.json +1 -1
- package/src/sap/ui/export/.library +1 -1
- package/src/sap/ui/export/ExportBase.js +14 -18
- package/src/sap/ui/export/ExportHandler.js +23 -7
- package/src/sap/ui/export/ExportUtils.js +96 -19
- package/src/sap/ui/export/PortableDocument.js +40 -11
- package/src/sap/ui/export/Spreadsheet.js +18 -21
- package/src/sap/ui/export/SpreadsheetExport.js +3 -3
- package/src/sap/ui/export/library.js +2 -2
- package/src/sap/ui/export/messagebundle_en.properties +1 -1
- package/src/sap/ui/export/messagebundle_en_US_saprigi.properties +4 -0
- package/src/sap/ui/export/messagebundle_fi.properties +1 -1
- package/src/sap/ui/export/messagebundle_ja.properties +1 -1
- package/src/sap/ui/export/messagebundle_no.properties +1 -1
- package/src/sap/ui/export/messagebundle_sk.properties +1 -1
- package/src/sap/ui/export/messagebundle_vi.properties +1 -1
- package/src/sap/ui/export/provider/DataProviderBase.js +24 -0
- package/src/sap/ui/export/util/Filter.js +2 -3
package/package.json
CHANGED
|
@@ -24,13 +24,13 @@ sap.ui.define([
|
|
|
24
24
|
* @param {string} [mSettings.fileName] - Optional file name for the exported file
|
|
25
25
|
* @param {sap.ui.export.FileType} [mSettings.fileType] - <code>FileType</code> that is used to identify the file-ending and MIME-type of the file
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
27
|
+
* @class The <code>sap.ui.export.ExportBase</code> class allows you to export table data from a UI5 application to certain formats. This class is an abstract class that requires specific implementations for each file format.
|
|
28
28
|
*
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.112.2
|
|
31
31
|
*
|
|
32
32
|
* @since 1.96
|
|
33
|
-
* @
|
|
33
|
+
* @alias sap.ui.export.ExportBase
|
|
34
34
|
* @extends sap.ui.base.EventProvider
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
@@ -53,19 +53,24 @@ sap.ui.define([
|
|
|
53
53
|
this._mSettings[sProperty] = sProperty !== 'dataSource' ? mSettings[sProperty] : this.processDataSource(mSettings[sProperty]);
|
|
54
54
|
}
|
|
55
55
|
}.bind(this));
|
|
56
|
+
|
|
57
|
+
/* Pre-process dataSource related settings */
|
|
58
|
+
if (this._mSettings.workbook) {
|
|
59
|
+
this._mSettings.workbook.hierarchyLevel = ExportUtils.getHierarchyLevelProperty(mSettings.dataSource);
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
63
|
|
|
59
64
|
/**
|
|
60
65
|
* The <code>beforeExport</code> event is fired just before the export process is started.
|
|
61
66
|
*
|
|
62
|
-
* @name sap.ui.export.ExportBase#beforeExport
|
|
63
|
-
* @event
|
|
64
67
|
* @param {sap.ui.base.Event} oEvent
|
|
65
68
|
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
66
69
|
* @param {object} oEvent.getParameters
|
|
67
70
|
* @param {object} oEvent.getParameter.exportSettings - Contains export-related configuration
|
|
68
71
|
*
|
|
72
|
+
* @name sap.ui.export.ExportBase#beforeExport
|
|
73
|
+
* @event
|
|
69
74
|
* @since 1.96
|
|
70
75
|
* @public
|
|
71
76
|
*/
|
|
@@ -83,8 +88,6 @@ sap.ui.define([
|
|
|
83
88
|
*
|
|
84
89
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
85
90
|
*
|
|
86
|
-
* @name sap.ui.export.ExportBase#attachBeforeExport
|
|
87
|
-
* @function
|
|
88
91
|
* @since 1.96
|
|
89
92
|
* @public
|
|
90
93
|
*/
|
|
@@ -102,8 +105,6 @@ sap.ui.define([
|
|
|
102
105
|
*
|
|
103
106
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
104
107
|
*
|
|
105
|
-
* @name sap.ui.export.ExportBase#detachBeforeExport
|
|
106
|
-
* @function
|
|
107
108
|
* @since 1.96
|
|
108
109
|
* @public
|
|
109
110
|
*/
|
|
@@ -131,9 +132,7 @@ sap.ui.define([
|
|
|
131
132
|
/**
|
|
132
133
|
* Cancels the current export process.
|
|
133
134
|
*
|
|
134
|
-
* @function
|
|
135
135
|
* @abstract
|
|
136
|
-
* @name sap.ui.export.ExportBase#cancel
|
|
137
136
|
* @public
|
|
138
137
|
*/
|
|
139
138
|
ExportBase.prototype.cancel = function() {
|
|
@@ -148,9 +147,7 @@ sap.ui.define([
|
|
|
148
147
|
* source configuration, a <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
149
148
|
* @returns {object|null} - Valid dataSource object or null in case the dataSource configuration is not supported
|
|
150
149
|
*
|
|
151
|
-
* @function
|
|
152
150
|
* @abstract
|
|
153
|
-
* @name sap.ui.export.ExportBase#processDataSource
|
|
154
151
|
* @public
|
|
155
152
|
*/
|
|
156
153
|
ExportBase.prototype.processDataSource = function(oDataSource) {
|
|
@@ -162,8 +159,8 @@ sap.ui.define([
|
|
|
162
159
|
*
|
|
163
160
|
* @param {object} mSettings Export settings that will be adjusted
|
|
164
161
|
*
|
|
165
|
-
* @function
|
|
166
162
|
* @abstract
|
|
163
|
+
* @private
|
|
167
164
|
*/
|
|
168
165
|
ExportBase.prototype.setDefaultExportSettings = function(mSettings) {
|
|
169
166
|
throw new Error('Abstract function not implemented');
|
|
@@ -174,8 +171,8 @@ sap.ui.define([
|
|
|
174
171
|
*
|
|
175
172
|
* @param {object} mSettings Validated export configuration
|
|
176
173
|
*
|
|
177
|
-
* @function
|
|
178
174
|
* @abstract
|
|
175
|
+
* @private
|
|
179
176
|
*/
|
|
180
177
|
ExportBase.prototype.createBuildPromise = function(mSettings) {
|
|
181
178
|
throw new Error('Abstract function not implemented');
|
|
@@ -184,8 +181,9 @@ sap.ui.define([
|
|
|
184
181
|
/**
|
|
185
182
|
* Returns the specific MIME type
|
|
186
183
|
*
|
|
187
|
-
* @function
|
|
188
184
|
* @abstract
|
|
185
|
+
* @since 1.112
|
|
186
|
+
* @public
|
|
189
187
|
*/
|
|
190
188
|
ExportBase.prototype.getMimeType = function() {
|
|
191
189
|
throw new Error('Abstract function not implemented');
|
|
@@ -196,8 +194,6 @@ sap.ui.define([
|
|
|
196
194
|
*
|
|
197
195
|
* @returns {Promise} Promise that gets resolved once the data has been exported
|
|
198
196
|
*
|
|
199
|
-
* @function
|
|
200
|
-
* @name sap.ui.export.ExportBase#build
|
|
201
197
|
* @public
|
|
202
198
|
*/
|
|
203
199
|
ExportBase.prototype.build = function() {
|
|
@@ -15,7 +15,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
15
15
|
* @class The <code>sap.ui.export.ExportHandler</code> class allows you to export table data from a UI5 application.
|
|
16
16
|
*
|
|
17
17
|
* @author SAP SE
|
|
18
|
-
* @version 1.
|
|
18
|
+
* @version 1.112.2
|
|
19
19
|
*
|
|
20
20
|
* @since 1.102
|
|
21
21
|
* @alias sap.ui.export.ExportHandler
|
|
@@ -51,8 +51,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
51
51
|
/**
|
|
52
52
|
* The <code>beforeExport</code> event is fired just before the export process is started.
|
|
53
53
|
*
|
|
54
|
-
|
|
55
|
-
* @event
|
|
54
|
+
|
|
56
55
|
* @param {sap.ui.base.Event} oEvent
|
|
57
56
|
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
58
57
|
* @param {object} oEvent.getParameters
|
|
@@ -60,6 +59,8 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
60
59
|
* @param {object} oEvent.getParameters.userExportSettings User specific settings from the "Export As" dialog
|
|
61
60
|
* @param {sap.ui.export.util.Filter[]} oEvent.getParameters.filterSettings Array of filter settings for the exported data
|
|
62
61
|
*
|
|
62
|
+
* @name sap.ui.export.ExportHandler#beforeExport
|
|
63
|
+
* @event
|
|
63
64
|
* @since 1.102
|
|
64
65
|
* @public
|
|
65
66
|
*/
|
|
@@ -74,7 +75,6 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
74
75
|
* @param {object} [oData] An application-specific payload object that will be passed to the event handler along with the event object when firing the event
|
|
75
76
|
* @param {function} fnHandler The function to be called when the event occurs
|
|
76
77
|
* @param {object} [oListener] Context object to call the event handler with. Defaults to the <code>sap.ui.export.ExportHandler</code> instance itself
|
|
77
|
-
*
|
|
78
78
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
79
79
|
*
|
|
80
80
|
* @since 1.102
|
|
@@ -91,7 +91,6 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
91
91
|
*
|
|
92
92
|
* @param {function} fnHandler The function to be called when the event occurs
|
|
93
93
|
* @param {object} [oListener] Context object on which the given function had to be called
|
|
94
|
-
*
|
|
95
94
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
96
95
|
*
|
|
97
96
|
* @since 1.102
|
|
@@ -101,6 +100,14 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
101
100
|
return this.detachEvent('beforeExport', fnHandler, oListener);
|
|
102
101
|
};
|
|
103
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Returns a Promise that gets resolved as soon as the initialization
|
|
105
|
+
* of the <code>ExportHandler</code> has been finished.
|
|
106
|
+
*
|
|
107
|
+
* @returns {Promise} Initialization finished
|
|
108
|
+
*
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
104
111
|
ExportHandler.prototype.initialized = function() {
|
|
105
112
|
return this._initialized;
|
|
106
113
|
};
|
|
@@ -147,6 +154,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
147
154
|
* empty array.
|
|
148
155
|
*
|
|
149
156
|
* @returns {Promise<sap.ui.model.odata.v4.Context[]>} <code>Promise</code> that gets resolved with the requested FileShare <code>Context</code> <code>Array</code>
|
|
157
|
+
*
|
|
150
158
|
* @private
|
|
151
159
|
*/
|
|
152
160
|
ExportHandler.prototype.getFileShareContexts = function() {
|
|
@@ -171,6 +179,8 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
171
179
|
*
|
|
172
180
|
* @param {string} [sFileName] Suggested name of the file including file extension
|
|
173
181
|
* @returns {Promise} Resolves with the file location selected in the <code>CloudFilePicker</code>
|
|
182
|
+
*
|
|
183
|
+
* @private
|
|
174
184
|
*/
|
|
175
185
|
ExportHandler.prototype.getRemoteFileLocation = function(sFileName) {
|
|
176
186
|
var that = this;
|
|
@@ -237,6 +247,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
237
247
|
* @param {boolean} [mCustomSettings.includeFilterSettings] Defines whether the filter settings on the binding should be included in the exported file
|
|
238
248
|
* @param {object} mCloudFileInfo FileShareItem representation of the file
|
|
239
249
|
* @returns {Promise} A <code>Promise</code> that resolves with the desired export instance
|
|
250
|
+
*
|
|
240
251
|
* @private
|
|
241
252
|
*/
|
|
242
253
|
ExportHandler.prototype.getExportInstance = function(mExportSettings, mCustomSettings, mCloudFileInfo) {
|
|
@@ -346,6 +357,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
346
357
|
*
|
|
347
358
|
* @param {object} mCloudFileInfo FileShareItem representation of the file
|
|
348
359
|
* @returns {Promise} A <code>Promise</code> that gets resolved after the generated file has been transferred to the FileShareSupport OData service
|
|
360
|
+
*
|
|
349
361
|
* @private
|
|
350
362
|
*/
|
|
351
363
|
ExportHandler.prototype.uploadFile = function(mCloudFileInfo) {
|
|
@@ -401,6 +413,8 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
401
413
|
* @param {sap.ui.model.odata.v4.ODataListBinding} oBinding ListBinding that is bound to the desired folder
|
|
402
414
|
* @param {object} mCloudFileInfo FileShareItem representation of the file
|
|
403
415
|
* @returns {Promise} <code>Promise</code> that resolves with a Link to the created file
|
|
416
|
+
*
|
|
417
|
+
* @private
|
|
404
418
|
*/
|
|
405
419
|
ExportHandler.prototype._createFile = function(oBinding, mCloudFileInfo) {
|
|
406
420
|
return new Promise(function(fnResolve, fnReject) {
|
|
@@ -434,9 +448,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
434
448
|
* @param {object} mExportSettings Export settings that are used for the export
|
|
435
449
|
* @returns {Promise} A <code>Promise</code> that gets resolved after the export process has been finished
|
|
436
450
|
*
|
|
437
|
-
* @name sap.ui.export.ExportHandler#export
|
|
438
451
|
* @since 1.102
|
|
439
|
-
* @function
|
|
440
452
|
* @public
|
|
441
453
|
*/
|
|
442
454
|
ExportHandler.prototype.export = function(mExportSettings) {
|
|
@@ -546,6 +558,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
546
558
|
*
|
|
547
559
|
* @param {object} mCloudFileInfo FileShareItem representation that contains the reference to the FileShare
|
|
548
560
|
* @returns {Promise} Returns a <code>Promise</code> that either resolves with the current CloudFileInfo or rejects with an error message
|
|
561
|
+
*
|
|
549
562
|
* @private
|
|
550
563
|
*/
|
|
551
564
|
ExportHandler.prototype.validateFileShare = function(mCloudFileInfo) {
|
|
@@ -569,6 +582,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
569
582
|
* the FileShareSupport is available and a DataSource can be obtained.
|
|
570
583
|
*
|
|
571
584
|
* @returns {Promise<sap.ui.model.odata.v4.ODataModel>} ODataModel for the FileShareSupport service
|
|
585
|
+
*
|
|
572
586
|
* @private
|
|
573
587
|
*/
|
|
574
588
|
ExportHandler.prototype.getFileShareModel = function() {
|
|
@@ -594,6 +608,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
594
608
|
* Evaluates whether there is any FileShare with vendor Google
|
|
595
609
|
*
|
|
596
610
|
* @returns {Promise<boolean>} Indicates whether there is a FileShare with vendor Google
|
|
611
|
+
*
|
|
597
612
|
* @private
|
|
598
613
|
*/
|
|
599
614
|
ExportHandler.prototype.isGoogleSheetSupported = function() {
|
|
@@ -607,6 +622,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
607
622
|
*
|
|
608
623
|
* @param {sap.ui.model.odata.v4.Context} oContext The OData <code>Context</code> of the FileShare
|
|
609
624
|
* @returns {boolean} Indicates whether the FileShare vendor is Google
|
|
625
|
+
*
|
|
610
626
|
* @private
|
|
611
627
|
*/
|
|
612
628
|
ExportHandler.prototype.isGoogleWorkspace = function(oContext) {
|
|
@@ -130,14 +130,13 @@ sap.ui.define([
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
|
-
* Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
133
|
+
* @class Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
134
134
|
*
|
|
135
135
|
* @author SAP SE
|
|
136
|
-
* @version 1.
|
|
136
|
+
* @version 1.112.2
|
|
137
137
|
*
|
|
138
138
|
* @since 1.59
|
|
139
|
-
* @
|
|
140
|
-
* @namespace
|
|
139
|
+
* @alias sap.ui.export.ExportUtils
|
|
141
140
|
* @private
|
|
142
141
|
* @ui5-restricted sap.ui.comp.smarttable.SmartTable
|
|
143
142
|
*/
|
|
@@ -147,14 +146,12 @@ sap.ui.define([
|
|
|
147
146
|
/**
|
|
148
147
|
* Uses the Launchpad Cloud Service to intercept a given URL.
|
|
149
148
|
*
|
|
150
|
-
* @name sap.ui.export.ExportUtils.interceptUrl
|
|
151
|
-
* @function
|
|
152
|
-
*
|
|
153
149
|
* @param {string} sUrl The URL to intercept
|
|
154
150
|
* @return {string} The intercepted URL
|
|
155
151
|
*
|
|
156
|
-
* @private
|
|
157
152
|
* @static
|
|
153
|
+
* @since 1.112
|
|
154
|
+
* @public
|
|
158
155
|
*/
|
|
159
156
|
interceptUrl: function(sUrl) {
|
|
160
157
|
// Check if cloud InterceptService exists (for destination routing) - See JIRA: FIORITECHP1-8941
|
|
@@ -177,6 +174,9 @@ sap.ui.define([
|
|
|
177
174
|
* result.
|
|
178
175
|
*
|
|
179
176
|
* @returns {Promise} A <code>Promise</code> that gets resolved with a data source obtained from the <code>FileShareSupport</code> module or undefined if there is none
|
|
177
|
+
*
|
|
178
|
+
* @static
|
|
179
|
+
* @since 1.108
|
|
180
180
|
* @public
|
|
181
181
|
*/
|
|
182
182
|
fetchDataSource: function() {
|
|
@@ -210,6 +210,9 @@ sap.ui.define([
|
|
|
210
210
|
*
|
|
211
211
|
* @param {string} url Relative URL that needs to be processed for Web Worker usage
|
|
212
212
|
* @returns {string|any} Returns the absolute URL or the original value in case there is no URL provided
|
|
213
|
+
*
|
|
214
|
+
* @static
|
|
215
|
+
* @private
|
|
213
216
|
*/
|
|
214
217
|
normalizeUrl: function(url) {
|
|
215
218
|
return url ? new URL(url, document.baseURI).toString() : url;
|
|
@@ -223,10 +226,10 @@ sap.ui.define([
|
|
|
223
226
|
* @param {boolean} [bRemoteDestination] Activates remote destinations for export
|
|
224
227
|
* @param {sap.ui.core.Control} [oOpener] The opener of the dialog
|
|
225
228
|
* @param {function(sap.m.Dialog)} [fnCallback] Handler function that is called once the dialog has been opened. A reference to the dialog is passed as parameter
|
|
226
|
-
*
|
|
227
229
|
* @returns {Promise} Promise which resolves with the export settings defined by the user
|
|
228
230
|
*
|
|
229
231
|
* @static
|
|
232
|
+
* @private
|
|
230
233
|
*/
|
|
231
234
|
getExportSettingsViaDialog: function(mCustomConfig, oExportCapabilities, bRemoteDestination, oOpener, fnCallback) {
|
|
232
235
|
return new Promise(function (fnResolve, fnReject) {
|
|
@@ -376,6 +379,8 @@ sap.ui.define([
|
|
|
376
379
|
*
|
|
377
380
|
* @param {object} oFilter A single filter object according to ListBinding#getFilterInfo
|
|
378
381
|
* @returns {string} Textual representation of the filter operation and value
|
|
382
|
+
*
|
|
383
|
+
* @static
|
|
379
384
|
* @private
|
|
380
385
|
*/
|
|
381
386
|
_getReadableFilterValue: function(oFilter) {
|
|
@@ -412,6 +417,8 @@ sap.ui.define([
|
|
|
412
417
|
*
|
|
413
418
|
* @param {object} oFilter Filter configuration according to ListBinding#getFilterInfo
|
|
414
419
|
* @returns {Array} Array of filter entries
|
|
420
|
+
*
|
|
421
|
+
* @static
|
|
415
422
|
* @private
|
|
416
423
|
*/
|
|
417
424
|
_parseFilter: function(oFilter) {
|
|
@@ -435,6 +442,8 @@ sap.ui.define([
|
|
|
435
442
|
*
|
|
436
443
|
* @param {object} oLogicalFilter Filter object according to ListBinding#getFilterInfo
|
|
437
444
|
* @returns {Array} Array containing evaluated filter settings
|
|
445
|
+
*
|
|
446
|
+
* @static
|
|
438
447
|
* @private
|
|
439
448
|
*/
|
|
440
449
|
_parseLogical: function(oLogicalFilter) {
|
|
@@ -501,6 +510,8 @@ sap.ui.define([
|
|
|
501
510
|
*
|
|
502
511
|
* @param {object} oBinaryFilter Filter object according to ListBinding#getFilterInfo
|
|
503
512
|
* @returns {Array} Array containing this explicit filter setting
|
|
513
|
+
*
|
|
514
|
+
* @static
|
|
504
515
|
* @private
|
|
505
516
|
*/
|
|
506
517
|
_parseBinary: function(oBinaryFilter) {
|
|
@@ -521,6 +532,8 @@ sap.ui.define([
|
|
|
521
532
|
*
|
|
522
533
|
* @param {object} oUnaryFilter Filter object according to ListBinding#getFilterInfo
|
|
523
534
|
* @returns {Array} Array containing the modified subsequent filter
|
|
535
|
+
*
|
|
536
|
+
* @static
|
|
524
537
|
* @private
|
|
525
538
|
*/
|
|
526
539
|
_parseUnary: function(oUnaryFilter) {
|
|
@@ -545,6 +558,8 @@ sap.ui.define([
|
|
|
545
558
|
*
|
|
546
559
|
* @param {object} oCallFilter Filter object according to ListBinding#getFilterInfo
|
|
547
560
|
* @returns {Array} Array containing this explicit filter setting
|
|
561
|
+
*
|
|
562
|
+
* @static
|
|
548
563
|
* @private
|
|
549
564
|
*/
|
|
550
565
|
_parseCall: function(oCallFilter) {
|
|
@@ -589,6 +604,8 @@ sap.ui.define([
|
|
|
589
604
|
*
|
|
590
605
|
* @param {sap.ui.model.ListBinding | sap.ui.model.TreeBinding} oBinding ListBinding or TreeBinding instance
|
|
591
606
|
* @returns {sap.ui.export.util.Filter[]} Array of sap.ui.export.util.Filter objects. The Array is empty if no filters are available on the binding.
|
|
607
|
+
*
|
|
608
|
+
* @static
|
|
592
609
|
* @private
|
|
593
610
|
*/
|
|
594
611
|
getFilters: function(oBinding) {
|
|
@@ -616,7 +633,10 @@ sap.ui.define([
|
|
|
616
633
|
* time stamp at which the document was created
|
|
617
634
|
*
|
|
618
635
|
* @returns {Promise<object>} Resolves when the technical information has been obtained
|
|
619
|
-
|
|
636
|
+
*
|
|
637
|
+
* @static
|
|
638
|
+
* @private
|
|
639
|
+
*/
|
|
620
640
|
parseTechnicalConfiguration: function() {
|
|
621
641
|
var oUserConfig, oBundle, oUshellContainer;
|
|
622
642
|
|
|
@@ -660,6 +680,10 @@ sap.ui.define([
|
|
|
660
680
|
*
|
|
661
681
|
* @param {Blob} oBlob - Binary large object of the file that should be saved to the filesystem
|
|
662
682
|
* @param {string} [sFilename] - Filename of the file including the file extension
|
|
683
|
+
*
|
|
684
|
+
* @static
|
|
685
|
+
* @since 1.112
|
|
686
|
+
* @public
|
|
663
687
|
*/
|
|
664
688
|
saveAsFile: function(oBlob, sFilename) {
|
|
665
689
|
var link, downloadSupported, fnSave;
|
|
@@ -719,7 +743,8 @@ sap.ui.define([
|
|
|
719
743
|
* @param {boolean} mSettings.worker Controls whether the export will be run in a dedicated Web Worker or not
|
|
720
744
|
* @param {object} mSettings.customizing Contains export customizing like currency and unit scale settings
|
|
721
745
|
*
|
|
722
|
-
* @
|
|
746
|
+
* @static
|
|
747
|
+
* @private
|
|
723
748
|
*/
|
|
724
749
|
validateSettings: function(mSettings) {
|
|
725
750
|
|
|
@@ -750,6 +775,9 @@ sap.ui.define([
|
|
|
750
775
|
* Validates the filename and type related export settings
|
|
751
776
|
*
|
|
752
777
|
* @param {object} mSettings Export settings containing the file
|
|
778
|
+
*
|
|
779
|
+
* @static
|
|
780
|
+
* @private
|
|
753
781
|
*/
|
|
754
782
|
validateFileSettings: function(mSettings) {
|
|
755
783
|
mSettings.fileType = FileType[mSettings.fileType] ? mSettings.fileType : FileType.XLSX;
|
|
@@ -763,6 +791,9 @@ sap.ui.define([
|
|
|
763
791
|
* @param {string} sName Name of the file
|
|
764
792
|
* @param {sap.ui.export.FileType} sType Selected FileType
|
|
765
793
|
* @returns {string} Updated file name
|
|
794
|
+
*
|
|
795
|
+
* @static
|
|
796
|
+
* @private
|
|
766
797
|
*/
|
|
767
798
|
validateFileName: function(sName, sType) {
|
|
768
799
|
var sExtension;
|
|
@@ -791,7 +822,7 @@ sap.ui.define([
|
|
|
791
822
|
* @param {string} mDataSource.type Defines the type of export i.E. 'odata' or 'array'
|
|
792
823
|
* @param {boolean} [mDataSource.useBatch] Controls whether the OData export uses $batch requests or not
|
|
793
824
|
*
|
|
794
|
-
* @
|
|
825
|
+
* @static
|
|
795
826
|
* @private
|
|
796
827
|
*/
|
|
797
828
|
_validateDataSource: function(mDataSource) {
|
|
@@ -870,7 +901,7 @@ sap.ui.define([
|
|
|
870
901
|
* @param {object} mWorkbook.context Meta information that is written to the generated file
|
|
871
902
|
* @param {string} mWorkbook.hierarchyLevel Name of the property that contains the hierarchy level information
|
|
872
903
|
*
|
|
873
|
-
* @
|
|
904
|
+
* @static
|
|
874
905
|
* @private
|
|
875
906
|
*/
|
|
876
907
|
_validateWorkbook: function(mWorkbook) {
|
|
@@ -1040,7 +1071,8 @@ sap.ui.define([
|
|
|
1040
1071
|
* Validates and fixes the type definition of a particular column if possible.
|
|
1041
1072
|
*
|
|
1042
1073
|
* @param {object} oColumn Export settings of a particular column
|
|
1043
|
-
*
|
|
1074
|
+
*
|
|
1075
|
+
* @static
|
|
1044
1076
|
* @private
|
|
1045
1077
|
*/
|
|
1046
1078
|
_validateType: function(oColumn) {
|
|
@@ -1106,14 +1138,14 @@ sap.ui.define([
|
|
|
1106
1138
|
*
|
|
1107
1139
|
* @param {object} oContext Context object
|
|
1108
1140
|
* @param {string} [oContext.application] Name of the application (default: "SAP UI5")
|
|
1109
|
-
* @param {string} [oContext.version] Application version (default: "1.
|
|
1141
|
+
* @param {string} [oContext.version] Application version (default: "1.112.2")
|
|
1110
1142
|
* @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
|
|
1111
1143
|
* @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
|
|
1112
1144
|
* @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
|
|
1113
1145
|
* @param {string} [oContext.metaSheetName] Name of the optional metainfo sheet - Maximum length of 31 characters
|
|
1114
1146
|
* @param {Array} [oContext.metainfo] Array of objects that represent a group in the additional metainfo sheet
|
|
1115
1147
|
*
|
|
1116
|
-
* @
|
|
1148
|
+
* @static
|
|
1117
1149
|
* @private
|
|
1118
1150
|
*/
|
|
1119
1151
|
_validateWorkbookContext: function(oContext) {
|
|
@@ -1156,8 +1188,8 @@ sap.ui.define([
|
|
|
1156
1188
|
* @param {number} [iMaxLength] Maximum allowed length.
|
|
1157
1189
|
* @param {string|RegExp} [sRemove] Unsupported characters that will be removed
|
|
1158
1190
|
*
|
|
1191
|
+
* @static
|
|
1159
1192
|
* @private
|
|
1160
|
-
* @since 1.78
|
|
1161
1193
|
*/
|
|
1162
1194
|
_validateString: function(oContext, sProperty, sDefaultValue, iMaxLength, sRemove) {
|
|
1163
1195
|
var sValue;
|
|
@@ -1188,7 +1220,7 @@ sap.ui.define([
|
|
|
1188
1220
|
* @param {string} sType Expected type of the property
|
|
1189
1221
|
* @param {Any} [defaultValue] Default value that gets applied if the initial value is invalid
|
|
1190
1222
|
*
|
|
1191
|
-
* @
|
|
1223
|
+
* @static
|
|
1192
1224
|
* @private
|
|
1193
1225
|
*/
|
|
1194
1226
|
_validateProperty: function(oContext, sProperty, sType, defaultValue) {
|
|
@@ -1219,6 +1251,8 @@ sap.ui.define([
|
|
|
1219
1251
|
* @param {object} oCustomizing.currency Currency specific customizing
|
|
1220
1252
|
* @param {object} oCustomizing.unit Unit of measure specific customizing
|
|
1221
1253
|
* @param {string} sProperty Key property of the specific customizing setting
|
|
1254
|
+
*
|
|
1255
|
+
* @static
|
|
1222
1256
|
* @private
|
|
1223
1257
|
*/
|
|
1224
1258
|
_validateScaleCustomizing: function(oCustomizing, sProperty) {
|
|
@@ -1254,6 +1288,10 @@ sap.ui.define([
|
|
|
1254
1288
|
* @param {object} mSettings Export configuration with optional FileType
|
|
1255
1289
|
* @param {object} [mCapabilities] Export Capabilities for all supported types
|
|
1256
1290
|
* @returns {Promise<sap.ui.export.ExportBase>} A Promise that gets resolved with the requested instance
|
|
1291
|
+
*
|
|
1292
|
+
* @static
|
|
1293
|
+
* @since 1.112
|
|
1294
|
+
* @public
|
|
1257
1295
|
*/
|
|
1258
1296
|
getExportInstance: function(mSettings, mCapabilities) {
|
|
1259
1297
|
var sClassName, sFileType;
|
|
@@ -1281,7 +1319,10 @@ sap.ui.define([
|
|
|
1281
1319
|
* in case the binding provides this information.
|
|
1282
1320
|
*
|
|
1283
1321
|
* @param {sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oBinding - A subclass of <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
1284
|
-
* @
|
|
1322
|
+
* @returns {number|null} Amount of data in the backend or null if the binding does not provide this information
|
|
1323
|
+
*
|
|
1324
|
+
* @static
|
|
1325
|
+
* @private
|
|
1285
1326
|
*/
|
|
1286
1327
|
getCountFromBinding: function(oBinding) {
|
|
1287
1328
|
var iCount;
|
|
@@ -1302,6 +1343,34 @@ sap.ui.define([
|
|
|
1302
1343
|
return iCount;
|
|
1303
1344
|
},
|
|
1304
1345
|
|
|
1346
|
+
/**
|
|
1347
|
+
* Returns the "hierarchy-level-for" annotated property of the bound entity.
|
|
1348
|
+
*
|
|
1349
|
+
* @param {sap.ui.model.odata.v2.ODataTreeBinding|sap.ui.model.odata.v4.ODataListBinding} oBinding Binding that is used to evaluate the property name
|
|
1350
|
+
* @returns {string|undefined} Name of the property which is annotated with "hierarchy-level-for"
|
|
1351
|
+
*
|
|
1352
|
+
* @static
|
|
1353
|
+
* @private
|
|
1354
|
+
*/
|
|
1355
|
+
getHierarchyLevelProperty: function(oBinding) {
|
|
1356
|
+
|
|
1357
|
+
if (!oBinding || typeof oBinding.isA !== 'function') {
|
|
1358
|
+
return undefined;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/* Check for ODataTreeBinding#getTreeAnnotation since this is not a public function */
|
|
1362
|
+
if (oBinding.isA('sap.ui.model.odata.v2.ODataTreeBinding') && typeof oBinding.getTreeAnnotation === 'function') {
|
|
1363
|
+
return oBinding.getTreeAnnotation('hierarchy-level-for');
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
if (oBinding.isA('sap.ui.model.odata.v4.ODataListBinding')) {
|
|
1367
|
+
var oAggregationInfo = oBinding.getAggregation(/*bVerbose*/true);
|
|
1368
|
+
return oAggregationInfo ? oAggregationInfo.$DistanceFromRootProperty : undefined;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
return undefined;
|
|
1372
|
+
},
|
|
1373
|
+
|
|
1305
1374
|
/**
|
|
1306
1375
|
* Splits up all column settings that reference multiple
|
|
1307
1376
|
* properties as well as amounts and currency codes.
|
|
@@ -1312,6 +1381,9 @@ sap.ui.define([
|
|
|
1312
1381
|
* @param {Array} aColumns Export-related column configuration that will be split up if necessary
|
|
1313
1382
|
* @param {function} [fnResolveColumnLabel] Resolves the label for a particular column that is not directly reflected
|
|
1314
1383
|
* @returns {Array} Updated column configuration
|
|
1384
|
+
*
|
|
1385
|
+
* @static
|
|
1386
|
+
* @private
|
|
1315
1387
|
*/
|
|
1316
1388
|
splitColumns: function(aColumns, fnResolveColumnLabel) {
|
|
1317
1389
|
var aResult = [];
|
|
@@ -1387,6 +1459,9 @@ sap.ui.define([
|
|
|
1387
1459
|
* <code>ResourceBundle</code> of the sap.ui.export library.
|
|
1388
1460
|
*
|
|
1389
1461
|
* @returns {Promise} <code>Promise</code> with the <code>ResourceBundle</code>
|
|
1462
|
+
*
|
|
1463
|
+
* @static
|
|
1464
|
+
* @private
|
|
1390
1465
|
*/
|
|
1391
1466
|
getResourceBundle: function() {
|
|
1392
1467
|
if (!oResourceBundle) {
|
|
@@ -1404,6 +1479,8 @@ sap.ui.define([
|
|
|
1404
1479
|
* based on the UI5 Core Configuration.
|
|
1405
1480
|
*
|
|
1406
1481
|
* @returns {Object} Format settings
|
|
1482
|
+
*
|
|
1483
|
+
* @static
|
|
1407
1484
|
* @private
|
|
1408
1485
|
*/
|
|
1409
1486
|
getFormatSettings: function() {
|
|
@@ -14,10 +14,10 @@ sap.ui.define([
|
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
17
|
+
* @class The <code>sap.ui.export.PortableDocument</code> class allows you to export table data from a UI5 application to a Portable Document Format (*.PDF) file.
|
|
18
18
|
*
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.112.2
|
|
21
21
|
*
|
|
22
22
|
* @since 1.96
|
|
23
23
|
* @alias sap.ui.export.PortableDocument
|
|
@@ -79,6 +79,8 @@ sap.ui.define([
|
|
|
79
79
|
*
|
|
80
80
|
* @param {sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oBinding - A subclass of <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
81
81
|
* @returns {object} - Valid data source configuration built upon the ListBinding
|
|
82
|
+
*
|
|
83
|
+
* @private
|
|
82
84
|
*/
|
|
83
85
|
PortableDocument.prototype.createDataSourceFromBinding = function(oBinding) {
|
|
84
86
|
var oDataSource = null;
|
|
@@ -126,6 +128,8 @@ sap.ui.define([
|
|
|
126
128
|
*
|
|
127
129
|
* @param {string} sCurrentServiceUrl URL of the data service
|
|
128
130
|
* @returns {string} Converted service url
|
|
131
|
+
*
|
|
132
|
+
* @private
|
|
129
133
|
*/
|
|
130
134
|
PortableDocument.prototype._resolveServiceUrl = function(sCurrentServiceUrl) {
|
|
131
135
|
var isRelative, sReference;
|
|
@@ -152,6 +156,7 @@ sap.ui.define([
|
|
|
152
156
|
*
|
|
153
157
|
* @param {object} mSettings Export settings
|
|
154
158
|
* @returns {object} DocumentDescription object that contains all relevant export settings
|
|
159
|
+
*
|
|
155
160
|
* @private
|
|
156
161
|
*/
|
|
157
162
|
PortableDocument.prototype._createDocumentDescription = function(mSettings) {
|
|
@@ -245,6 +250,8 @@ sap.ui.define([
|
|
|
245
250
|
*
|
|
246
251
|
* @param {object} mDataSource DataSource object containing information about OData version
|
|
247
252
|
* @returns {string} Name of the EntitySet according to the OData version
|
|
253
|
+
*
|
|
254
|
+
* @private
|
|
248
255
|
*/
|
|
249
256
|
PortableDocument.prototype._getEntitySetName = function(mDataSource) {
|
|
250
257
|
var sCollectionName, iVersion;
|
|
@@ -263,6 +270,8 @@ sap.ui.define([
|
|
|
263
270
|
*
|
|
264
271
|
* @param {object} oDataSource DataSource settings of the export configuration
|
|
265
272
|
* @returns {ODataModel} ODataModel, either V2 or V4.
|
|
273
|
+
*
|
|
274
|
+
* @private
|
|
266
275
|
*/
|
|
267
276
|
PortableDocument.prototype._getModel = function(oDataSource) {
|
|
268
277
|
var iVersion = oDataSource.version || 2;
|
|
@@ -278,6 +287,8 @@ sap.ui.define([
|
|
|
278
287
|
*
|
|
279
288
|
* @param {object} mSettings Export configuration object
|
|
280
289
|
* @returns {Promise} Promise that gets resolved when the default settings have been applied
|
|
290
|
+
*
|
|
291
|
+
* @private
|
|
281
292
|
*/
|
|
282
293
|
PortableDocument.prototype.setDefaultExportSettings = function(mSettings) {
|
|
283
294
|
var oContext = mSettings && mSettings.workbook && mSettings.workbook.context;
|
|
@@ -304,6 +315,8 @@ sap.ui.define([
|
|
|
304
315
|
* @param {object} oDataSource DataSource settings of the export configuration
|
|
305
316
|
*
|
|
306
317
|
* @returns {Promise} A Promise that resolves with the newly created Id of the DocumentDescription
|
|
318
|
+
*
|
|
319
|
+
* @private
|
|
307
320
|
*/
|
|
308
321
|
PortableDocument.prototype.postDocumentDescription = function(oDocumentDescription, oDataSource) {
|
|
309
322
|
var oBinding, oModel, sPath;
|
|
@@ -355,6 +368,8 @@ sap.ui.define([
|
|
|
355
368
|
*
|
|
356
369
|
* @param {object} mSettings Export settings
|
|
357
370
|
* @returns {Promise} Promise that is being resolved as soon as the PDF export is finished
|
|
371
|
+
*
|
|
372
|
+
* @private
|
|
358
373
|
*/
|
|
359
374
|
PortableDocument.prototype.createBuildPromise = function(mSettings) {
|
|
360
375
|
var that = this;
|
|
@@ -369,22 +384,31 @@ sap.ui.define([
|
|
|
369
384
|
close: function(oEvent) {
|
|
370
385
|
if (oEvent.getParameter('cancelPressed')) {
|
|
371
386
|
that.cancel();
|
|
372
|
-
oBusyDialog.destroy();
|
|
373
|
-
oBusyDialog = null;
|
|
374
387
|
}
|
|
388
|
+
|
|
389
|
+
oBusyDialog.destroy();
|
|
390
|
+
oBusyDialog = null;
|
|
375
391
|
}
|
|
376
392
|
});
|
|
377
393
|
|
|
378
394
|
oDocumentDescription = that._createDocumentDescription(mSettings);
|
|
395
|
+
oBusyDialog.open();
|
|
379
396
|
|
|
380
397
|
return that.postDocumentDescription(oDocumentDescription, mSettings.dataSource).then(function(sDocumentDescriptionId) {
|
|
381
|
-
|
|
382
|
-
|
|
398
|
+
/*
|
|
399
|
+
* Keep reference to oBusyDialog to prevent further processing if the user has canceled the export
|
|
400
|
+
* while the DocumentDescription was sent to the backend via POST. There is no dedicated option to
|
|
401
|
+
* cancel a request via the binding API.
|
|
402
|
+
*/
|
|
383
403
|
return oBusyDialog && that.sendRequest(mSettings.dataSource.dataUrl, sDocumentDescriptionId).then(function(response) {
|
|
384
404
|
ExportUtils.saveAsFile(response, mSettings.fileName);
|
|
385
|
-
oBusyDialog.destroy();
|
|
386
405
|
}).catch(function(oError) {
|
|
387
|
-
|
|
406
|
+
|
|
407
|
+
/* Handle ignore Promise rejection due to cancelation by the user */
|
|
408
|
+
if (oError === null) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
388
412
|
oError.text()
|
|
389
413
|
.then(function(sError) {
|
|
390
414
|
ExportDialog.showErrorMessage(sError);
|
|
@@ -392,6 +416,8 @@ sap.ui.define([
|
|
|
392
416
|
.catch(function() {
|
|
393
417
|
ExportDialog.showErrorMessage(oResourceBundle.getText('PDF_GENERIC_ERROR'));
|
|
394
418
|
});
|
|
419
|
+
}).finally(function() {
|
|
420
|
+
oBusyDialog && oBusyDialog.close();
|
|
395
421
|
});
|
|
396
422
|
});
|
|
397
423
|
};
|
|
@@ -402,6 +428,8 @@ sap.ui.define([
|
|
|
402
428
|
* @param {string} sUrl Absolute data URL of the OData entity that should be exported as PDF
|
|
403
429
|
* @param {string} sDocumentDescriptionId GUID of the DocumentDescription that should be used for creating the PDF
|
|
404
430
|
* @returns {Promise} A Promise that gets resolved after the XHR request
|
|
431
|
+
*
|
|
432
|
+
* @private
|
|
405
433
|
*/
|
|
406
434
|
PortableDocument.prototype.sendRequest = function(sUrl, sDocumentDescriptionId) {
|
|
407
435
|
return new Promise(function(fnResolve, fnReject) {
|
|
@@ -414,7 +442,7 @@ sap.ui.define([
|
|
|
414
442
|
oXHR.setRequestHeader('SAP-Document-Description-Id', sDocumentDescriptionId);
|
|
415
443
|
|
|
416
444
|
oXHR.addEventListener('abort', function() {
|
|
417
|
-
fnReject(
|
|
445
|
+
fnReject(null);
|
|
418
446
|
});
|
|
419
447
|
|
|
420
448
|
oXHR.addEventListener('error', function() {
|
|
@@ -439,6 +467,9 @@ sap.ui.define([
|
|
|
439
467
|
* Returns the specific MIME type
|
|
440
468
|
*
|
|
441
469
|
* @returns {string} MIME type for Portable Document Format
|
|
470
|
+
*
|
|
471
|
+
* @since 1.112
|
|
472
|
+
* @public
|
|
442
473
|
*/
|
|
443
474
|
PortableDocument.prototype.getMimeType = function() {
|
|
444
475
|
return 'application/pdf';
|
|
@@ -449,8 +480,6 @@ sap.ui.define([
|
|
|
449
480
|
* or the response has been received already, this function has
|
|
450
481
|
* no effect.
|
|
451
482
|
*
|
|
452
|
-
* @function
|
|
453
|
-
* @name sap.ui.export.PortableDocument#cancel
|
|
454
483
|
* @since 1.96
|
|
455
484
|
* @public
|
|
456
485
|
*/
|
|
@@ -83,7 +83,7 @@ sap.ui.define([
|
|
|
83
83
|
* <li><code>workbook.context</code> - Context object that will be applied to the generated file. It may contain the following fields:</li>
|
|
84
84
|
* <ul>
|
|
85
85
|
* <li><code>application</code> (string) - The application that creates the XLSX document (default: "SAP UI5")</li>
|
|
86
|
-
* <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.
|
|
86
|
+
* <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.112.2")</li>
|
|
87
87
|
* <li><code>title</code> (string) - Title of the XLSX document (NOT the filename)</li>
|
|
88
88
|
* <li><code>modifiedBy</code> (string) - User context for the XLSX document</li>
|
|
89
89
|
* <li><code>sheetName</code> (string) - The label of the data sheet</li>
|
|
@@ -166,7 +166,7 @@ sap.ui.define([
|
|
|
166
166
|
* columns: aColumns,
|
|
167
167
|
* context: {
|
|
168
168
|
* application: 'Debug Test Application',
|
|
169
|
-
* version: '1.
|
|
169
|
+
* version: '1.112.2',
|
|
170
170
|
* title: 'Some random title',
|
|
171
171
|
* modifiedBy: 'John Doe',
|
|
172
172
|
* metaSheetName: 'Custom metadata',
|
|
@@ -275,13 +275,13 @@ sap.ui.define([
|
|
|
275
275
|
* @param {string} [mSettings.fileName="export.xlsx"] - Optional file name for the exported file
|
|
276
276
|
* @param {boolean} [mSettings.showProgress=true] - Set to <code>false</code> to suppress the progress dialog
|
|
277
277
|
*
|
|
278
|
-
* @
|
|
278
|
+
* @class The <code>sap.ui.export.Spreadsheet</code> class allows you to export table data from a UI5 application to a spreadsheet file.
|
|
279
279
|
*
|
|
280
280
|
* @author SAP SE
|
|
281
|
-
* @version 1.
|
|
281
|
+
* @version 1.112.2
|
|
282
282
|
*
|
|
283
283
|
* @since 1.50
|
|
284
|
-
* @
|
|
284
|
+
* @alias sap.ui.export.Spreadsheet
|
|
285
285
|
* @extends sap.ui.export.ExportBase
|
|
286
286
|
* @see {@link topic:2691788a08fc43f7bf269ea7c6336caf Spreadsheet}
|
|
287
287
|
* @public
|
|
@@ -329,10 +329,9 @@ sap.ui.define([
|
|
|
329
329
|
/**
|
|
330
330
|
* Sets the default document title and sheet name to the export parameters object.
|
|
331
331
|
*
|
|
332
|
-
* @function
|
|
333
|
-
* @name sap.ui.export.Spreadsheet#setDefaultExportSettings
|
|
334
332
|
* @param {object} mParameters - Export parameters object
|
|
335
333
|
* @returns {Promise} Promise object
|
|
334
|
+
*
|
|
336
335
|
* @private
|
|
337
336
|
*/
|
|
338
337
|
Spreadsheet.prototype.setDefaultExportSettings = function(mParameters) {
|
|
@@ -398,6 +397,8 @@ sap.ui.define([
|
|
|
398
397
|
* @param {sap.ui.model.odata.ODataMetaModel} oMetaModel - ODataMetaModel instance that is used to request service specific code lists.
|
|
399
398
|
* @param {object} mSettings - Export settings that will receive the code lists
|
|
400
399
|
* @returns {Promise} The returned Promise will always resolve with an Array
|
|
400
|
+
*
|
|
401
|
+
* @private
|
|
401
402
|
*/
|
|
402
403
|
Spreadsheet.requestCodeLists = function(oMetaModel) {
|
|
403
404
|
if (!oMetaModel.isA(['sap.ui.model.odata.ODataMetaModel', 'sap.ui.model.odata.v4.ODataMetaModel'])) {
|
|
@@ -419,14 +420,15 @@ sap.ui.define([
|
|
|
419
420
|
* saves the file to your local device. If the default is prevented, the event handler is responsible
|
|
420
421
|
* for closing and destroying the <code>Dialog</code>.
|
|
421
422
|
*
|
|
422
|
-
|
|
423
|
-
* @event
|
|
423
|
+
|
|
424
424
|
* @param {sap.ui.base.Event} oEvent
|
|
425
425
|
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
426
426
|
* @param {object} oEvent.getParameters
|
|
427
427
|
* @param {ArrayBuffer} oEvent.getParameter.data The data parameter contains the generated file
|
|
428
428
|
* @param {sap.ui.export.ExportDialog} oEvent.getParameter.exportDialog The export dialog instance
|
|
429
429
|
*
|
|
430
|
+
* @name sap.ui.export.Spreadsheet#beforeSave
|
|
431
|
+
* @event
|
|
430
432
|
* @since 1.61
|
|
431
433
|
* @public
|
|
432
434
|
*/
|
|
@@ -441,11 +443,8 @@ sap.ui.define([
|
|
|
441
443
|
* @param {object} [oData] An application-specific payload object that will be passed to the event handler along with the event object when firing the event
|
|
442
444
|
* @param {function} fnHandler The function to be called when the event occurs
|
|
443
445
|
* @param {object} [oListener] Context object to call the event handler with. Defaults to this <code>sap.ui.export.Spreadsheet</code> itself
|
|
444
|
-
*
|
|
445
446
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
446
447
|
*
|
|
447
|
-
* @function
|
|
448
|
-
* @name sap.ui.export.Spreadsheet#attachBeforeSave
|
|
449
448
|
* @since 1.61
|
|
450
449
|
* @public
|
|
451
450
|
*/
|
|
@@ -460,11 +459,8 @@ sap.ui.define([
|
|
|
460
459
|
*
|
|
461
460
|
* @param {function} fnHandler The function to be called, when the event occurs
|
|
462
461
|
* @param {object} [oListener] Context object on which the given function had to be called
|
|
463
|
-
*
|
|
464
462
|
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
465
463
|
*
|
|
466
|
-
* @function
|
|
467
|
-
* @name sap.ui.export.Spreadsheet#detachBeforeSave
|
|
468
464
|
* @since 1.61
|
|
469
465
|
* @public
|
|
470
466
|
*/
|
|
@@ -477,8 +473,6 @@ sap.ui.define([
|
|
|
477
473
|
*
|
|
478
474
|
* @returns {this} - Reference to <code>this</code> in order to allow method chaining
|
|
479
475
|
*
|
|
480
|
-
* @function
|
|
481
|
-
* @name sap.ui.export.Spreadsheet#cancel
|
|
482
476
|
* @since 1.52
|
|
483
477
|
* @public
|
|
484
478
|
*/
|
|
@@ -495,6 +489,9 @@ sap.ui.define([
|
|
|
495
489
|
* Returns the specific MIME type
|
|
496
490
|
*
|
|
497
491
|
* @returns {string} MIME type for Office Open XML Spreadsheet
|
|
492
|
+
*
|
|
493
|
+
* @since 1.112
|
|
494
|
+
* @public
|
|
498
495
|
*/
|
|
499
496
|
Spreadsheet.prototype.getMimeType = function() {
|
|
500
497
|
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
@@ -503,11 +500,10 @@ sap.ui.define([
|
|
|
503
500
|
/**
|
|
504
501
|
* Progress callback. The function is called when the progress status changes.
|
|
505
502
|
*
|
|
506
|
-
* @function
|
|
507
503
|
* @param {number} iFetched - Number of items that are already fetched
|
|
508
504
|
* @param {number} iTotal - Total amount of items that will be fetched
|
|
509
505
|
*
|
|
510
|
-
* @
|
|
506
|
+
* @private
|
|
511
507
|
*/
|
|
512
508
|
Spreadsheet.prototype.onprogress = function(iFetched, iTotal) {
|
|
513
509
|
var iProgress;
|
|
@@ -525,6 +521,8 @@ sap.ui.define([
|
|
|
525
521
|
*
|
|
526
522
|
* @param {sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oBinding - A subclass of <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
527
523
|
* @returns {object} - Valid data source configuration built upon the ListBinding
|
|
524
|
+
*
|
|
525
|
+
* @private
|
|
528
526
|
*/
|
|
529
527
|
Spreadsheet.prototype.createDataSourceFromBinding = function(oBinding) {
|
|
530
528
|
/**
|
|
@@ -639,10 +637,9 @@ sap.ui.define([
|
|
|
639
637
|
/**
|
|
640
638
|
* Creates and returns a new Promise object that triggers the export process for the given {@link sap.ui.export.Spreadsheet}.
|
|
641
639
|
*
|
|
642
|
-
* @function
|
|
643
|
-
* @name sap.ui.export.Spreadsheet#createBuildPromise
|
|
644
640
|
* @param {object} mParameters - Export parameters object
|
|
645
641
|
* @returns {Promise} Promise object
|
|
642
|
+
*
|
|
646
643
|
* @private
|
|
647
644
|
*/
|
|
648
645
|
Spreadsheet.prototype.createBuildPromise = function(mParameters) {
|
|
@@ -20,10 +20,10 @@ sap.ui.define(['sap/base/Log', 'sap/ui/export/ExportUtils'], function(Log, Expor
|
|
|
20
20
|
/**
|
|
21
21
|
* Utility class to perform spreadsheet export.
|
|
22
22
|
*
|
|
23
|
-
* @namespace
|
|
24
23
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
24
|
+
* @version 1.112.2
|
|
26
25
|
*
|
|
26
|
+
* @alias sap.ui.export.SpreadsheetExport
|
|
27
27
|
* @private
|
|
28
28
|
* @since 1.50.0
|
|
29
29
|
*/
|
|
@@ -197,7 +197,7 @@ sap.ui.define(['sap/base/Log', 'sap/ui/export/ExportUtils'], function(Log, Expor
|
|
|
197
197
|
|
|
198
198
|
if (mParams.dataSource.type === 'array') {
|
|
199
199
|
return exportArray();
|
|
200
|
-
} else if (mParams.worker === false
|
|
200
|
+
} else if (mParams.worker === false) {
|
|
201
201
|
return exportInProcess();
|
|
202
202
|
} else {
|
|
203
203
|
return exportInWorker();
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @namespace
|
|
18
18
|
* @alias sap.ui.export
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.112.2
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
interfaces: [],
|
|
34
34
|
controls: [],
|
|
35
35
|
elements: [],
|
|
36
|
-
version: "1.
|
|
36
|
+
version: "1.112.2"
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
|
|
@@ -71,6 +71,8 @@ FITTOPAGE=\u206A\u206A\u206A\u200D\u200C\u200D\u200C\u200C\u200D\u200C\u200D\u20
|
|
|
71
71
|
|
|
72
72
|
ENABLE_SIGNATURE=\u206A\u206A\u206A\u200C\u200B\u200B\u200C\u200C\u200C\u200C\u200B\u200B\u200C\u200D\u200C\u200D\u200D\u200C\u200D\u200B\u200B\u200B\u200C\u200B\u200C\u200B\u200C\u200C\u200B\u200C\u200B\u200C\u200C\u200C\u200B\u200B\u200C\u200C\u200C\u200C\u200B\u200D\u200D\u200B\u206AEnable Signature\u206A\u206A
|
|
73
73
|
|
|
74
|
+
SHOW_PAGENUM=\u206A\u206A\u206A\u200D\u200D\u200C\u200D\u200C\u200B\u200C\u200B\u200D\u200C\u200B\u200B\u200C\u200B\u200C\u200C\u200D\u200B\u200B\u200C\u200B\u200B\u200C\u200B\u200C\u200B\u200C\u200D\u200C\u200C\u200D\u200D\u200B\u200C\u200D\u200C\u200C\u200B\u200B\u206AShow Page Number\u206A\u206A
|
|
75
|
+
|
|
74
76
|
SIGNATURE_REASON=\u206A\u206A\u206A\u200C\u200C\u200B\u200D\u200C\u200B\u200B\u200B\u200C\u200C\u200D\u200C\u200C\u200B\u200B\u200D\u200C\u200C\u200D\u200C\u200B\u200C\u200B\u200B\u200C\u200B\u200D\u200D\u200D\u200B\u200C\u200D\u200B\u200D\u200B\u200B\u200C\u200B\u200C\u200C\u200D\u206AReason\u206A\u206A
|
|
75
77
|
|
|
76
78
|
PDF_GENERATION_IN_PROGRESS=\u206A\u206A\u206A\u200C\u200C\u200B\u200C\u200C\u200C\u200C\u200B\u200B\u200B\u200B\u200B\u200D\u200D\u200B\u200D\u200D\u200B\u200B\u200B\u200B\u200C\u200C\u200C\u200B\u200C\u200D\u200D\u200D\u200B\u200C\u200C\u200D\u200D\u200D\u200B\u200C\u200B\u200D\u200D\u200B\u206APDF is being generated\u206A\u206A
|
|
@@ -93,6 +95,8 @@ PDF_FILETYPE=\u206A\u206A\u206A\u200C\u200C\u200C\u200C\u200B\u200D\u200B\u200D\
|
|
|
93
95
|
|
|
94
96
|
TOOLTIP_PDF_ACCESSIBILITY=\u206A\u206A\u206A\u200C\u200B\u200C\u200D\u200C\u200C\u200D\u200D\u200C\u200C\u200B\u200D\u200D\u200B\u200D\u200C\u200C\u200B\u200B\u200B\u200C\u200D\u200B\u200B\u200D\u200B\u200C\u200C\u200C\u200C\u200B\u200D\u200D\u200D\u200B\u200C\u200B\u200D\u200D\u200D\u200D\u206ADefines whether the generated document is accessible. If this option is unavailable, it is not supported by the back-end service.\u206A\u206A
|
|
95
97
|
|
|
98
|
+
TOOLTIP_PDF_PAGENUMBER=\u206A\u206A\u206A\u200C\u200C\u200B\u200B\u200C\u200D\u200C\u200B\u200C\u200D\u200D\u200C\u200B\u200B\u200D\u200B\u200D\u200B\u200B\u200D\u200D\u200C\u200C\u200C\u200C\u200B\u200C\u200C\u200B\u200B\u200D\u200D\u200C\u200B\u200B\u200B\u200D\u200C\u200B\u206ADefines whether the generated document contains page numbers in the footer of each page. If this option is unavailable, it is not supported by the back-end service.\u206A\u206A
|
|
99
|
+
|
|
96
100
|
TOOLTIP_PDF_SIGNATURE=\u206A\u206A\u206A\u200C\u200B\u200C\u200C\u200B\u200B\u200B\u200D\u200C\u200C\u200C\u200B\u200C\u200B\u200D\u200C\u200C\u200D\u200C\u200D\u200B\u200D\u200D\u200D\u200B\u200B\u200B\u200C\u200B\u200C\u200C\u200C\u200C\u200D\u200B\u200B\u200D\u200D\u200C\u200D\u206ADefines whether the generated document is signed with a digital signature. If this option is unavailable, it is not supported by the back-end service.\u206A\u206A
|
|
97
101
|
|
|
98
102
|
TOOLTIP_FITTOPAGE=\u206A\u206A\u206A\u200C\u200D\u200B\u200D\u200B\u200C\u200B\u200D\u200B\u200B\u200D\u200B\u200D\u200C\u200C\u200C\u200C\u200C\u200B\u200B\u200C\u200D\u200C\u200D\u200B\u200D\u200B\u200C\u200D\u200C\u200D\u200C\u200C\u200B\u200D\u200B\u200B\u200C\u206AThe generated document will have content that fits to the size of the page. If this option is unavailable, it is not supported by the back-end service.\u206A\u206A
|
|
@@ -65,7 +65,7 @@ ORIENTATION_PORT=\u7E26\u5411\u304D
|
|
|
65
65
|
|
|
66
66
|
NUMBER_ERROR=\u6570\u5024\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
67
67
|
|
|
68
|
-
ENABLE_ACCESSIBILITY=\u30A2\u30AF\u30BB\u30B7\u30D3\u30EA\u30C6\u30A3\u6709\u52B9\u5316
|
|
68
|
+
ENABLE_ACCESSIBILITY=\u30A2\u30AF\u30BB\u30B7\u30D3\u30EA\u30C6\u30A3\u3092\u6709\u52B9\u5316
|
|
69
69
|
|
|
70
70
|
FITTOPAGE=\u30DA\u30FC\u30B8\u30B5\u30A4\u30BA\u306B\u9069\u5408
|
|
71
71
|
|
|
@@ -65,7 +65,7 @@ ORIENTATION_PORT=Form\u00E1t na v\u00FD\u0161ku
|
|
|
65
65
|
|
|
66
66
|
NUMBER_ERROR=Hodnota by mala by\u0165 \u010D\u00EDslo.
|
|
67
67
|
|
|
68
|
-
ENABLE_ACCESSIBILITY=Aktivova\u0165
|
|
68
|
+
ENABLE_ACCESSIBILITY=Aktivova\u0165 pr\u00EDstupnos\u0165
|
|
69
69
|
|
|
70
70
|
FITTOPAGE=Prisp\u00F4sobenie str\u00E1nke
|
|
71
71
|
|
|
@@ -65,7 +65,7 @@ ORIENTATION_PORT=In do\u0323c
|
|
|
65
65
|
|
|
66
66
|
NUMBER_ERROR=Gia\u0301 tri\u0323 n\u00EAn la\u0300 s\u00F4\u0301.
|
|
67
67
|
|
|
68
|
-
ENABLE_ACCESSIBILITY=B\u00E2\u0323t kha\u0309 n\u0103ng truy c\u00E2\u0323p
|
|
68
|
+
ENABLE_ACCESSIBILITY=B\u00E2\u0323t kha\u0309 n\u0103ng truy c\u00E2\u0323p
|
|
69
69
|
|
|
70
70
|
FITTOPAGE=V\u01B0\u0300a v\u01A1\u0301i trang
|
|
71
71
|
|
|
@@ -32,9 +32,15 @@
|
|
|
32
32
|
* OData V2 as well as OData V4.
|
|
33
33
|
*
|
|
34
34
|
* @param {object} mSettings Data service related part of the export configuration
|
|
35
|
+
*
|
|
36
|
+
* @author SAP SE
|
|
37
|
+
* @version 1.112.2
|
|
38
|
+
*
|
|
35
39
|
* @constructor
|
|
36
40
|
* @class DataProviderBase
|
|
41
|
+
* @alias sap.ui.export.provider.DataProviderBase
|
|
37
42
|
* @since 1.77
|
|
43
|
+
* @private
|
|
38
44
|
*/
|
|
39
45
|
var DataProviderBase = function(mSettings) {
|
|
40
46
|
|
|
@@ -58,6 +64,9 @@
|
|
|
58
64
|
* cryptographic purposes and should not be used therefore.
|
|
59
65
|
*
|
|
60
66
|
* @returns {string} - Generated GUID
|
|
67
|
+
*
|
|
68
|
+
* @static
|
|
69
|
+
* @private
|
|
61
70
|
*/
|
|
62
71
|
DataProviderBase._createGuid = function() {
|
|
63
72
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
@@ -74,6 +83,8 @@
|
|
|
74
83
|
*
|
|
75
84
|
* @param {object} mSettings - Configuration object
|
|
76
85
|
* @returns {Array} - Collection of columns that need special conversion for their values
|
|
86
|
+
*
|
|
87
|
+
* @static
|
|
77
88
|
* @private
|
|
78
89
|
*/
|
|
79
90
|
DataProviderBase.getColumnsToConvert = function(mSettings) {
|
|
@@ -111,6 +122,8 @@
|
|
|
111
122
|
* @param {object} mSettings Export settings that are used to create the the converter function
|
|
112
123
|
* @returns {function} Conversion function
|
|
113
124
|
*
|
|
125
|
+
* @static
|
|
126
|
+
* @since 1.77
|
|
114
127
|
* @public
|
|
115
128
|
*/
|
|
116
129
|
DataProviderBase.getDataConverter = function(mSettings) {
|
|
@@ -128,6 +141,7 @@
|
|
|
128
141
|
* @param {Array} aCols - Columns that need to be converted
|
|
129
142
|
* @returns {Array} - An array of rows
|
|
130
143
|
*
|
|
144
|
+
* @static
|
|
131
145
|
* @private
|
|
132
146
|
*/
|
|
133
147
|
DataProviderBase._convertData = function(aRows, aCols) {
|
|
@@ -149,6 +163,7 @@
|
|
|
149
163
|
* @param {Array} oCol.keys - Property name or key path for navigation properties
|
|
150
164
|
* @returns {number|string|boolean} - The converted property value
|
|
151
165
|
*
|
|
166
|
+
* @static
|
|
152
167
|
* @private
|
|
153
168
|
*/
|
|
154
169
|
DataProviderBase._getValue = function(oRow, oCol) {
|
|
@@ -168,6 +183,7 @@
|
|
|
168
183
|
* @param {function} fnProcessCallback - Callback function that is triggered when data is received
|
|
169
184
|
* @returns {object} - Object reference that allows to cancel the current processing
|
|
170
185
|
*
|
|
186
|
+
* @since 1.77
|
|
171
187
|
* @public
|
|
172
188
|
*/
|
|
173
189
|
DataProviderBase.prototype.requestData = function(fnProcessCallback) {
|
|
@@ -319,6 +335,8 @@
|
|
|
319
335
|
* @param {number} iTop - The amount of items that should be requested with this query
|
|
320
336
|
* @param {string} [sNextUrl] - A reference to the next bulk of data that was returned by the previous request
|
|
321
337
|
* @returns {string} - The URL for the next query
|
|
338
|
+
*
|
|
339
|
+
* @private
|
|
322
340
|
*/
|
|
323
341
|
DataProviderBase.prototype._getUrl = function(iSkip, iTop, sNextUrl) {
|
|
324
342
|
var oDataUrl, oNextUrl;
|
|
@@ -355,6 +373,8 @@
|
|
|
355
373
|
* @param {string} oRequest.dataUrl - References the resource URL that gets invoked
|
|
356
374
|
* @param {string} oRequest.serviceUrl - References the service URL that gets invoked
|
|
357
375
|
* @return {Promise} Returns a Promise that will be resolve once the requested data was fetched
|
|
376
|
+
*
|
|
377
|
+
* @private
|
|
358
378
|
*/
|
|
359
379
|
DataProviderBase.prototype.sendRequest = function(oRequest) {
|
|
360
380
|
var fnSendRequest;
|
|
@@ -373,6 +393,8 @@
|
|
|
373
393
|
*
|
|
374
394
|
* @param {object} oRequest - Request object that contains all necessary information to create the batch request
|
|
375
395
|
* @returns {Promise} - A Promise that resolves in a JSON object containing the fetched data
|
|
396
|
+
*
|
|
397
|
+
* @private
|
|
376
398
|
*/
|
|
377
399
|
DataProviderBase.prototype.sendBatchRequest = function(oRequest) {
|
|
378
400
|
return new Promise(function(fnResolve, fnReject) {
|
|
@@ -469,6 +491,8 @@
|
|
|
469
491
|
*
|
|
470
492
|
* @param {object} oRequest - Request object that contains all necessary information to create the batch request
|
|
471
493
|
* @returns {Promise} - A Promise that resolves in a JSON object containing the fetched data
|
|
494
|
+
*
|
|
495
|
+
* @private
|
|
472
496
|
*/
|
|
473
497
|
DataProviderBase.prototype.sendGetRequest = function(oRequest) {
|
|
474
498
|
return new Promise(function(fnResolve, fnReject) {
|
|
@@ -20,10 +20,10 @@ sap.ui.define(['sap/ui/base/Object'], function(BaseObject) {
|
|
|
20
20
|
* convenience functions like <code>sap.ui.export.util.Filter#setType</code> to improve the result.
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.112.2
|
|
24
24
|
*
|
|
25
25
|
* @since 1.110
|
|
26
|
-
* @
|
|
26
|
+
* @alias sap.ui.export.util.Filter
|
|
27
27
|
* @extends sap.ui.base.Object
|
|
28
28
|
* @constructor
|
|
29
29
|
* @public
|
|
@@ -177,7 +177,6 @@ sap.ui.define(['sap/ui/base/Object'], function(BaseObject) {
|
|
|
177
177
|
*
|
|
178
178
|
* @since 1.110
|
|
179
179
|
* @public
|
|
180
|
-
*
|
|
181
180
|
*/
|
|
182
181
|
Filter.prototype.setLabel = function(sLabel) {
|
|
183
182
|
if (typeof sLabel !== 'string' || !sLabel) {
|