@sapui5/sap.ushell_abap 1.106.0 → 1.107.0
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/main/js/sap/ushell_abap/.library +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +99 -19
- package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +6 -18
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def-dev.js +8 -7
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def.js +10 -10
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.load.launchpad.js +6 -5
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +5 -3
- package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +87 -228
- package/src/main/js/sap/ushell_abap/library.js +2 -2
- package/ui5.yaml +8 -0
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.ui5.boot.handler.js +0 -84
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<library xmlns="http://www.sap.com/sap.ui.library.xsd">
|
|
3
3
|
<name>sap.ushell_abap</name>
|
|
4
4
|
<vendor>SAP SE</vendor>
|
|
5
|
-
<version>1.
|
|
5
|
+
<version>1.107.0</version>
|
|
6
6
|
<copyright>Copyright (c) 2009-2022 SAP SE, All Rights Reserved</copyright>
|
|
7
7
|
<documentation>SAP library: sap.ushell_abap</documentation>
|
|
8
8
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* <li>provide the resolveHashFragmentFallback function, a fallback method called by ClientSideTargetResolution service.</li>
|
|
10
10
|
* </ul>
|
|
11
11
|
*
|
|
12
|
-
* @version 1.
|
|
12
|
+
* @version 1.107.0
|
|
13
13
|
*/
|
|
14
14
|
sap.ui.define([
|
|
15
15
|
"sap/ui/thirdparty/jquery",
|
|
@@ -263,6 +263,100 @@ sap.ui.define([
|
|
|
263
263
|
});
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Checks the Resolve Link/Start Up result for Application Dependencies and if present modifies the results
|
|
269
|
+
* Additionaly amends the post parameters if present
|
|
270
|
+
* @param {object} oResult oResult
|
|
271
|
+
*
|
|
272
|
+
* @returns {object} Results
|
|
273
|
+
* @private
|
|
274
|
+
*/
|
|
275
|
+
ClientSideTargetResolutionAdapter.prototype._adjustNavTargetResult = function (oResult) {
|
|
276
|
+
if (oResult) {
|
|
277
|
+
var sUrl = oResult.url,
|
|
278
|
+
oUri,
|
|
279
|
+
oAdjustedResult = {
|
|
280
|
+
applicationType: oResult.applicationType,
|
|
281
|
+
additionalInformation: oResult.applicationData
|
|
282
|
+
},
|
|
283
|
+
sComponentName,
|
|
284
|
+
aMatches,
|
|
285
|
+
oAppDependencies,
|
|
286
|
+
oSelf;
|
|
287
|
+
|
|
288
|
+
if (oResult.text) {
|
|
289
|
+
oAdjustedResult.text = oResult.text;
|
|
290
|
+
}
|
|
291
|
+
if ((oResult.applicationType === "URL" || oResult.applicationType === "SAPUI5")) {
|
|
292
|
+
aMatches = /^SAPUI5\.Component=(.*)/.exec(oResult.applicationData);
|
|
293
|
+
sComponentName = aMatches && aMatches[1];
|
|
294
|
+
|
|
295
|
+
if (sComponentName || oResult.applicationDependencies) {
|
|
296
|
+
if (sComponentName) {
|
|
297
|
+
oAdjustedResult.ui5ComponentName = sComponentName;
|
|
298
|
+
}
|
|
299
|
+
// we only want to assign oAsyncHints if parsing succeeds, otherwise we're happy with undefined
|
|
300
|
+
if (oResult.applicationDependencies) {
|
|
301
|
+
try {
|
|
302
|
+
oAppDependencies = JSON.parse(oResult.applicationDependencies);
|
|
303
|
+
oSelf = oAppDependencies.self;
|
|
304
|
+
if (!oAdjustedResult.ui5ComponentName && oSelf.name) {
|
|
305
|
+
oAdjustedResult.ui5ComponentName = oSelf.name;
|
|
306
|
+
oAdjustedResult.additionalInformation = "SAPUI5.Component=" + oAdjustedResult.ui5ComponentName;
|
|
307
|
+
}
|
|
308
|
+
if (oSelf && oSelf.url && typeof oSelf.url === "string") {
|
|
309
|
+
var URI = sap.ui.require("sap/ui/thirdparty/URI");
|
|
310
|
+
oUri = sUrl && new URI(sUrl);
|
|
311
|
+
|
|
312
|
+
if (oUri) {
|
|
313
|
+
if (oSelf.url.toUpperCase().indexOf(oUri.path().toUpperCase()) !== 0) {
|
|
314
|
+
//no applicationDependencies in this case as they belong to the wrong app
|
|
315
|
+
Log.debug("Component URL defined in target mapping "
|
|
316
|
+
+ "does not match the URL retrieved from application index. "
|
|
317
|
+
+ "The URL of the application index is used for further processing.",
|
|
318
|
+
"Target mapping URL: " + oResult.url + "\nApplication index URL: " + oSelf.url,
|
|
319
|
+
"sap.ushell_abap.bootstrap.abap");
|
|
320
|
+
}
|
|
321
|
+
oUri.path(oSelf.url);
|
|
322
|
+
sUrl = oUri.toString();
|
|
323
|
+
Log.debug("ResolveLink result's component url has been replaced with the url specified " +
|
|
324
|
+
"in Application Dependencies, which includes cache buster token");
|
|
325
|
+
} else {
|
|
326
|
+
sUrl = oSelf.url;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
oAdjustedResult.applicationDependencies = oAppDependencies;
|
|
331
|
+
} catch (oError) {
|
|
332
|
+
Log.error(
|
|
333
|
+
"Parsing of applicationDependencies attribute in resolveLink result failed for SAPUI5 component '"
|
|
334
|
+
+ sComponentName + "'",
|
|
335
|
+
oError,
|
|
336
|
+
"sap.ushell_abap.bootstrap.abap"
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// add cache-buster token to URL
|
|
342
|
+
// although we stub the registerModulePath() method,
|
|
343
|
+
// we have to replace it in the URL already, because the AppConfiguration service
|
|
344
|
+
// loads the component's resource bundle already before the module path is registered
|
|
345
|
+
// by the ApplicationContainer
|
|
346
|
+
//
|
|
347
|
+
// we only do this for SAPUI5 applications - if a plain URL or NWBC app is launched,
|
|
348
|
+
// we keep it as it is
|
|
349
|
+
// see internal BCP inicdent 1580137234 2015
|
|
350
|
+
sUrl = Utils.addCacheBusterTokenUsingUshellConfig(sUrl);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
oAdjustedResult.url = sUrl;
|
|
355
|
+
return oAdjustedResult;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
|
|
266
360
|
/**
|
|
267
361
|
* Provides fallback resolution for {@link sap.ushell.services.ClientSideTargetResolution#resolveHashFragment}
|
|
268
362
|
* in case the resolution result cannot be determined on the client.
|
|
@@ -416,7 +510,7 @@ sap.ui.define([
|
|
|
416
510
|
copyParameter("sap-language");
|
|
417
511
|
copyParameter("sap-client");
|
|
418
512
|
Utils.get(
|
|
419
|
-
sRequestUrl + "&shellType=" +
|
|
513
|
+
sRequestUrl + "&shellType=" + ushellUtils.getShellType() + "&depth=0" + sCacheId,
|
|
420
514
|
false, /* xml= */
|
|
421
515
|
function (sNavTargetDataResult) {
|
|
422
516
|
var oNavTargetDataResult = JSON.parse(sNavTargetDataResult);
|
|
@@ -505,7 +599,7 @@ sap.ui.define([
|
|
|
505
599
|
});
|
|
506
600
|
|
|
507
601
|
// take component name from applicationDependencies if not supplied
|
|
508
|
-
oTarget.resolutionResult =
|
|
602
|
+
oTarget.resolutionResult = ClientSideTargetResolutionAdapter.prototype._adjustNavTargetResult(oFakeResolutionResult);
|
|
509
603
|
oTarget.resolutionResult.additionalInformation = oTarget.resolutionResult.additionalInformation || "";
|
|
510
604
|
|
|
511
605
|
// enable usage of the app ID hint
|
|
@@ -1006,20 +1100,6 @@ sap.ui.define([
|
|
|
1006
1100
|
return true;
|
|
1007
1101
|
};
|
|
1008
1102
|
|
|
1009
|
-
/**
|
|
1010
|
-
* Returns the current shell type, without relying on the existence of {@link sap.ushell_abap#getShellType}.
|
|
1011
|
-
*
|
|
1012
|
-
* @returns {string} the shell type ("NWBC" or "FLP"). Defaults to "FLP" in case the adapter is not running on the ABAP platform.
|
|
1013
|
-
* @private
|
|
1014
|
-
* @see sap.ushell_abap.adapters.abap.LaunchPageAdapter.prototype._getShellType
|
|
1015
|
-
*/
|
|
1016
|
-
ClientSideTargetResolutionAdapter.prototype._getShellType = function () {
|
|
1017
|
-
if (sap && sap.ushell_abap && typeof sap.ushell_abap.getShellType === "function") {
|
|
1018
|
-
return sap.ushell_abap.getShellType();
|
|
1019
|
-
}
|
|
1020
|
-
return "FLP";
|
|
1021
|
-
};
|
|
1022
|
-
|
|
1023
1103
|
/**
|
|
1024
1104
|
* Resolves the URL hash fragment.
|
|
1025
1105
|
*
|
|
@@ -1054,7 +1134,7 @@ sap.ui.define([
|
|
|
1054
1134
|
bBatchQueueOpened = this._openBatchQueueUnlessOpen(this._getODataWrapper());
|
|
1055
1135
|
|
|
1056
1136
|
this._oODataWrapper.read("ResolveLink?linkId='"
|
|
1057
|
-
+ encodeODataQueryParameter(sFragmentNoHash) + "'&shellType='" +
|
|
1137
|
+
+ encodeODataQueryParameter(sFragmentNoHash) + "'&shellType='" + ushellUtils.getShellType() + "'"
|
|
1058
1138
|
+ (sFormFactor ?
|
|
1059
1139
|
"&formFactor='" + encodeODataQueryParameter(sFormFactor) + "'" : ""),
|
|
1060
1140
|
function (oResult) {
|
|
@@ -1078,7 +1158,7 @@ sap.ui.define([
|
|
|
1078
1158
|
}
|
|
1079
1159
|
|
|
1080
1160
|
oResult = oResult.results[0];
|
|
1081
|
-
oAdjustedResult =
|
|
1161
|
+
oAdjustedResult = ClientSideTargetResolutionAdapter.prototype._adjustNavTargetResult(oResult);
|
|
1082
1162
|
oAdjustedResult.url = sap.ushell_abap.bootstrap.addPostParametersToNavTargetResultUrl(
|
|
1083
1163
|
oResult.postParameters, oAdjustedResult.url);
|
|
1084
1164
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @fileOverview The Unified Shell's page building adapter for the ABAP platform.
|
|
5
5
|
*
|
|
6
6
|
* @deprecated since 1.100
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.107.0
|
|
8
8
|
*/
|
|
9
9
|
sap.ui.define([
|
|
10
10
|
"sap/ui/thirdparty/URI",
|
|
@@ -21,7 +21,8 @@ sap.ui.define([
|
|
|
21
21
|
"sap/ushell_abap/pbServices/ui2/Error",
|
|
22
22
|
"sap/base/Log",
|
|
23
23
|
"sap/m/library",
|
|
24
|
-
"sap/ushell/ui/tile/StaticTile"
|
|
24
|
+
"sap/ushell/ui/tile/StaticTile",
|
|
25
|
+
"sap/ushell/utils"
|
|
25
26
|
], function (
|
|
26
27
|
URI,
|
|
27
28
|
ManifestPropertyHelper,
|
|
@@ -37,7 +38,8 @@ sap.ui.define([
|
|
|
37
38
|
SrvcError,
|
|
38
39
|
Log,
|
|
39
40
|
mobileLibrary,
|
|
40
|
-
StaticTile
|
|
41
|
+
StaticTile,
|
|
42
|
+
ushellUtils
|
|
41
43
|
) {
|
|
42
44
|
"use strict";
|
|
43
45
|
|
|
@@ -583,7 +585,7 @@ sap.ui.define([
|
|
|
583
585
|
}
|
|
584
586
|
oTargetMappingsConfig = ObjectPath.create("services.targetMappings", oAdapterConfig);
|
|
585
587
|
sCacheId = oTargetMappingsConfig.cacheId || "";
|
|
586
|
-
sUrl = "/sap/bc/ui2/start_up?so=%2A&action=%2A&tm-compact=true&shellType=" +
|
|
588
|
+
sUrl = "/sap/bc/ui2/start_up?so=%2A&action=%2A&tm-compact=true&shellType=" + ushellUtils.getShellType() + "&depth=0";
|
|
587
589
|
|
|
588
590
|
if (sCacheId) {
|
|
589
591
|
sUrl += (sUrl.indexOf("?") < 0 ? "?" : "&") + "sap-cache-id=" + sCacheId;
|
|
@@ -3669,20 +3671,6 @@ sap.ui.define([
|
|
|
3669
3671
|
};
|
|
3670
3672
|
};
|
|
3671
3673
|
|
|
3672
|
-
/**
|
|
3673
|
-
* Returns the current shell type, without relying on the existence of {@link sap.ushell_abap#getShellType}.
|
|
3674
|
-
*
|
|
3675
|
-
* @returns {string} the shell type ("NWBC" or "FLP"). Defaults to "FLP" in case the adapter is not running on the ABAP platform.
|
|
3676
|
-
* @private
|
|
3677
|
-
* @see sap.ushell_abap.adapters.abap.ClientSideTargetResolutionAdapter.prototype._getShellType
|
|
3678
|
-
*/
|
|
3679
|
-
LaunchPageAdapter.prototype._getShellType = function () {
|
|
3680
|
-
if (sap && sap.ushell_abap && typeof sap.ushell_abap.getShellType === "function") {
|
|
3681
|
-
return sap.ushell_abap.getShellType();
|
|
3682
|
-
}
|
|
3683
|
-
return "FLP";
|
|
3684
|
-
};
|
|
3685
|
-
|
|
3686
3674
|
/**
|
|
3687
3675
|
* Returns raw catalog tile data that can be used to instantiate the tile
|
|
3688
3676
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2009-2022 SAP SE, All Rights Reserved
|
|
2
2
|
sap.ui.define([
|
|
3
3
|
"./abap.configure.ushell",
|
|
4
|
-
"./abap.ui5.boot.handler",
|
|
5
4
|
"./abap.load.launchpad",
|
|
6
5
|
"./boottask",
|
|
7
6
|
"sap/ushell/bootstrap/common/common.configure.ui5",
|
|
@@ -10,7 +9,6 @@ sap.ui.define([
|
|
|
10
9
|
"sap/ushell/bootstrap/common/common.load.bootstrapExtension"
|
|
11
10
|
], function (
|
|
12
11
|
fnConfigureUshell,
|
|
13
|
-
oUi5BootHandler,
|
|
14
12
|
fnLoadLaunchpad,
|
|
15
13
|
oBoottask,
|
|
16
14
|
fnConfigureUi5,
|
|
@@ -20,19 +18,22 @@ sap.ui.define([
|
|
|
20
18
|
) {
|
|
21
19
|
"use strict";
|
|
22
20
|
|
|
23
|
-
var oUShellConfig
|
|
24
|
-
oUi5BootPromise = oUi5BootHandler.createUi5BootPromise();
|
|
21
|
+
var oUShellConfig;
|
|
25
22
|
|
|
26
23
|
window["sap-ui-debug"] = bDebugSources; //use in LaunchPageAdapter
|
|
27
24
|
oUShellConfig = fnConfigureUshell();
|
|
28
25
|
fnConfigureUi5({
|
|
29
26
|
ushellConfig: oUShellConfig,
|
|
30
27
|
libs: fnExtractUi5LibsFromUshellConfig(oUShellConfig),
|
|
31
|
-
theme: "
|
|
32
|
-
|
|
28
|
+
theme: "sap_fiori_3",
|
|
29
|
+
platform: "abap",
|
|
30
|
+
platformAdapters: {
|
|
31
|
+
abap: "sap.ushell_abap.adapters.abap",
|
|
32
|
+
hana: "sap.ushell_abap.adapters.hana"
|
|
33
|
+
},
|
|
34
|
+
bootTask: oBoottask.start,
|
|
33
35
|
onInitCallback: fnLoadLaunchpad
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
fnLoadBootstrapExtension(oUShellConfig);
|
|
37
|
-
oBoottask.start(oUi5BootPromise);
|
|
38
39
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2009-2022 SAP SE, All Rights Reserved
|
|
2
2
|
sap.ui.define([
|
|
3
3
|
"./abap.configure.ushell",
|
|
4
|
-
"./abap.ui5.boot.handler",
|
|
5
4
|
"./abap.load.launchpad",
|
|
6
5
|
"./boottask",
|
|
7
6
|
"sap/ushell/bootstrap/common/common.configure.ui5",
|
|
@@ -11,19 +10,17 @@ sap.ui.define([
|
|
|
11
10
|
"sap/ushell/bootstrap/common/common.load.core-min"
|
|
12
11
|
], function (
|
|
13
12
|
fnConfigureUshell,
|
|
14
|
-
Ui5BootHandler,
|
|
15
13
|
fnLoadLaunchpad,
|
|
16
|
-
|
|
14
|
+
oBoottask,
|
|
17
15
|
fnConfigureUi5,
|
|
18
16
|
fnExtractUi5LibsFromUshellConfig,
|
|
19
17
|
fnLoadBootstrapExtension,
|
|
20
18
|
bDebugSources,
|
|
21
|
-
|
|
19
|
+
fnLoadCoreMin
|
|
22
20
|
) {
|
|
23
21
|
"use strict";
|
|
24
22
|
|
|
25
|
-
var oUShellConfig
|
|
26
|
-
oUi5BootPromise = Ui5BootHandler.createUi5BootPromise();
|
|
23
|
+
var oUShellConfig;
|
|
27
24
|
|
|
28
25
|
window["sap-ui-debug"] = bDebugSources; //use in LaunchPageAdapter
|
|
29
26
|
oUShellConfig = fnConfigureUshell();
|
|
@@ -31,12 +28,15 @@ sap.ui.define([
|
|
|
31
28
|
ushellConfig: oUShellConfig,
|
|
32
29
|
libs: fnExtractUi5LibsFromUshellConfig(oUShellConfig),
|
|
33
30
|
theme: "sap_belize",
|
|
34
|
-
|
|
31
|
+
platform: "abap",
|
|
32
|
+
platformAdapters: {
|
|
33
|
+
abap: "sap.ushell_abap.adapters.abap",
|
|
34
|
+
hana: "sap.ushell_abap.adapters.hana"
|
|
35
|
+
},
|
|
36
|
+
bootTask: oBoottask.start,
|
|
35
37
|
onInitCallback: fnLoadLaunchpad
|
|
36
38
|
});
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
fnLoadCoreMin.load("sap.ushell_abap.bootstrap.evo");
|
|
40
41
|
fnLoadBootstrapExtension(oUShellConfig);
|
|
41
|
-
Boottask.start(oUi5BootPromise);
|
|
42
42
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
sap.ui.define([
|
|
3
3
|
"sap/base/util/UriParameters",
|
|
4
4
|
"sap/base/Log",
|
|
5
|
+
"./boottask",
|
|
5
6
|
"sap/ushell_abap/pbServices/ui2/contracts/bag",
|
|
6
7
|
"sap/ushell_abap/pbServices/ui2/contracts/configuration",
|
|
7
8
|
"sap/ushell_abap/pbServices/ui2/contracts/configurationUi",
|
|
@@ -15,7 +16,8 @@ sap.ui.define([
|
|
|
15
16
|
"sap/ushell_abap/pbServices/ui2/contracts/types"
|
|
16
17
|
], function (
|
|
17
18
|
UriParameters,
|
|
18
|
-
Log
|
|
19
|
+
Log,
|
|
20
|
+
Boottask
|
|
19
21
|
/*
|
|
20
22
|
ui2ContractsBag,
|
|
21
23
|
ui2Configuration,
|
|
@@ -32,9 +34,7 @@ sap.ui.define([
|
|
|
32
34
|
) {
|
|
33
35
|
"use strict";
|
|
34
36
|
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
function loadLaunchpadContent () {
|
|
37
|
+
return function () {
|
|
38
38
|
// check if framing control of ui5 should be active (meta tag set)
|
|
39
39
|
var oFramingControl = window["sap-ushell-framing-control"],
|
|
40
40
|
oUI5Configuration,
|
|
@@ -77,5 +77,6 @@ sap.ui.define([
|
|
|
77
77
|
IconFonts.registerFiori2IconFont();
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Boottask.afterBootstrap();
|
|
81
|
+
};
|
|
81
82
|
});
|
|
@@ -3,12 +3,14 @@ sap.ui.define([
|
|
|
3
3
|
"./abap.bootstrap.utils",
|
|
4
4
|
"sap/base/util/ObjectPath",
|
|
5
5
|
"sap/base/Log",
|
|
6
|
-
"sap/ushell_abap/pbServices/ui2/Utils"
|
|
6
|
+
"sap/ushell_abap/pbServices/ui2/Utils",
|
|
7
|
+
"sap/ushell/utils"
|
|
7
8
|
], function (
|
|
8
9
|
oAbapUtils,
|
|
9
10
|
ObjectPath,
|
|
10
11
|
Log,
|
|
11
|
-
Utils
|
|
12
|
+
Utils,
|
|
13
|
+
ushellUtils
|
|
12
14
|
) {
|
|
13
15
|
"use strict";
|
|
14
16
|
|
|
@@ -51,7 +53,7 @@ sap.ui.define([
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
aParametertsFromUrl.forEach(copyParameter);
|
|
54
|
-
sRequestUrl += "shellType=" +
|
|
56
|
+
sRequestUrl += "shellType=" + ushellUtils.getShellType() + "&depth=0";
|
|
55
57
|
if (oStartupConfig) {
|
|
56
58
|
sRequestUrl += oAbapUtils.getCacheIdAsQueryParameter(oStartupConfig);
|
|
57
59
|
oXHR = oAbapUtils.createAndOpenXHR(sRequestUrl, oStartupConfig); // XMLHttpRequest + headers
|
|
@@ -12,8 +12,6 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/performance/trace/initTraces",
|
|
13
13
|
"sap/base/util/ObjectPath",
|
|
14
14
|
"sap/base/Log",
|
|
15
|
-
"sap/ushell/Container",
|
|
16
|
-
"sap/ui/Device",
|
|
17
15
|
"sap/ushell_abap/pbServices/ui2/Utils"
|
|
18
16
|
],
|
|
19
17
|
function (
|
|
@@ -28,8 +26,6 @@ function (
|
|
|
28
26
|
initTraces,
|
|
29
27
|
ObjectPath,
|
|
30
28
|
Log,
|
|
31
|
-
Container,
|
|
32
|
-
Device,
|
|
33
29
|
Utils
|
|
34
30
|
) {
|
|
35
31
|
"use strict";
|
|
@@ -47,18 +43,6 @@ function (
|
|
|
47
43
|
//start define the global sap.ushell_abap
|
|
48
44
|
//**************************************
|
|
49
45
|
|
|
50
|
-
/**
|
|
51
|
-
* Determine the shell type considering NWBC
|
|
52
|
-
* Version 6.0+ client case.
|
|
53
|
-
*
|
|
54
|
-
* @return {string}
|
|
55
|
-
* the shell type ("NWBC" or "FLP"), based on whether NWBC v6.0+
|
|
56
|
-
* Client is detected.
|
|
57
|
-
*/
|
|
58
|
-
sap.ushell_abap.getShellType = function () {
|
|
59
|
-
return oUshellUtils.hasNativeNavigationCapability() ? "NWBC" : "FLP";
|
|
60
|
-
};
|
|
61
|
-
|
|
62
46
|
/**
|
|
63
47
|
* Adds the given post parameters to a url
|
|
64
48
|
*
|
|
@@ -80,96 +64,6 @@ function (
|
|
|
80
64
|
return sUrl;
|
|
81
65
|
};
|
|
82
66
|
|
|
83
|
-
/**
|
|
84
|
-
* Checks the Resolve Link/Start Up result for Application Dependencies and if present modifies the results
|
|
85
|
-
* Additionaly amends the post parameters if present
|
|
86
|
-
* @param {object}
|
|
87
|
-
*
|
|
88
|
-
* @private
|
|
89
|
-
*/
|
|
90
|
-
sap.ushell_abap.bootstrap.adjustNavTargetResult = function (oResult) {
|
|
91
|
-
if (oResult) {
|
|
92
|
-
var sUrl = oResult.url,
|
|
93
|
-
oUri,
|
|
94
|
-
oAdjustedResult = {
|
|
95
|
-
applicationType: oResult.applicationType,
|
|
96
|
-
additionalInformation: oResult.applicationData
|
|
97
|
-
},
|
|
98
|
-
sComponentName,
|
|
99
|
-
aMatches,
|
|
100
|
-
oAppDependencies,
|
|
101
|
-
oSelf;
|
|
102
|
-
|
|
103
|
-
if (oResult.text) {
|
|
104
|
-
oAdjustedResult.text = oResult.text;
|
|
105
|
-
}
|
|
106
|
-
if ((oResult.applicationType === "URL" || oResult.applicationType === "SAPUI5")) {
|
|
107
|
-
aMatches = /^SAPUI5\.Component=(.*)/.exec(oResult.applicationData);
|
|
108
|
-
sComponentName = aMatches && aMatches[1];
|
|
109
|
-
|
|
110
|
-
if (sComponentName || oResult.applicationDependencies) {
|
|
111
|
-
if (sComponentName) {
|
|
112
|
-
oAdjustedResult.ui5ComponentName = sComponentName;
|
|
113
|
-
}
|
|
114
|
-
// we only want to assign oAsyncHints if parsing succeeds, otherwise we're happy with undefined
|
|
115
|
-
if (oResult.applicationDependencies) {
|
|
116
|
-
try {
|
|
117
|
-
oAppDependencies = JSON.parse(oResult.applicationDependencies);
|
|
118
|
-
oSelf = oAppDependencies.self;
|
|
119
|
-
if (!oAdjustedResult.ui5ComponentName && oSelf.name) {
|
|
120
|
-
oAdjustedResult.ui5ComponentName = oSelf.name;
|
|
121
|
-
oAdjustedResult.additionalInformation = "SAPUI5.Component=" + oAdjustedResult.ui5ComponentName;
|
|
122
|
-
}
|
|
123
|
-
if (oSelf && oSelf.url && typeof oSelf.url === "string") {
|
|
124
|
-
var URI = sap.ui.require("sap/ui/thirdparty/URI");
|
|
125
|
-
oUri = sUrl && new URI(sUrl);
|
|
126
|
-
|
|
127
|
-
if (oUri) {
|
|
128
|
-
if (oSelf.url.toUpperCase().indexOf(oUri.path().toUpperCase()) !== 0) {
|
|
129
|
-
//no applicationDependencies in this case as they belong to the wrong app
|
|
130
|
-
Log.debug("Component URL defined in target mapping "
|
|
131
|
-
+ "does not match the URL retrieved from application index. "
|
|
132
|
-
+ "The URL of the application index is used for further processing.",
|
|
133
|
-
"Target mapping URL: " + oResult.url + "\nApplication index URL: " + oSelf.url,
|
|
134
|
-
"sap.ushell_abap.bootstrap.abap");
|
|
135
|
-
}
|
|
136
|
-
oUri.path(oSelf.url);
|
|
137
|
-
sUrl = oUri.toString();
|
|
138
|
-
Log.debug("ResolveLink result's component url has been replaced with the url specified " +
|
|
139
|
-
"in Application Dependencies, which includes cache buster token");
|
|
140
|
-
} else {
|
|
141
|
-
sUrl = oSelf.url;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
oAdjustedResult.applicationDependencies = oAppDependencies;
|
|
146
|
-
} catch (oError) {
|
|
147
|
-
Log.error(
|
|
148
|
-
"Parsing of applicationDependencies attribute in resolveLink result failed for SAPUI5 component '"
|
|
149
|
-
+ sComponentName + "'",
|
|
150
|
-
oError,
|
|
151
|
-
"sap.ushell_abap.bootstrap.abap"
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// add cache-buster token to URL
|
|
157
|
-
// although we stub the registerModulePath() method,
|
|
158
|
-
// we have to replace it in the URL already, because the AppConfiguration service
|
|
159
|
-
// loads the component's resource bundle already before the module path is registered
|
|
160
|
-
// by the ApplicationContainer
|
|
161
|
-
//
|
|
162
|
-
// we only do this for SAPUI5 applications - if a plain URL or NWBC app is launched,
|
|
163
|
-
// we keep it as it is
|
|
164
|
-
// see internal BCP inicdent 1580137234 2015
|
|
165
|
-
sUrl = Utils.addCacheBusterTokenUsingUshellConfig(sUrl);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
oAdjustedResult.url = sUrl;
|
|
170
|
-
return oAdjustedResult;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
67
|
|
|
174
68
|
//**************************************
|
|
175
69
|
//end define the global sap.ushell_abap
|
|
@@ -207,16 +101,16 @@ function (
|
|
|
207
101
|
* @return {boolean}
|
|
208
102
|
* @private
|
|
209
103
|
*/
|
|
210
|
-
function isStandaloneHash (
|
|
211
|
-
if (!
|
|
104
|
+
function isStandaloneHash (sCurrentHash) {
|
|
105
|
+
if (!sCurrentHash) {
|
|
212
106
|
return false;
|
|
213
107
|
}
|
|
214
|
-
return
|
|
215
|
-
||
|
|
216
|
-
||
|
|
217
|
-
||
|
|
218
|
-
||
|
|
219
|
-
||
|
|
108
|
+
return sCurrentHash.indexOf("Shell-home") === 0
|
|
109
|
+
|| sCurrentHash.indexOf("Launchpad-openFLPPage") === 0
|
|
110
|
+
|| sCurrentHash.indexOf("Shell-appfinder") === 0
|
|
111
|
+
|| sCurrentHash.indexOf("Shell-catalog") === 0
|
|
112
|
+
|| sCurrentHash.indexOf("shell-catalog") === 0
|
|
113
|
+
|| sCurrentHash.indexOf("Action-search") === 0;
|
|
220
114
|
}
|
|
221
115
|
/*
|
|
222
116
|
* We allow to switch off the initial target resolution via configuration; use case is
|
|
@@ -643,9 +537,6 @@ function (
|
|
|
643
537
|
* the result as a JSON object
|
|
644
538
|
*/
|
|
645
539
|
function processStartup (oStartupResult) {
|
|
646
|
-
// TODO: split in merging with config => do first,
|
|
647
|
-
// THEN merge with Configuration file ( if relevant)
|
|
648
|
-
// THEN process => apply to ui5 services etc.
|
|
649
540
|
var mParameterMap = Utils.getParameterMap(),
|
|
650
541
|
sRequestLocale = oAbapUtils.getUrlParameterValue("sap-locale", mParameterMap),
|
|
651
542
|
oUi5UserInfo = {},
|
|
@@ -821,116 +712,90 @@ function (
|
|
|
821
712
|
return oPromise;
|
|
822
713
|
}
|
|
823
714
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
* the boot task.
|
|
827
|
-
* @param {object} oStartupCallResult
|
|
828
|
-
* the result of the start-up service
|
|
829
|
-
* @param {function} fnCallback
|
|
830
|
-
* the callback function of the SAPUI5 boot task
|
|
831
|
-
*/
|
|
832
|
-
function bootstrap (oStartupCallResult, fnCallback) {
|
|
715
|
+
|
|
716
|
+
function afterBootstrap () {
|
|
833
717
|
var sShellHash = getShellHash();
|
|
834
718
|
|
|
835
|
-
|
|
836
|
-
|
|
719
|
+
if (isHomepageHash(sShellHash) && window["sap-ushell-config"].ushell &&
|
|
720
|
+
window["sap-ushell-config"].ushell.spaces && window["sap-ushell-config"].ushell.spaces.enabled) {
|
|
721
|
+
_loadPage(sShellHash); // earliest point available to load page object
|
|
722
|
+
}
|
|
723
|
+
var oFrameLogonManager = oXhrLogonLib.FrameLogonManager.getInstance();
|
|
724
|
+
sap.ushell.Container.oFrameLogonManager = oFrameLogonManager;
|
|
837
725
|
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
sap.ushell.Container.getServiceAsync("Ui5ComponentLoader").then(function (oUi5ComponentLoader) {
|
|
870
|
-
oUi5ComponentLoader.createComponent(
|
|
871
|
-
oResolutionResult,
|
|
872
|
-
getParsedShellHash(sShellHash),
|
|
873
|
-
createWaitForRendererCreatedPromise(),
|
|
874
|
-
"Application"
|
|
875
|
-
)
|
|
876
|
-
.done(function (oResolutionResultWithComponentHandle) {
|
|
877
|
-
fnResolve({
|
|
878
|
-
resolvedHashFragment: oResolutionResultWithComponentHandle,
|
|
879
|
-
dependenciesLoaded: true
|
|
880
|
-
});
|
|
881
|
-
})
|
|
882
|
-
.fail(function (vError) {
|
|
883
|
-
fnReject(vError);
|
|
726
|
+
if (isDirectStart(sShellHash)) { // only set on direct app start (not #Shell-home)
|
|
727
|
+
var fnResolve, fnReject;
|
|
728
|
+
window["sap-ushell-async-libs-promise-directstart"] = new Promise(function (resolve, reject) {
|
|
729
|
+
fnResolve = resolve;
|
|
730
|
+
fnReject = reject;
|
|
731
|
+
});
|
|
732
|
+
window["sap-ushell-async-libs-promise-directstart"].catch(function (sMsg) { // always provide catch handler
|
|
733
|
+
/*silently ignore*/
|
|
734
|
+
});
|
|
735
|
+
// resolve the shell hash and try to load a UI5 component for it; if successful,
|
|
736
|
+
// the application context for the component will be attached to the resolution result
|
|
737
|
+
// for non-UI5 targets, it will be empty
|
|
738
|
+
sap.ushell.Container.getServiceAsync("NavTargetResolution").then(function (oNavTargetResolution) {
|
|
739
|
+
oNavTargetResolution.resolveHashFragment("#" + getShellHash())
|
|
740
|
+
.done(function (oResolutionResult) {
|
|
741
|
+
var oAppConfiguration = sap.ui.require("sap/ushell/services/AppConfiguration");
|
|
742
|
+
oAppConfiguration.setCurrentApplication(oResolutionResult);
|
|
743
|
+
|
|
744
|
+
if (oResolutionResult && oResolutionResult.ui5ComponentName) {
|
|
745
|
+
// create UI5 component early
|
|
746
|
+
sap.ushell.Container.getServiceAsync("Ui5ComponentLoader").then(function (oUi5ComponentLoader) {
|
|
747
|
+
oUi5ComponentLoader.createComponent(
|
|
748
|
+
oResolutionResult,
|
|
749
|
+
getParsedShellHash(sShellHash),
|
|
750
|
+
createWaitForRendererCreatedPromise(),
|
|
751
|
+
"Application"
|
|
752
|
+
)
|
|
753
|
+
.done(function (oResolutionResultWithComponentHandle) {
|
|
754
|
+
fnResolve({
|
|
755
|
+
resolvedHashFragment: oResolutionResultWithComponentHandle,
|
|
756
|
+
dependenciesLoaded: true
|
|
884
757
|
});
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
758
|
+
})
|
|
759
|
+
.fail(function (vError) {
|
|
760
|
+
fnReject(vError);
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
} else {
|
|
764
|
+
// non-ui5 app
|
|
765
|
+
fnResolve({
|
|
766
|
+
resolvedHashFragment: oResolutionResult,
|
|
767
|
+
dependenciesLoaded: false
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}).fail(function (sMsg) {
|
|
771
|
+
fnReject(sMsg);
|
|
897
772
|
});
|
|
898
|
-
}
|
|
899
773
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
});
|
|
774
|
+
});
|
|
775
|
+
}
|
|
903
776
|
}
|
|
904
777
|
|
|
905
|
-
/**
|
|
906
|
-
* Loads the personalizations using the Personalization service.
|
|
907
|
-
*
|
|
908
|
-
* @returns {object} The personalization object.
|
|
909
|
-
* @private
|
|
910
|
-
*/
|
|
911
|
-
function _loadPersonalization () {
|
|
912
|
-
return sap.ushell.Container.getServiceAsync("Personalization").then(function (oPersonalizationService) {
|
|
913
|
-
var oPersId = {
|
|
914
|
-
container: "sap.ushell.cdm3-1.personalization",
|
|
915
|
-
item: "data"
|
|
916
|
-
};
|
|
917
|
-
|
|
918
|
-
var oScope = {
|
|
919
|
-
validity: "Infinity",
|
|
920
|
-
keyCategory: oPersonalizationService.constants.keyCategory.GENERATED_KEY,
|
|
921
|
-
writeFrequency: oPersonalizationService.constants.writeFrequency.HIGH,
|
|
922
|
-
clientStorageAllowed: false
|
|
923
|
-
};
|
|
924
|
-
|
|
925
|
-
return oPersonalizationService.getPersonalizer(oPersId, oScope).getPersData();
|
|
926
|
-
});
|
|
927
|
-
}
|
|
928
778
|
|
|
929
779
|
function _loadPage (sShellHash) {
|
|
930
780
|
if (sShellHash && sShellHash.indexOf("Shell-appfinder") === 0) {
|
|
931
781
|
return;
|
|
932
782
|
}
|
|
933
|
-
|
|
783
|
+
|
|
784
|
+
sap.ushell.Container.getServiceAsync("Personalization").then(function (oPersonalizationService) {
|
|
785
|
+
var oPersId = {
|
|
786
|
+
container: "sap.ushell.cdm3-1.personalization",
|
|
787
|
+
item: "data"
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
var oScope = {
|
|
791
|
+
validity: "Infinity",
|
|
792
|
+
keyCategory: oPersonalizationService.constants.keyCategory.GENERATED_KEY,
|
|
793
|
+
writeFrequency: oPersonalizationService.constants.writeFrequency.HIGH,
|
|
794
|
+
clientStorageAllowed: false
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
return oPersonalizationService.getPersonalizer(oPersId, oScope).getPersData();
|
|
798
|
+
});
|
|
934
799
|
|
|
935
800
|
sap.ui.require([ "sap/ushell/components/pages/controller/PagesAndSpaceId" ], function (oPagesAndSpaceId) {
|
|
936
801
|
var oIdPromise = oPagesAndSpaceId._getPageAndSpaceId(sShellHash);
|
|
@@ -949,20 +814,17 @@ function (
|
|
|
949
814
|
|
|
950
815
|
/**
|
|
951
816
|
* Performs a start-up request and synchronizes it with the SAPUI5 boot task.
|
|
952
|
-
* @Param {object}
|
|
817
|
+
* @Param {object} fnCallback To be called for UI5 Core during boot process
|
|
953
818
|
*/
|
|
954
|
-
function start (
|
|
955
|
-
var oStartupPromise;
|
|
956
|
-
|
|
819
|
+
function start (fnCallback) {
|
|
957
820
|
oXhrHandler.initXhrLogon(window["sap-ushell-config"]);
|
|
958
821
|
|
|
959
822
|
// initialize UI5 performance tracing (FESR) before first request is sent, so that this is also instrumented
|
|
960
823
|
initTraces();
|
|
961
824
|
|
|
962
|
-
//TODO: this may move before TargetMappings & pageset firing (in case of contention of network connections)
|
|
963
825
|
//fire start-up request if direct start also indicates suppression of pageset request
|
|
964
826
|
//must be kept before success handler of requestStartUp
|
|
965
|
-
|
|
827
|
+
oStartupHandler.requestStartupConfig().then(function (oStartupResult) {
|
|
966
828
|
var sHash = getShellHash();
|
|
967
829
|
(ObjectPath.get("sap-ushell-config.services.Container.adapter") || ObjectPath.create("sap-ushell-config.services.Container.adapter")).config = oStartupResult;
|
|
968
830
|
var oLaunchPageAdapterConfig = ObjectPath.get("sap-ushell-config.services.LaunchPage.adapter.config") || ObjectPath.create("sap-ushell-config.services.LaunchPage.adapter.config");
|
|
@@ -1003,21 +865,18 @@ function (
|
|
|
1003
865
|
Log.error("start_up request failed: " + sMessage, null,
|
|
1004
866
|
"sap.ushell_abap.bootstrap");
|
|
1005
867
|
return Promise.resolve({});
|
|
1006
|
-
})
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
868
|
+
}).then(function (oStartupResult) {
|
|
869
|
+
// Note: processStartup creates window["sap-ushell-config"]
|
|
870
|
+
processStartup(oStartupResult);
|
|
871
|
+
fnCallback();
|
|
1010
872
|
});
|
|
1011
873
|
}
|
|
1012
874
|
|
|
1013
875
|
oBoottask.start = start;
|
|
1014
|
-
oBoottask.
|
|
1015
|
-
|
|
876
|
+
oBoottask.afterBootstrap = afterBootstrap;
|
|
1016
877
|
oBoottask._getShellHash = getShellHash; //only for testing
|
|
1017
878
|
oBoottask._getFullShellHash = getFullShellHash; //only for testing
|
|
1018
879
|
oBoottask._createWaitForRendererCreatedPromise = createWaitForRendererCreatedPromise; //only for testing
|
|
1019
880
|
oBoottask._loadPage = _loadPage; // only for testing
|
|
1020
|
-
|
|
1021
881
|
return oBoottask;
|
|
1022
|
-
|
|
1023
882
|
});
|
|
@@ -16,13 +16,13 @@ sap.ui.define([
|
|
|
16
16
|
* @namespace
|
|
17
17
|
* @name sap.ushell_abap
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.107.0
|
|
20
20
|
* @private
|
|
21
21
|
* @ui5-restricted
|
|
22
22
|
*/
|
|
23
23
|
var ushellAbapLib = sap.ui.getCore().initLibrary({
|
|
24
24
|
name: "sap.ushell_abap",
|
|
25
|
-
version: "1.
|
|
25
|
+
version: "1.107.0",
|
|
26
26
|
dependencies: ["sap.ui.core", "sap.m"],
|
|
27
27
|
noLibraryCSS: true,
|
|
28
28
|
extensions: {
|
package/ui5.yaml
CHANGED
|
@@ -582,6 +582,14 @@ builder:
|
|
|
582
582
|
- sap/m/Page.js
|
|
583
583
|
- sap/m/ScrollContainer.js
|
|
584
584
|
- sap/m/ScrollContainerRenderer.js
|
|
585
|
+
- sap/m/SearchField.js
|
|
586
|
+
- sap/m/SearchFieldRenderer.js
|
|
587
|
+
- sap/m/SelectDialog.js
|
|
588
|
+
- sap/m/SelectDialogBase.js
|
|
589
|
+
- sap/m/Suggest.js
|
|
590
|
+
- sap/m/SuggestionItem.js
|
|
591
|
+
- sap/m/SuggestionList.js
|
|
592
|
+
- sap/m/SuggestionListRenderer.js
|
|
585
593
|
- sap/m/Table.js
|
|
586
594
|
- sap/m/TileContent.js
|
|
587
595
|
- sap/m/TileContentRenderer.js
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2009-2022 SAP SE, All Rights Reserved
|
|
2
|
-
|
|
3
|
-
sap.ui.define([
|
|
4
|
-
"sap/base/Log",
|
|
5
|
-
"sap/ushell_abap/pbServices/ui2/Utils"
|
|
6
|
-
], function (
|
|
7
|
-
Log,
|
|
8
|
-
Utils
|
|
9
|
-
) {
|
|
10
|
-
"use strict";
|
|
11
|
-
|
|
12
|
-
var oBootHandler = {},
|
|
13
|
-
oBootPromise,
|
|
14
|
-
fnResolve; //resolver of the Promise
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Overwrites jQuery.sap.registerModulePath to add a cache buster token on each call to the
|
|
18
|
-
* URL prefix path.
|
|
19
|
-
*
|
|
20
|
-
* Note:
|
|
21
|
-
* The sap-ushell-config defines the rules for adding a token to the URL.
|
|
22
|
-
* This is a temporary solution. Ideally UI5 will provide this functionality.
|
|
23
|
-
*
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
function overwriteRegisterModulePath () {
|
|
27
|
-
var fnRegisterModulePath = jQuery.sap.registerModulePath;
|
|
28
|
-
|
|
29
|
-
function normalizeUrlAndAddCacheBusterToken (sUrlPrefix) {
|
|
30
|
-
// Removing cache buster token (if available) of url and normalize the url afterwards
|
|
31
|
-
var sNormalizedUrl = Utils.removeCBAndNormalizeUrl(sUrlPrefix),
|
|
32
|
-
sUrlPrefixModified = Utils.addCacheBusterTokenUsingUshellConfig(sNormalizedUrl);
|
|
33
|
-
return sUrlPrefixModified;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
jQuery.sap.registerModulePath = function (sModuleName, vUrlPrefix) {
|
|
37
|
-
// since 1.28, registerModulePath can take either a URL string or an object of form {url: "url", "final": true}
|
|
38
|
-
if (typeof vUrlPrefix === "object") {
|
|
39
|
-
vUrlPrefix.url = normalizeUrlAndAddCacheBusterToken(vUrlPrefix.url);
|
|
40
|
-
} else if (typeof vUrlPrefix === "string") {
|
|
41
|
-
vUrlPrefix = normalizeUrlAndAddCacheBusterToken(vUrlPrefix);
|
|
42
|
-
}
|
|
43
|
-
// any other types are just passed through
|
|
44
|
-
|
|
45
|
-
fnRegisterModulePath(sModuleName, vUrlPrefix);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Work around to use promise for booting the ui5.
|
|
51
|
-
* Singleton.
|
|
52
|
-
* Createed promise will be resolved after calling the resolveBootPromise method
|
|
53
|
-
*
|
|
54
|
-
* @returns {Promise}
|
|
55
|
-
* Promise will resolved after calling the resolveBootPromise
|
|
56
|
-
*/
|
|
57
|
-
oBootHandler.createUi5BootPromise = function () {
|
|
58
|
-
if (!oBootPromise) {
|
|
59
|
-
oBootPromise = new Promise(function (resolve, reject) {
|
|
60
|
-
fnResolve = resolve;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return oBootPromise;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The SAPUI5 boot task when bootstrapping Unified Shell for ABAP. The resolve the promise, which was created before by
|
|
68
|
-
* createUi5BootPromise method. If createUi5BootPromise was not called before, that fnCallback will be called.
|
|
69
|
-
* @param {function} fnCallback
|
|
70
|
-
* the function by which SAPUI5 is notified that this task is finished
|
|
71
|
-
*/
|
|
72
|
-
oBootHandler.resolveBootPromise = function (fnCallback) {
|
|
73
|
-
overwriteRegisterModulePath();
|
|
74
|
-
// add nice logging for sap/net/xhr.js
|
|
75
|
-
XMLHttpRequest.logger = Log.getLogger("sap.net.xhr");
|
|
76
|
-
if (fnResolve) {
|
|
77
|
-
fnResolve(fnCallback);
|
|
78
|
-
} else {
|
|
79
|
-
fnCallback();
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return oBootHandler;
|
|
84
|
-
});
|