@sapui5/sap.ushell_abap 1.94.1 → 1.97.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.
Files changed (115) hide show
  1. package/package.json +1 -1
  2. package/src/main/js/sap/ui2/srvc/ODataWrapper.js +1 -1
  3. package/src/main/js/sap/ushell_abap/.library +4 -9
  4. package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +12 -5
  5. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +11 -7
  6. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +47 -32
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
  8. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +46 -38
  9. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +574 -454
  10. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
  11. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +25 -15
  12. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +3 -2
  13. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +16 -7
  14. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
  15. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +8 -8
  16. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
  17. package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +11 -4
  18. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +9 -3
  19. package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +13 -11
  20. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def-dev.js +1 -1
  21. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def.js +1 -1
  22. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +8 -4
  23. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
  24. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.constants.js +9 -0
  25. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.get.server.config.Urls.js +12 -5
  26. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.load.launchpad.js +21 -22
  27. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +8 -2
  28. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.server.config.js +6 -3
  29. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +10 -5
  30. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.ui5.boot.handler.js +7 -4
  31. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.xhr.handler.js +10 -3
  32. package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +21 -16
  33. package/src/main/js/sap/ushell_abap/library.js +2 -2
  34. package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +186 -0
  35. package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +718 -0
  36. package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +930 -0
  37. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +1027 -0
  38. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +216 -0
  39. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +951 -0
  40. package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +45 -0
  41. package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +647 -0
  42. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +251 -0
  43. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1262 -0
  44. package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +920 -0
  45. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +1498 -0
  46. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +466 -0
  47. package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +52 -0
  48. package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +767 -0
  49. package/src/main/js/sap/ushell_abap/pbServices/ui2/chipdefinition.xsd +139 -0
  50. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +244 -0
  51. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/bag.js +150 -0
  52. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +165 -0
  53. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +330 -0
  54. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/fullscreen.js +70 -0
  55. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/navigation.js +50 -0
  56. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/preview.js +289 -0
  57. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/refresh.js +43 -0
  58. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/search.js +115 -0
  59. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/types.js +9 -0
  60. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/url.js +105 -0
  61. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +128 -0
  62. package/ui5.yaml +31 -0
  63. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/Component.js +0 -426
  64. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/css/style.css +0 -1
  65. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n.properties +0 -56
  66. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ar.properties +0 -36
  67. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_bg.properties +0 -36
  68. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ca.properties +0 -36
  69. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cs.properties +0 -36
  70. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cy.properties +0 -36
  71. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_da.properties +0 -36
  72. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_de.properties +0 -36
  73. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_el.properties +0 -36
  74. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en.properties +0 -36
  75. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_GB.properties +0 -36
  76. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_sappsd.properties +0 -36
  77. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saprigi.properties +0 -36
  78. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saptrc.properties +0 -36
  79. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es.properties +0 -36
  80. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es_MX.properties +0 -36
  81. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_et.properties +0 -36
  82. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fi.properties +0 -36
  83. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr.properties +0 -36
  84. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr_CA.properties +0 -36
  85. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hi.properties +0 -36
  86. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hr.properties +0 -36
  87. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hu.properties +0 -36
  88. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_id.properties +0 -36
  89. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_it.properties +0 -36
  90. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_iw.properties +0 -36
  91. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ja.properties +0 -36
  92. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_kk.properties +0 -36
  93. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ko.properties +0 -36
  94. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lt.properties +0 -36
  95. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lv.properties +0 -36
  96. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ms.properties +0 -36
  97. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_nl.properties +0 -36
  98. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_no.properties +0 -36
  99. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pl.properties +0 -36
  100. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt.properties +0 -36
  101. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt_PT.properties +0 -36
  102. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ro.properties +0 -36
  103. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ru.properties +0 -36
  104. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sh.properties +0 -36
  105. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sk.properties +0 -36
  106. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sl.properties +0 -36
  107. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sv.properties +0 -36
  108. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_th.properties +0 -36
  109. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_tr.properties +0 -36
  110. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_uk.properties +0 -36
  111. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_vi.properties +0 -36
  112. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_CN.properties +0 -36
  113. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_TW.properties +0 -36
  114. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/manifest.json +0 -153
  115. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/model/models.js +0 -14
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @fileOverview The Unified Shell's page building adapter for the ABAP platform.
5
- * @version 1.94.1
5
+ * @version 1.97.0
6
6
  */
7
7
  sap.ui.define([
8
8
  "sap/ui/thirdparty/URI",
@@ -14,9 +14,15 @@ sap.ui.define([
14
14
  "sap/ushell/Config",
15
15
  "sap/base/util/deepExtend",
16
16
  "sap/ushell/utils/chipsUtils",
17
- "sap/ui2/srvc/chipinstance",
18
- "sap/ui2/srvc/catalog",
19
- "sap/ui2/srvc/chipdefinition"
17
+ "sap/ushell_abap/pbServices/ui2/ChipInstance",
18
+ "sap/ushell_abap/pbServices/ui2/Catalog",
19
+ "sap/ushell_abap/pbServices/ui2/ChipDefinition",
20
+ "sap/ushell_abap/pbServices/ui2/Utils",
21
+ "sap/ushell_abap/pbServices/ui2/Page",
22
+ "sap/ushell_abap/pbServices/ui2/Error",
23
+ "sap/base/Log",
24
+ "sap/m/library",
25
+ "sap/ushell/ui/tile/StaticTile"
20
26
  ], function (
21
27
  URI,
22
28
  ManifestPropertyHelper,
@@ -26,13 +32,21 @@ sap.ui.define([
26
32
  GenericTile,
27
33
  Config,
28
34
  deepExtend,
29
- chipsUtils
30
- // chipinstance
31
- // catalog
32
- // chipdefinition
35
+ chipsUtils,
36
+ ChipInstance,
37
+ Catalog,
38
+ ChipDefinition,
39
+ Utils,
40
+ Page,
41
+ SrvcError,
42
+ Log,
43
+ mobileLibrary,
44
+ StaticTile
33
45
  ) {
34
46
  "use strict";
35
47
 
48
+ var LoadState = mobileLibrary.LoadState;
49
+
36
50
  var sCOMPONENT = "sap.ushell_abap.adapters.abap.LaunchPageAdapter",
37
51
  sDEFAULT_PAGE_ID = "/UI2/Fiori2LaunchpadHome",
38
52
  sDEFAULT_CATALOG_ID = "/UI2/FLPD_CATALOG",
@@ -71,7 +85,7 @@ sap.ui.define([
71
85
 
72
86
  // Stores a boolean that indicates whether a target mapping is supported on the current device.
73
87
  // One should use makeTargetMappingSupportKey to store and retrieve values to/from this map.
74
- oTargetMappingSupport = new sap.ui2.srvc.Map(),
88
+ oTargetMappingSupport = new Utils.Map(),
75
89
 
76
90
  oAdapterConfig = (oAdapterConfiguration && oAdapterConfiguration.config) || {},
77
91
  oTargetMappingServiceConfig = oAdapterConfig.services && oAdapterConfig.services.targetMappings,
@@ -97,9 +111,9 @@ sap.ui.define([
97
111
  }
98
112
 
99
113
  /**
100
- * Robust call to <code>sap.ui2.srvc.ChipInstance#getImplementationAsSapui5()</code>.
114
+ * Robust call to <code>sap.ushell_abap.pbServices.ui2.ChipInstance#getImplementationAsSapui5()</code>.
101
115
  *
102
- * @param {sap.ui2.srvc.ChipInstance} oTile Title object
116
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile Title object
103
117
  * @param {string} sTitle Title string
104
118
  * @param {string} sMessage Message string
105
119
  * @returns {sap.ui.core.Control} Implementation
@@ -109,8 +123,7 @@ sap.ui.define([
109
123
  return oTile.getImplementationAsSapui5();
110
124
  } catch (ex) {
111
125
  // log errors, but do not fail
112
- jQuery.sap.log.error(sMessage + ": " + (ex.message || ex),
113
- ex.stack, sCOMPONENT);
126
+ Log.error(sMessage + ": " + (ex.message || ex), ex.stack, sCOMPONENT);
114
127
  return new sap.ushell.ui.tile.StaticTile({ // TODO remove as soon as RT has a own // TODO: pending dependency migration
115
128
  icon: "sap-icon://error",
116
129
  info: "",
@@ -131,10 +144,10 @@ sap.ui.define([
131
144
  * @param {string} sTextName Text name to check for
132
145
  * @returns {string} Value for sTextName, or undefined if not found
133
146
  * @private
134
- * @see sap.ui2.srvc.ChipInstance#getBag
135
- * @see sap.ui2.srvc.ChipInstance#getBagIds
136
- * @see sap.ui2.srvc.Bag#getText
137
- * @see sap.ui2.srvc.Bag#getTextNames
147
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getBag
148
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getBagIds
149
+ * @see sap.ushell_abap.pbServices.ui2.Bag#getText
150
+ * @see sap.ushell_abap.pbServices.ui2.Bag#getTextNames
138
151
  */
139
152
  LaunchPageAdapter.prototype._getBagText = function (oChip, sBagId, sTextName) {
140
153
  // calling getBag directly, will create the bag if it does not exist yet!
@@ -156,7 +169,7 @@ sap.ui.define([
156
169
  * @param {string} sPropertyName Name of the property which is expected on the parsed object value from sConfigParameterId
157
170
  * @returns {string} Value for sPropertyName, or undefined if not found or an error occurred (e.g. due to failed parsing)
158
171
  * @private
159
- * @see sap.ui2.srvc.ChipInstance#getConfigurationParameter
172
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getConfigurationParameter
160
173
  */
161
174
  LaunchPageAdapter.prototype._getConfigurationProperty = function (oChip, sConfigParameterId, sPropertyName) {
162
175
  var sTileConfig,
@@ -190,7 +203,7 @@ sap.ui.define([
190
203
  * @since 1.11.0
191
204
  */
192
205
  LaunchPageAdapter.prototype._orderBasedOnConfiguration = function (oConfiguration, aElements) {
193
- var aOrder = (oConfiguration && sap.ui2.srvc.isArray(oConfiguration.order) ? oConfiguration.order : []),
206
+ var aOrder = (oConfiguration && Utils.isArray(oConfiguration.order) ? oConfiguration.order : []),
194
207
  mElementsById = {},
195
208
  aOrderedElements = [],
196
209
  oElement,
@@ -199,7 +212,7 @@ sap.ui.define([
199
212
  n;
200
213
 
201
214
  // append link tiles as they are exposed together with tiles via getGroupTiles
202
- aOrder = aOrder.concat(oConfiguration && sap.ui2.srvc.isArray(oConfiguration.linkOrder) ? oConfiguration.linkOrder : []);
215
+ aOrder = aOrder.concat(oConfiguration && Utils.isArray(oConfiguration.linkOrder) ? oConfiguration.linkOrder : []);
203
216
 
204
217
  // create a map of instances by ID
205
218
  for (i = 0, n = aElements.length; i < n; i += 1) {
@@ -234,7 +247,7 @@ sap.ui.define([
234
247
  * linkOrder: ["linkTileId1", "linkTileId2"]
235
248
  * }
236
249
  * </code>
237
- * @param {sap.ui2.srvc.ChipInstance} oTile The tile to be removed
250
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile The tile to be removed
238
251
  * @param {string} sCurrentTileType "link" or "tile"
239
252
  * @returns {integer} the index of the oTile if found. Otherwise -1 is returned
240
253
  * @private
@@ -293,7 +306,7 @@ sap.ui.define([
293
306
  /**
294
307
  * Calculates the layout object for the given Page. The layout
295
308
  *
296
- * @param {sap.ui2.srvc.Page} oPage The Page the layout is calculated for.
309
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oPage The Page the layout is calculated for.
297
310
  * @param {sap.ushell_abap.adapters.abap.LaunchPageAdapter} oAdapter The instance of the LaunchPageAdapter (this).
298
311
  * @returns {object} The calculated Page layout
299
312
  * <code>
@@ -326,7 +339,7 @@ sap.ui.define([
326
339
  /**
327
340
  * Orders the pages of _oCurrentPageSet based on the configuration maintained in _oCurrentPageSet and returns the result.
328
341
  *
329
- * @returns {sap.ui2.srvc.Page[]}
342
+ * @returns {sap.ushell_abap.pbServices.ui2.Page[]}
330
343
  * @private
331
344
  */
332
345
  function getOrderedPages () {
@@ -374,7 +387,7 @@ sap.ui.define([
374
387
  * Checks if the provided group should be visible or hidden.
375
388
  * It is decided according the group ID (oGroup should have a getId function).
376
389
  *
377
- * @param {sap.ui2.srvc.Page} oGroup The group to be checked.
390
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup The group to be checked.
378
391
  * @returns {boolean} true\false accordingly.
379
392
  * @private
380
393
  */
@@ -421,7 +434,7 @@ sap.ui.define([
421
434
 
422
435
  function fnFailure (sMessage) {
423
436
  // log errors, but do not fail
424
- jQuery.sap.log.error("Failed to load tile: " + sMessage, oChipInstance.toString(), sCOMPONENT);
437
+ Log.error("Failed to load tile: " + sMessage, oChipInstance.toString(), sCOMPONENT);
425
438
  if (oChipInstance._loadingDeferred) {
426
439
  oChipInstance._loadingDeferred.reject();
427
440
  }
@@ -436,7 +449,7 @@ sap.ui.define([
436
449
  * Triggers loading of all ChipInstances of the given pages and calls fnLocalChipsLoaded
437
450
  * when all local CHIP instances are completely loaded.
438
451
  *
439
- * @param {sap.ui2.srvc.Page[]} aPages the pages
452
+ * @param {sap.ushell_abap.pbServices.ui2.Page[]} aPages the pages
440
453
  * @param {function} fnLocalChipsLoaded Success handler which is called as soon as all LOCAL CHIPs are completely loaded.
441
454
  * @private
442
455
  */
@@ -479,7 +492,7 @@ sap.ui.define([
479
492
  LaunchPageAdapter.prototype._triggerChipInstanceLoad(oChipInstance);
480
493
  oCoreResourcesComplementEvent.off();
481
494
  } else {
482
- jQuery.sap.log.error("Did not load custom tile as core resources where not loaded", null, sCOMPONENT);
495
+ Log.error("Did not load custom tile as core resources where not loaded", null, sCOMPONENT);
483
496
  }
484
497
  });
485
498
  });
@@ -498,8 +511,7 @@ sap.ui.define([
498
511
  iPendingRequests += 1;
499
512
  oChipInstance.load(onLoad, function (sMessage) {
500
513
  // log errors, but do not fail
501
- jQuery.sap.log.error("Failed to load tile: " + sMessage,
502
- oChipInstance.toString(), sCOMPONENT);
514
+ Log.error("Failed to load tile: " + sMessage, oChipInstance.toString(), sCOMPONENT);
503
515
  onLoad();
504
516
  });
505
517
  }
@@ -589,7 +601,7 @@ sap.ui.define([
589
601
  sUrl += (sUrl.indexOf("?") < 0 ? "?" : "&") + "sap-ui2-cache-disable=" + sUI2CacheDisable;
590
602
  }
591
603
 
592
- sap.ui2.srvc.get(
604
+ Utils.get(
593
605
  sUrl,
594
606
  false, /*xml=*/
595
607
  function (sDirectStartResult) {
@@ -622,7 +634,7 @@ sap.ui.define([
622
634
  * This is the case for the results of {@link #addTile}, but not for {@link #addBookmark}.
623
635
  * Such wrappers must be unwrapped by {@link #moveTile} or else the title becomes "hard coded" in the newly created CHIP instance.
624
636
  *
625
- * @param {sap.ui2.srvc.ChipInstance} oTile
637
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile
626
638
  * @returns {boolean}
627
639
  */
628
640
  LaunchPageAdapter.prototype._isWrapperOnly = function (oTile) {
@@ -636,12 +648,12 @@ sap.ui.define([
636
648
  /**
637
649
  * Wraps the given CHIPs as CHIP instances, filtering out action CHIPs.
638
650
  *
639
- * @param {sap.ui2.srvc.Chip[]} aChips array of chips
640
- * @returns {sap.ui2.srvc.ChipInstance[]} array of chip instances
651
+ * @param {sap.ushell_abap.pbServices.ui2.Factory} oFactory The factory to create new chip instances.
652
+ * @param {sap.ushell_abap.pbServices.ui2.Chip[]} aChips A list of chips.
653
+ * @returns {sap.ushell_abap.pbServices.ui2.ChipInstance[]} A list of chip instances.
641
654
  */
642
- function wrapAsChipInstances (aChips) {
643
- var aChipInstances = [],
644
- oFactory = sap.ushell.Container.getService("PageBuilding").getFactory();
655
+ function wrapAsChipInstances (oFactory, aChips) {
656
+ var aChipInstances = [];
645
657
 
646
658
  aChips.forEach(function (oChip) {
647
659
  var oRemoteCatalog = oChip.getRemoteCatalog(),
@@ -663,11 +675,11 @@ sap.ui.define([
663
675
  /**
664
676
  * Wraps the current <code>allCatalogs</code> collection into black box objects.
665
677
  *
666
- * @returns {Array}
667
- *
678
+ * @returns {object[]} A list of catalog objects.
679
+ * @param {sap.ushell_abap.pbServices.ui2.Factory} oFactory The factory to create new chip instances.
668
680
  * TODO cache result?!
669
681
  */
670
- function wrapCatalogs () {
682
+ function wrapCatalogs (oFactory) {
671
683
  var oAllCatalogs = that._oCurrentPageSet.getDefaultPage().getAllCatalogs(),
672
684
  oCatalog,
673
685
  aCatalogs = oAllCatalogs.getCatalogs(),
@@ -686,7 +698,7 @@ sap.ui.define([
686
698
  : oCatalog.getTitle(),
687
699
  tiles: oCatalog.isStub()
688
700
  ? []
689
- : wrapAsChipInstances(oCatalog.getChips()),
701
+ : wrapAsChipInstances(oFactory, oCatalog.getChips()),
690
702
  ui2catalog: oCatalog // for convenience
691
703
  });
692
704
  }
@@ -696,7 +708,7 @@ sap.ui.define([
696
708
 
697
709
  /**
698
710
  * Tells whether the given CHIP instance is a static or dynamic app launcher
699
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
711
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
700
712
  * @returns {boolean}
701
713
  */
702
714
  function isAppLauncher (oChipInstance) {
@@ -706,7 +718,7 @@ sap.ui.define([
706
718
 
707
719
  /**
708
720
  * Tells whether the given CHIP instance is a card
709
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
721
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
710
722
  * @returns {boolean}
711
723
  */
712
724
  function isCard (oChipInstance) {
@@ -716,7 +728,7 @@ sap.ui.define([
716
728
 
717
729
  /**
718
730
  * Tells whether the given CHIP instance is remote
719
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
731
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
720
732
  * @returns {boolean}
721
733
  */
722
734
  function isRemoteChipInstance (oChipInstance) {
@@ -729,7 +741,7 @@ sap.ui.define([
729
741
  *
730
742
  * Note: If this method returns false does not mean that the later loading will not fail
731
743
  *
732
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
744
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
733
745
  * @returns {boolean}
734
746
  */
735
747
  function isBrokenChip (oChipInstance) {
@@ -741,7 +753,7 @@ sap.ui.define([
741
753
  * Returns the tile configuration of the given (app launcher) CHIP instance.
742
754
  * It logs an error message if the tile configuration cannot be parsed.
743
755
  *
744
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance must not be a stub anymore. Also it's CHIP must not be a stub anymore.
756
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance must not be a stub anymore. Also it's CHIP must not be a stub anymore.
745
757
  * @returns {object} the tile configuration
746
758
  */
747
759
  function getAppLauncherTileConfiguration (oChipInstance) {
@@ -750,7 +762,7 @@ sap.ui.define([
750
762
  try {
751
763
  oParsedTileConfiguration = JSON.parse(sConfigParam || "{}");
752
764
  } catch (oEx) {
753
- jQuery.sap.log.error("Tile with ID '" + oChipInstance.getId() +
765
+ Log.error("Tile with ID '" + oChipInstance.getId() +
754
766
  "' has a corrupt configuration containing a 'tileConfiguration' value '" + sConfigParam +
755
767
  "' which could not be parsed. If present, a (stringified) JSON is expected as value.",
756
768
  oEx.message,
@@ -765,7 +777,7 @@ sap.ui.define([
765
777
  * Returns the tile configuration of the given (Smart Business) CHIP instance.
766
778
  * It logs an error message if the tile configuration cannot be parsed.
767
779
  *
768
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance must not be a stub anymore. Also it's CHIP must not be a stub anymore.
780
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance must not be a stub anymore. Also it's CHIP must not be a stub anymore.
769
781
  * @returns {object} the tile configuration in style of an applauncer
770
782
  */
771
783
  function getSmartBusinessTileConfiguration (oChipInstance) {
@@ -800,7 +812,7 @@ sap.ui.define([
800
812
  * Returns the tile configuration of the given custom CHIP instance, but only if it uses the same configuration structure
801
813
  * as the standard static and dynamic app launcher or if it uses the Smart Business tiles' configuration structure.
802
814
  *
803
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance It's CHIP may still be a stub.
815
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance It's CHIP may still be a stub.
804
816
  * @returns {object} the tile configuration or an empty object
805
817
  */
806
818
  function getCustomTileConfiguration (oChipInstance) {
@@ -885,7 +897,7 @@ sap.ui.define([
885
897
  };
886
898
 
887
899
  /**
888
- * @returns {sap.ui2.srvc.Map} all supported target mappings
900
+ * @returns {sap.ushell_abap.pbServices.ui2.Map} all supported target mappings
889
901
  */
890
902
  this.getTargetMappingSupport = function () {
891
903
  return oTargetMappingSupport;
@@ -920,7 +932,7 @@ sap.ui.define([
920
932
  sReferenceLostSafe = sReferenceLost || Object.prototype.toString.apply(sReferenceLostSafe);
921
933
 
922
934
  if (!sReferenceLostSafe.match(/^Reference lost: Note \d+ Page.+\s,\sInstance ID.+$/)) {
923
- jQuery.sap.log.warning(
935
+ Log.warning(
924
936
  "The string that describes a lost reference is in an unexpected format",
925
937
  "This is expected to be a string exactly like 'Reference lost: Note <#> Page <CATALOG_ID> , Instance ID <CHIP_ID>' instead of the given '" + sReferenceLost + "'",
926
938
  "sap.ushell_abap.adapters.abap.LaunchPageAdapter"
@@ -967,8 +979,8 @@ sap.ui.define([
967
979
  * It logs at most two messages (one warning and one error), grouping errors by groups and error type.
968
980
  * </p>
969
981
  *
970
- * @param {sap.ui2.srvc.Page[]} aPages an array of all the pages.
971
- * @param {sap.ui2.srvc.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
982
+ * @param {sap.ushell_abap.pbServices.ui2.Page[]} aPages an array of all the pages.
983
+ * @param {sap.ushell_abap.pbServices.ui2.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
972
984
  * account its form factor.
973
985
  * @private
974
986
  */
@@ -983,8 +995,8 @@ sap.ui.define([
983
995
  /**
984
996
  * Finds errors on tiles in all Groups.
985
997
  *
986
- * @param {array} aPages an array of <code>sap.ui2.srvc.Page</code> objects representing groups of tiles.
987
- * @param {sap.ui2.srvc.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
998
+ * @param {array} aPages an array of <code>sap.ushell_abap.pbServices.ui2.Page</code> objects representing groups of tiles.
999
+ * @param {sap.ushell_abap.pbServices.ui2.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
988
1000
  * account its form factor.
989
1001
  * @returns {array} An array describing each error found.
990
1002
  * @private
@@ -1003,8 +1015,8 @@ sap.ui.define([
1003
1015
  /**
1004
1016
  * Finds possible errors on tiles in a given Group.
1005
1017
  *
1006
- * @param {object} oPage an <code>sap.ui2.srvc.Page</code> object representing a group of tiles.
1007
- * @param {sap.ui2.srvc.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
1018
+ * @param {object} oPage an <code>sap.ushell_abap.pbServices.ui2.Page</code> object representing a group of tiles.
1019
+ * @param {sap.ushell_abap.pbServices.ui2.Map} oTargetMappingSupport a map containing whether an intent is supported taking into
1008
1020
  * account its form factor.
1009
1021
  * @returns {array} An array describing each error found
1010
1022
  * @private
@@ -1209,147 +1221,143 @@ sap.ui.define([
1209
1221
 
1210
1222
  if (aErrorMessage.length > 0) {
1211
1223
  aErrorMessage.unshift("Tile error(s) were detected:");
1212
- jQuery.sap.log.error(aErrorMessage.join("\n"), null, "sap.ushell_abap.adapters.abap.LaunchPageAdapter");
1224
+ Log.error(aErrorMessage.join("\n"), null, "sap.ushell_abap.adapters.abap.LaunchPageAdapter");
1213
1225
  }
1214
1226
 
1215
1227
  if (aWarningMessage.length > 0) {
1216
1228
  aWarningMessage.unshift("Tile warning(s) were detected:");
1217
- jQuery.sap.log.warning(aWarningMessage.join("\n"), null, "sap.ushell_abap.adapters.abap.LaunchPageAdapter");
1229
+ Log.warning(aWarningMessage.join("\n"), null, "sap.ushell_abap.adapters.abap.LaunchPageAdapter");
1218
1230
  }
1219
1231
  };
1220
1232
 
1221
1233
  /**
1222
1234
  * Returns the groups of the user. This is an asynchronous function using a jQuery.Promise.
1223
- * In case of success its <code>done</code> function is called and gets an array of <code>sap.ui2.srvc.Page</code> objects.
1235
+ * In case of success its <code>done</code> function is called and gets an array of <code>sap.ushell_abap.pbServices.ui2.Page</code> objects.
1224
1236
  * These page objects can be passed in to all functions expecting a group.
1225
1237
  *
1226
1238
  * The first group in this list is considered the default group.
1227
1239
  *
1228
1240
  * In case of error the promise's <code>fail</code> function is called.
1229
1241
  *
1230
- * @returns {object} jQuery.Promise object.
1242
+ * @returns {jQuery.Promise} jQuery.Promise object.
1231
1243
  * @since 1.11.0
1232
1244
  */
1233
1245
  this.getGroups = function () {
1234
- var that = this,
1235
- oDeferred, // the deferred used for page set loading
1236
- oMappingPromise, // the promise of readMappingTargets
1237
- oUshellPbs; // ushell service PageBuilding
1238
-
1239
- if (that._bPageSetFullyLoaded) {
1246
+ if (this._bPageSetFullyLoaded) {
1240
1247
  // return the already known page set (the order is recomputed because the page set might have changed it since last call)
1241
- return (new jQuery.Deferred()).resolve(getOrderedPages()).promise();
1248
+ return new jQuery.Deferred().resolve(getOrderedPages()).promise();
1242
1249
  }
1243
1250
  if (!oGetGroupsDeferred) {
1244
1251
  // start a new request and remember it in oGetGroupsDeferred, so that parallel calls don't start another one
1245
1252
  oGetGroupsDeferred = new jQuery.Deferred();
1246
- oDeferred = new jQuery.Deferred();
1247
- oUshellPbs = sap.ushell.Container.getService("PageBuilding");
1248
-
1249
- if (oLaunchPageServiceConfig && oLaunchPageServiceConfig.cacheId) {
1250
- // add PageSet cache buster token if configured
1251
- oUshellPbs.getFactory().getPageBuildingService().readPageSet.cacheBusterTokens
1252
- .put(sDEFAULT_PAGE_ID, oLaunchPageServiceConfig.cacheId);
1253
- }
1254
- if (oLaunchPageServiceConfig && oLaunchPageServiceConfig["sap-ui2-cache-disable"]
1255
- && oUshellPbs.getFactory().getPageBuildingService().readPageSet) {
1256
- var oAppendedParameters = oUshellPbs.getFactory().getPageBuildingService().readPageSet.appendedParameters || {};
1257
- oAppendedParameters["sap-ui2-cache-disable"] = oLaunchPageServiceConfig["sap-ui2-cache-disable"];
1258
- oUshellPbs.getFactory().getPageBuildingService().readPageSet.appendedParameters = oAppendedParameters;
1259
- }
1253
+ var oDeferred = new jQuery.Deferred();
1260
1254
 
1261
- /*
1262
- The target mappings are used in the classic homepage and in spaces mode.
1263
- */
1264
- oMappingPromise = this._readTargetMappings().done(function (oTargetMappings) {
1265
- var sFormFactor = sap.ui2.srvc.getFormFactor();
1266
-
1267
- oTargetMappings.results.forEach(function (oTargetMapping) {
1268
- var sKey = LaunchPageAdapter.prototype._makeTargetMappingSupportKey(
1269
- oTargetMapping.semanticObject,
1270
- oTargetMapping.semanticAction
1271
- );
1272
-
1273
- oTargetMappingSupport.put(sKey,
1274
- // make sure it's boolean
1275
- oTargetMappingSupport.get(sKey)
1276
- || !!(oTargetMapping.formFactors && oTargetMapping.formFactors[sFormFactor]));
1277
- });
1278
- });
1255
+ sap.ushell.Container.getServiceAsync("PageBuilding")
1256
+ .then(function (PageBuildingService) {
1257
+ var fnReadPageSet = PageBuildingService.getFactory().getPageBuildingService().readPageSet;
1279
1258
 
1280
- /* In spaces mode we will create an empty page inside an empty pageset.
1281
- This is needed because the appfinder and search integration request the classic homepage content which is not available in spaces mode.
1282
- For consistency reasons it should then also not be availabe from the search results.
1283
- The empty pageset has all needed functions the real pageset has.
1284
- Functions which should not be used in spaces mode throw an error
1285
- */
1286
- if (Config.last("/core/spaces/enabled")) {
1287
- sap.ushell.Container.getServiceAsync("PageBuilding").then(function (oPageBuilding) {
1288
- var oFactory = oPageBuilding.getFactory();
1289
-
1290
- var oFakeDefaultPage = new sap.ui2.srvc.Page(oFactory, {
1291
- id: PAGE_ID_WITHOUT_TM
1292
- });
1259
+ if (oLaunchPageServiceConfig && oLaunchPageServiceConfig.cacheId) {
1260
+ // add PageSet cache buster token if configured
1261
+ fnReadPageSet.cacheBusterTokens
1262
+ .put(sDEFAULT_PAGE_ID, oLaunchPageServiceConfig.cacheId);
1263
+ }
1264
+ if (oLaunchPageServiceConfig && oLaunchPageServiceConfig["sap-ui2-cache-disable"] && fnReadPageSet) {
1265
+ var oAppendedParameters = fnReadPageSet.appendedParameters || {};
1266
+ oAppendedParameters["sap-ui2-cache-disable"] = oLaunchPageServiceConfig["sap-ui2-cache-disable"];
1267
+ fnReadPageSet.appendedParameters = oAppendedParameters;
1268
+ }
1293
1269
 
1294
- var oEmptyPageSet = {
1295
- getDefaultPage: function () {
1296
- return oFakeDefaultPage;
1297
- },
1298
- getPages: function () {
1299
- return [oFakeDefaultPage];
1300
- },
1301
- appendPage: function () {
1302
- throw new Error("Not implemented in Pages Runtime");
1303
- },
1304
- isPageRemovable: function () {
1305
- return false;
1306
- },
1307
- removePage: function () {
1308
- throw new Error("Not implemented in Pages Runtime");
1309
- },
1310
- isPageResettable: function () {
1311
- return true;
1312
- },
1313
- resetPage: function () {
1314
- },
1315
- getConfiguration: function () {
1316
- return "{}";
1317
- },
1318
- setConfiguration: function () {
1319
- },
1320
- filter: function () {
1321
- }
1322
- };
1270
+ /*
1271
+ The target mappings are used in the classic homepage and in spaces mode.
1272
+ */
1273
+ var oMappingPromise = this._readTargetMappings()
1274
+ .done(function (oTargetMappings) {
1275
+ var sFormFactor = Utils.getFormFactor();
1276
+
1277
+ oTargetMappings.results.forEach(function (oTargetMapping) {
1278
+ var sKey = LaunchPageAdapter.prototype._makeTargetMappingSupportKey(
1279
+ oTargetMapping.semanticObject,
1280
+ oTargetMapping.semanticAction
1281
+ );
1282
+
1283
+ oTargetMappingSupport.put(sKey,
1284
+ // make sure it's boolean
1285
+ oTargetMappingSupport.get(sKey)
1286
+ || !!(oTargetMapping.formFactors && oTargetMapping.formFactors[sFormFactor]));
1287
+ });
1288
+ });
1323
1289
 
1324
- that._oCurrentPageSet = oEmptyPageSet;
1325
- oGetGroupsDeferred.resolve([]);
1326
- });
1327
- } else {
1328
- var oPageSetsPromise = oUshellPbs.getPageSet(sDEFAULT_PAGE_ID);
1329
-
1330
- oPageSetsPromise
1331
- .fail(oDeferred.reject.bind(oDeferred))
1332
- .done(function (oPageSet) {
1333
- that._oCurrentPageSet = oPageSet;
1334
- // remove unsupported pages before loading their chip instances
1335
- that._oCurrentPageSet.filter([sDEFAULT_PAGE_ID], [sDEFAULT_CATALOG_ID]);
1336
- // Trigger load of all CHIP instances, but wait for the locals only
1337
- that._loadApplaunchersAndDelayLoadingOfOtherChips(oPageSet.getPages(),
1338
- oDeferred.resolve.bind(oDeferred, oPageSet));
1339
- });
1290
+ /*
1291
+ In spaces mode we will create an empty page inside an empty pageset.
1292
+ This is needed because the appfinder and search integration request the classic homepage content which is not available in spaces mode.
1293
+ For consistency reasons it should then also not be availabe from the search results.
1294
+ The empty pageset has all needed functions the real pageset has.
1295
+ Functions which should not be used in spaces mode throw an error
1296
+ */
1297
+ if (Config.last("/core/spaces/enabled")) {
1298
+ var oFactory = PageBuildingService.getFactory();
1299
+
1300
+ var oFakeDefaultPage = new Page(oFactory, {
1301
+ id: PAGE_ID_WITHOUT_TM
1302
+ });
1340
1303
 
1341
- jQuery.when(oMappingPromise, oDeferred)
1342
- .done(function (oTargetMappings, oPageSet) {
1343
- that._bPageSetFullyLoaded = true;
1304
+ that._oCurrentPageSet = {
1305
+ getDefaultPage: function () {
1306
+ return oFakeDefaultPage;
1307
+ },
1308
+ getPages: function () {
1309
+ return [oFakeDefaultPage];
1310
+ },
1311
+ appendPage: function () {
1312
+ throw new Error("Not implemented in Pages Runtime");
1313
+ },
1314
+ isPageRemovable: function () {
1315
+ return false;
1316
+ },
1317
+ removePage: function () {
1318
+ throw new Error("Not implemented in Pages Runtime");
1319
+ },
1320
+ isPageResettable: function () {
1321
+ return true;
1322
+ },
1323
+ resetPage: function () {
1324
+ },
1325
+ getConfiguration: function () {
1326
+ return "{}";
1327
+ },
1328
+ setConfiguration: function () {
1329
+ },
1330
+ filter: function () {
1331
+ }
1332
+ };
1344
1333
 
1345
- if (jQuery.sap.log.getLevel() >= jQuery.sap.log.Level.DEBUG) { // sap-ui-debug = true
1346
- that._findAndReportTileErrors(oPageSet.getPages(), oTargetMappingSupport);
1347
- }
1334
+ oGetGroupsDeferred.resolve([]);
1335
+ } else {
1336
+ var oPageSetsPromise = PageBuildingService.getPageSet(sDEFAULT_PAGE_ID);
1337
+
1338
+ oPageSetsPromise
1339
+ .fail(oDeferred.reject.bind(oDeferred))
1340
+ .done(function (oPageSet) {
1341
+ this._oCurrentPageSet = oPageSet;
1342
+ // remove unsupported pages before loading their chip instances
1343
+ this._oCurrentPageSet.filter([sDEFAULT_PAGE_ID], [sDEFAULT_CATALOG_ID]);
1344
+ // Trigger load of all CHIP instances, but wait for the locals only
1345
+ this._loadApplaunchersAndDelayLoadingOfOtherChips(oPageSet.getPages(), oDeferred.resolve.bind(oDeferred, oPageSet));
1346
+ }.bind(this));
1347
+
1348
+ jQuery.when(oMappingPromise, oDeferred)
1349
+ .done(function (oTargetMappings, oPageSet) {
1350
+ this._bPageSetFullyLoaded = true;
1351
+
1352
+ if (Log.getLevel() >= Log.Level.DEBUG) { // sap-ui-debug = true
1353
+ this._findAndReportTileErrors(oPageSet.getPages(), oTargetMappingSupport);
1354
+ }
1348
1355
 
1349
- oGetGroupsDeferred.resolve(getOrderedPages());
1350
- })
1351
- .fail(oGetGroupsDeferred.reject.bind(oGetGroupsDeferred));
1352
- }
1356
+ oGetGroupsDeferred.resolve(getOrderedPages());
1357
+ }.bind(this))
1358
+ .fail(oGetGroupsDeferred.reject.bind(oGetGroupsDeferred));
1359
+ }
1360
+ }.bind(this));
1353
1361
  }
1354
1362
 
1355
1363
  return oGetGroupsDeferred.promise();
@@ -1358,7 +1366,7 @@ sap.ui.define([
1358
1366
  /**
1359
1367
  * Returns the default group. This is an asynchronous function using a jQuery.Promise.
1360
1368
  * In case of success its <code>done</code> function is called and gets the
1361
- * <code>sap.ui2.srvc.Page</code> object representing the default group.
1369
+ * <code>sap.ushell_abap.pbServices.ui2.Page</code> object representing the default group.
1362
1370
  *
1363
1371
  * In case of error the promise's <code>fail</code> function is called.
1364
1372
  *
@@ -1379,7 +1387,7 @@ sap.ui.define([
1379
1387
  /**
1380
1388
  * Returns the title of the given group.
1381
1389
  *
1382
- * @param {sap.ui2.srvc.Page} oGroup the group (as received via #getGroups())
1390
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup the group (as received via #getGroups())
1383
1391
  * @returns {string} the group title
1384
1392
  * @since 1.11.0
1385
1393
  */
@@ -1390,7 +1398,7 @@ sap.ui.define([
1390
1398
  /**
1391
1399
  * Returns the unique identifier of the given group.
1392
1400
  *
1393
- * @param {sap.ui2.srvc.Page} oGroup the group (as received via #getGroups())
1401
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup the group (as received via #getGroups())
1394
1402
  * @returns {string} the group id
1395
1403
  * @since 1.11.0
1396
1404
  */
@@ -1401,8 +1409,8 @@ sap.ui.define([
1401
1409
  /**
1402
1410
  * Returns the tiles of the given group.
1403
1411
  *
1404
- * @param {sap.ui2.srvc.Page} oGroup the group
1405
- * @returns {sap.ui2.srvc.ChipInstance[]} the tiles in the order to be displayed.
1412
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup the group
1413
+ * @returns {sap.ushell_abap.pbServices.ui2.ChipInstance[]} the tiles in the order to be displayed.
1406
1414
  * @since 1.11.0
1407
1415
  */
1408
1416
  this.getGroupTiles = function (oGroup) {
@@ -1411,7 +1419,7 @@ sap.ui.define([
1411
1419
  try {
1412
1420
  oLayout = JSON.parse(oGroup.getLayout());
1413
1421
  } catch (e) {
1414
- jQuery.sap.log.warning("Group " + oGroup.getId() + ": invalid layout: " + oGroup.getLayout(), null, sCOMPONENT);
1422
+ Log.warning("Group " + oGroup.getId() + ": invalid layout: " + oGroup.getLayout(), null, sCOMPONENT);
1415
1423
  // no valid layout
1416
1424
  }
1417
1425
  return this._orderBasedOnConfiguration(oLayout, oGroup.getChipInstances());
@@ -1419,12 +1427,12 @@ sap.ui.define([
1419
1427
 
1420
1428
  /**
1421
1429
  * Adds a new group. This is an asynchronous function using a jQuery.Promise.
1422
- * In case of success its <code>done</code> function is called and gets the added group as a <code>sap.ui2.srvc.Page</code>.
1430
+ * In case of success its <code>done</code> function is called and gets the added group as a <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1423
1431
  *
1424
1432
  * Intention: the page builder adds this group to the end of the home screen.
1425
1433
  *
1426
1434
  * In case of error the promise's <code>fail</code> function is called and gets the
1427
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1435
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1428
1436
  *
1429
1437
  * @param {string} sTitle the title of the new group
1430
1438
  * @returns {object} a jQuery.Promise.
@@ -1445,7 +1453,7 @@ sap.ui.define([
1445
1453
  * In case of success its <code>done</code> function is called.
1446
1454
  *
1447
1455
  * In case of error the promise's <code>fail</code> function is called and gets the
1448
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1456
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1449
1457
  *
1450
1458
  * @param {object} oGroup the group to be removed
1451
1459
  * @returns {object} a jQuery.Promise
@@ -1469,9 +1477,9 @@ sap.ui.define([
1469
1477
  * This is an asynchronous function using a jQuery.Promise. In case of success its <code>done</code> function is called.
1470
1478
  *
1471
1479
  * In case of error the promise's <code>fail</code> function is called and gets the
1472
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1480
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1473
1481
  *
1474
- * @param {sap.ui2.srvc.Page} oGroup the group to be reset
1482
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup the group to be reset
1475
1483
  * @returns {object} a jQuery.Promise
1476
1484
  * @since 1.11.0
1477
1485
  */
@@ -1548,7 +1556,7 @@ sap.ui.define([
1548
1556
  *
1549
1557
  * <p>This function will log a warning if a falsy value is returned.
1550
1558
  *
1551
- * @param {sap.ui2.srvc.ChipInstance} oTile the group tile or catalog tile
1559
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the group tile or catalog tile
1552
1560
  * @returns {boolean} <code>true</code> if the tile's target intent is supported
1553
1561
  * @since 1.21.0
1554
1562
  */
@@ -1571,7 +1579,7 @@ sap.ui.define([
1571
1579
 
1572
1580
  // This error is already logged in an aggregated log message by _reportTileErrors, but we keep it because
1573
1581
  // tiles may be added to the FLP home at a later point of time within the session (not covered by the other log).
1574
- jQuery.sap.log.warning("Group tile with ID '" + oTile.getId() + "' is filtered out as the current user has no target mapping assigned for the intent '" +
1582
+ Log.warning("Group tile with ID '" + oTile.getId() + "' is filtered out as the current user has no target mapping assigned for the intent '" +
1575
1583
  sIntent + "'",
1576
1584
  "\nGroup Tile ID: '" + oTile.getId() + "'\n" +
1577
1585
  "Title: '" + sTitle + "'\n" +
@@ -1586,8 +1594,8 @@ sap.ui.define([
1586
1594
  /**
1587
1595
  * Implements the functionality described in the public <code>#isTileIntentSupported</code> without logging.
1588
1596
  *
1589
- * @param {sap.ui2.srvc.ChipInstance} oTile the group tile or catalog tile
1590
- * @param {sap.ui2.srvc.Map} oTargetMappingSupport the tile target mapping support
1597
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the group tile or catalog tile
1598
+ * @param {sap.ushell_abap.pbServices.ui2.Map} oTargetMappingSupport the tile target mapping support
1591
1599
  * @returns {object} An object reporting the support of the tile intent that
1592
1600
  * looks like the following objects based on whether the tile intent is supported:
1593
1601
  * <pre>
@@ -1658,7 +1666,7 @@ sap.ui.define([
1658
1666
  // the assumption is that currently launcher tiles are always local CHIPs and for those getGroups is waiting.
1659
1667
  // Thus this Error should newer be reached.
1660
1668
  // If stub launchers shall be supported, it must found a way how to decided if they are supported.
1661
- throw new sap.ui2.srvc.Error("Applauncher Tile not loaded completely",
1669
+ throw new SrvcError("Applauncher Tile not loaded completely",
1662
1670
  "sap.ushell_abap.adapters.abap.LaunchPageAdapter");
1663
1671
  }
1664
1672
 
@@ -1703,7 +1711,7 @@ sap.ui.define([
1703
1711
  * Moves a group to a new index. This is an asynchronous function using a jQuery.Promise.
1704
1712
  * In case of success its <code>done</code> function is called.
1705
1713
  * In case of error the promise's <code>fail</code> function is called and gets the
1706
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1714
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1707
1715
  *
1708
1716
  * @param {object} oGroup the group to be moved
1709
1717
  * @param {integer} iNewIndex the new index for the group
@@ -1766,12 +1774,12 @@ sap.ui.define([
1766
1774
  /**
1767
1775
  * Adds a tile to the end of a group. The group is optional. If no group is given, use the default group.
1768
1776
  * This is an asynchronous function using a jQuery.Promise.
1769
- * In case of success its <code>done</code> function is called and gets the new tile as a <code>sap.ui2.srvc.ChipInstance</code>.
1777
+ * In case of success its <code>done</code> function is called and gets the new tile as a <code>sap.ushell_abap.pbServices.ui2.ChipInstance</code>.
1770
1778
  * In case of error the promise's <code>fail</code> function is called and gets the
1771
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1779
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1772
1780
  *
1773
- * @param {sap.ui2.srvc.ChipInstance} oCatalogTile an 'anonymous' catalog tile from the catalog browser
1774
- * @param {sap.ui2.srvc.Page} [oGroup] the group
1781
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oCatalogTile an 'anonymous' catalog tile from the catalog browser
1782
+ * @param {sap.ushell_abap.pbServices.ui2.Page} [oGroup] the group
1775
1783
  * @returns {object} a jQuery.Promise
1776
1784
  * @since 1.11.0
1777
1785
  */
@@ -1800,10 +1808,10 @@ sap.ui.define([
1800
1808
  * Removes the given tile from the given group. This is an asynchronous function using a jQuery.Promise.
1801
1809
  * In case of success its <code>done</code> function is called.
1802
1810
  * In case of error the promise's <code>fail</code> function is called and gets the
1803
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1811
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1804
1812
  *
1805
- * @param {sap.ui2.srvc.Page} oGroup the group containing the tile
1806
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile
1813
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oGroup the group containing the tile
1814
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile
1807
1815
  * @returns {object} a jQuery.Promise
1808
1816
  * @since 1.11.0
1809
1817
  */
@@ -1820,31 +1828,25 @@ sap.ui.define([
1820
1828
  * Moves a tile to another location in the same or a different group. This is an asynchronous function using a jQuery.Promise.
1821
1829
  * In case of success its <code>done</code> function is called and gets the new target tile (which may be identical).
1822
1830
  * In case of error the promise's <code>fail</code> function is called and gets the
1823
- * consistent backend state of all groups as array of <code>sap.ui2.srvc.Page</code>.
1831
+ * consistent backend state of all groups as array of <code>sap.ushell_abap.pbServices.ui2.Page</code>.
1824
1832
  *
1825
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile to be moved
1833
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile to be moved
1826
1834
  * @param {integer} iSourceIndex the index in the source group
1827
1835
  * @param {integer} iTargetIndex the index in the target group, in case this parameter is not supplied we assume the
1828
1836
  * move tile is within the source group using iSourceIndex
1829
- * @param {sap.ui2.srvc.Page} oSourceGroup the tile's group
1830
- * @param {sap.ui2.srvc.Page} [oTargetGroup] the group the tile will be placed in or tile's group if not supplied
1837
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oSourceGroup the tile's group
1838
+ * @param {sap.ushell_abap.pbServices.ui2.Page} [oTargetGroup] the group the tile will be placed in or tile's group if not supplied
1831
1839
  * @param {string} [sNewTileType] (added with 1.60) The new type of the tile
1832
- * @returns {object} a jQuery.Promise
1840
+ * @returns {jQuery.Promise} A jQuery.Promise
1833
1841
  * @since 1.11.0
1834
1842
  */
1835
1843
  this.moveTile = function (oTile, iSourceIndex, iTargetIndex, oSourceGroup, oTargetGroup, sNewTileType) {
1836
1844
  var oDeferred = new jQuery.Deferred(),
1837
1845
  bIsWrapperOnly = this._isWrapperOnly(oTile),
1838
- oPbs,
1839
- oBagsContents = new sap.ui2.srvc.Map(),
1846
+ oBagsContents = new Utils.Map(),
1840
1847
  oCreatedChipInstance,
1841
- aBagIds,
1842
- oSourceLayout,
1843
- oTargetLayout,
1844
- aTargetChipInstances,
1845
1848
  fnFailure = oDeferred.reject.bind(oDeferred, getOrderedPages()),
1846
- iCalls = 2,
1847
- sOldTileType;
1849
+ iCalls = 2;
1848
1850
 
1849
1851
  function resolveMoveBetweenGroups (oNewChipInstance) {
1850
1852
  iCalls -= 1;
@@ -1860,13 +1862,14 @@ sap.ui.define([
1860
1862
  if (!oTargetGroup) {
1861
1863
  oTargetGroup = oSourceGroup;
1862
1864
  }
1863
- oSourceLayout = calculateCurrentLayout(oSourceGroup, this);
1864
- oTargetLayout = calculateCurrentLayout(oTargetGroup, this);
1865
- sOldTileType = this.getTileType(oTile);
1865
+
1866
+ var oSourceLayout = calculateCurrentLayout(oSourceGroup, this);
1867
+ var oTargetLayout = calculateCurrentLayout(oTargetGroup, this);
1868
+ var sOldTileType = this.getTileType(oTile);
1866
1869
 
1867
1870
  iSourceIndex = removeFromLayout(oSourceLayout, oTile, sOldTileType);
1868
1871
  if (iSourceIndex < 0) {
1869
- jQuery.sap.log.error("moveTile: tile not found in source group", null, sCOMPONENT);
1872
+ Log.error("moveTile: tile not found in source group", null, sCOMPONENT);
1870
1873
  fnFailure();
1871
1874
  return oDeferred.promise();
1872
1875
  }
@@ -1875,74 +1878,78 @@ sap.ui.define([
1875
1878
  addToLayout(oSourceLayout, oTile.getId(), iTargetIndex, sNewTileType);
1876
1879
  oSourceGroup.setLayout(JSON.stringify(oSourceLayout), oDeferred.resolve.bind(oDeferred, oTile), fnFailure);
1877
1880
  } else {
1878
- oPbs = sap.ushell.Container.getService("PageBuilding").getFactory().getPageBuildingService();
1879
-
1880
- // store bag contents for later storing them in the new CHIP instances
1881
- aBagIds = oTile.getBagIds();
1882
- aBagIds.forEach(function (sBagId) {
1883
- var oBagContent = {
1884
- texts: [],
1885
- properties: []
1886
- },
1887
- oBag = oTile.getBag(sBagId);
1888
- // ignore contents of CHIP bags
1889
- oBag.getOwnTextNames().forEach(function (sName) {
1890
- oBagContent.texts.push({ name: sName, value: oBag.getText(sName) });
1891
- });
1892
- oBag.getOwnPropertyNames().forEach(function (sName) {
1893
- oBagContent.properties.push({ name: sName, value: oBag.getProperty(sName) });
1894
- });
1895
- if (oBagContent.texts.length > 0 || oBagContent.properties.length > 0) {
1896
- oBagsContents.put(sBagId, oBagContent);
1897
- }
1898
- });
1899
-
1900
- // one $batch to add tile to target group, remove old tile, update layout of source group
1901
- oPbs.openBatchQueue();
1902
-
1903
- aTargetChipInstances = this.getGroupTiles(oTargetGroup);
1904
- oTargetGroup.addChipInstance(bIsWrapperOnly ? oTile.getChip() : oTile,
1905
- function (oNewChipInstance) {
1906
- var oCurrentBag, oBagContent;
1907
- aTargetChipInstances.splice(iTargetIndex, 0, oNewChipInstance);
1908
- // Note: additional requests after the $batch required, because new ID was previously unknown.
1909
- // So this requests could not be batched together
1881
+ sap.ushell.Container.getServiceAsync("PageBuilding")
1882
+ .then(function (PageBuildingService) {
1883
+ var oActualPageBuildingService = PageBuildingService.getFactory().getPageBuildingService();
1910
1884
 
1911
- // Add bags to CHIP instance in target group
1885
+ // store bag contents for later storing them in the new CHIP instances
1886
+ var aBagIds = oTile.getBagIds();
1912
1887
  aBagIds.forEach(function (sBagId) {
1913
- oBagContent = oBagsContents.get(sBagId);
1914
- if (oBagContent) {
1915
- oCurrentBag = oNewChipInstance.getBag(sBagId);
1916
- oBagContent.texts.forEach(function (oText) {
1917
- oCurrentBag.setText(oText.name, oText.value);
1918
- });
1919
- oBagContent.properties.forEach(function (oProperty) {
1920
- oCurrentBag.setProperty(oProperty.name, oProperty.value);
1921
- });
1922
- oCurrentBag.save(function () {
1923
- // don't wait for the save operation for performance reasons
1924
- }, function () {
1925
- jQuery.sap.log.error("Bag " + sBagId + ": could not be saved", null, sCOMPONENT);
1926
- });
1888
+ var oBagContent = {
1889
+ texts: [],
1890
+ properties: []
1891
+ },
1892
+ oBag = oTile.getBag(sBagId);
1893
+ // ignore contents of CHIP bags
1894
+ oBag.getOwnTextNames().forEach(function (sName) {
1895
+ oBagContent.texts.push({ name: sName, value: oBag.getText(sName) });
1896
+ });
1897
+ oBag.getOwnPropertyNames().forEach(function (sName) {
1898
+ oBagContent.properties.push({ name: sName, value: oBag.getProperty(sName) });
1899
+ });
1900
+ if (oBagContent.texts.length > 0 || oBagContent.properties.length > 0) {
1901
+ oBagsContents.put(sBagId, oBagContent);
1927
1902
  }
1928
1903
  });
1929
- // update order of tiles, which is stored in the layout property
1930
- addToLayout(oTargetLayout, oNewChipInstance.getId(), iTargetIndex, sNewTileType);
1931
- oTargetGroup.setLayout(JSON.stringify(oTargetLayout),
1932
- resolveMoveBetweenGroups.bind(this, oNewChipInstance), fnFailure);
1933
- }, fnFailure, oTile.isStub()); // do not load the tile if first load failed
1934
- oSourceGroup.removeChipInstance(oTile, resolveMoveBetweenGroups, fnFailure);
1935
- oSourceGroup.setLayout(JSON.stringify(oSourceLayout), /*fnSuccess*/undefined, fnFailure);
1936
1904
 
1937
- oPbs.submitBatchQueue(undefined, fnFailure);
1905
+ // one $batch to add tile to target group, remove old tile, update layout of source group
1906
+ oActualPageBuildingService.openBatchQueue();
1907
+
1908
+ var aTargetChipInstances = this.getGroupTiles(oTargetGroup);
1909
+
1910
+ oTargetGroup.addChipInstance(bIsWrapperOnly ? oTile.getChip() : oTile, function (oNewChipInstance) {
1911
+ var oCurrentBag, oBagContent;
1912
+ aTargetChipInstances.splice(iTargetIndex, 0, oNewChipInstance);
1913
+ // Note: additional requests after the $batch required, because new ID was previously unknown.
1914
+ // So this requests could not be batched together
1915
+
1916
+ // Add bags to CHIP instance in target group
1917
+ aBagIds.forEach(function (sBagId) {
1918
+ oBagContent = oBagsContents.get(sBagId);
1919
+ if (oBagContent) {
1920
+ oCurrentBag = oNewChipInstance.getBag(sBagId);
1921
+ oBagContent.texts.forEach(function (oText) {
1922
+ oCurrentBag.setText(oText.name, oText.value);
1923
+ });
1924
+ oBagContent.properties.forEach(function (oProperty) {
1925
+ oCurrentBag.setProperty(oProperty.name, oProperty.value);
1926
+ });
1927
+ oCurrentBag.save(function () {
1928
+ // don't wait for the save operation for performance reasons
1929
+ }, function () {
1930
+ Log.error("Bag " + sBagId + ": could not be saved", null, sCOMPONENT);
1931
+ });
1932
+ }
1933
+ });
1934
+ // update order of tiles which is stored in the layout property
1935
+ addToLayout(oTargetLayout, oNewChipInstance.getId(), iTargetIndex, sNewTileType);
1936
+ oTargetGroup.setLayout(JSON.stringify(oTargetLayout), resolveMoveBetweenGroups.bind(this, oNewChipInstance), fnFailure);
1937
+ }, fnFailure, oTile.isStub()); // do not load the tile if first load failed
1938
+
1939
+ oSourceGroup.removeChipInstance(oTile, resolveMoveBetweenGroups, fnFailure);
1940
+ oSourceGroup.setLayout(JSON.stringify(oSourceLayout), /*fnSuccess*/undefined, fnFailure);
1941
+
1942
+ oActualPageBuildingService.submitBatchQueue(undefined, fnFailure);
1943
+ }.bind(this));
1938
1944
  }
1945
+
1939
1946
  return oDeferred.promise();
1940
1947
  };
1941
1948
 
1942
1949
  /**
1943
1950
  * Returns the tile's unique identifier
1944
1951
  *
1945
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile
1952
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile
1946
1953
  * @returns {string} the id
1947
1954
  * @since 1.11.0
1948
1955
  */
@@ -1953,7 +1960,7 @@ sap.ui.define([
1953
1960
  /**
1954
1961
  * Returns the CHIP's type. This is even possible if the tile is not fully loaded so far.
1955
1962
  *
1956
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance the CHIP instance
1963
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the CHIP instance
1957
1964
  * @returns {string} the type. either <code>"tile"</code> or <code>"link"</code> or <code>"card"</code>.
1958
1965
  * @since 1.32.0
1959
1966
  */
@@ -1970,8 +1977,7 @@ sap.ui.define([
1970
1977
  return "link";
1971
1978
  }
1972
1979
  } catch (e) {
1973
- jQuery.sap.log.warning("Group " + oGroup.getId() + ": invalid layout: "
1974
- + oGroup.getLayout(), null, sCOMPONENT);
1980
+ Log.warning("Group " + oGroup.getId() + ": invalid layout: " + oGroup.getLayout(), null, sCOMPONENT);
1975
1981
  }
1976
1982
 
1977
1983
  // Cards can never be a stub at this point
@@ -1989,7 +1995,7 @@ sap.ui.define([
1989
1995
  /**
1990
1996
  * Returns a promise for the card's manifest. The promise is resolved synchronously.
1991
1997
  *
1992
- * @param {sap.ui2.srvc.ChipInstance} card the CHIP instance
1998
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} card the CHIP instance
1993
1999
  * @returns {object} The card's manifest
1994
2000
  * @private
1995
2001
  */
@@ -2006,14 +2012,14 @@ sap.ui.define([
2006
2012
 
2007
2013
  return oManifest;
2008
2014
  } catch (error) {
2009
- jQuery.sap.log.error("Manifest of card with id '" + card.getId() + "' could not be read. " + error.message);
2015
+ Log.error("Manifest of card with id '" + card.getId() + "' could not be read. " + error.message);
2010
2016
  }
2011
2017
  };
2012
2018
 
2013
2019
  /**
2014
2020
  * Returns the tile's title.
2015
2021
  *
2016
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile
2022
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile
2017
2023
  * @returns {string} the title, might be <code>undefined</code> if tile has not finished loading (see {@link #getTileView}).
2018
2024
  * @since 1.11.0
2019
2025
  */
@@ -2028,59 +2034,59 @@ sap.ui.define([
2028
2034
  * <br>
2029
2035
  * Note: this function became async since 1.23.0.
2030
2036
  *
2031
- * @param {sap.ui2.srvc.ChipInstance} oTile The tile's chip data
2037
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile The tile's chip data
2032
2038
  * @returns {object} jQuery.Promise object that is resolved to an instance of sap.m.GenericTile
2033
2039
  * @since 1.11.0
2034
2040
  */
2035
2041
  this.getTileView = function (oTile) {
2036
- var that = this,
2037
- oDeferred = new jQuery.Deferred(),
2038
- oTypesContract;
2042
+ var that = this;
2043
+ var oDeferred = new jQuery.Deferred();
2044
+ var oTypesContract;
2039
2045
 
2040
2046
  function doResolve () {
2041
- var sTileType,
2042
- oView;
2047
+ var sTileType;
2043
2048
 
2044
2049
  // if needed, notify the tile in which way it shall display itself
2045
2050
  oTypesContract = oTile.getContract("types");
2046
-
2047
2051
  if (oTypesContract) {
2048
2052
  // set the tile type before getting the view
2049
2053
  // note: the contract caches the new type until the handler is attached
2050
2054
  sTileType = that.getTileType(oTile);
2051
2055
  oTypesContract.setType(sTileType);
2052
2056
  }
2053
- oView = oTile.getImplementationAsSapui5();
2054
2057
 
2055
- if (sTileType === "link") {
2056
- var oViewModel,
2057
- oViewController,
2058
- sUrl,
2059
- oLinkTile;
2058
+ oTile.getImplementationAsSapui5Async().then(function (oView) {
2059
+ if (sTileType === "link") {
2060
+ var oViewModel,
2061
+ oViewController,
2062
+ sUrl,
2063
+ oLinkTile;
2060
2064
 
2061
- if (!oView.hasModel()) {
2062
- oView = oView.getComponentInstance().getRootControl();
2063
- }
2064
- oViewModel = oView.getModel();
2065
- oViewController = oView.getController();
2066
-
2067
- sUrl = oViewModel && oViewModel.getProperty ? oViewModel.getProperty("/nav/navigation_target_url") : undefined;
2068
- oLinkTile = new GenericTile({
2069
- mode: "{view>/mode}",
2070
- header: "{view>/config/display_title_text}",
2071
- subheader: "{view>/config/display_subtitle_text}",
2072
- sizeBehavior: "{view>/sizeBehavior}",
2073
- size: "Auto",
2074
- url: oViewController.formatters && oViewController.formatters.leanURL(sUrl),
2075
- press: [oViewController.onPress, oViewController]
2076
- });
2065
+ if (!oView.hasModel()) {
2066
+ oView = oView.getComponentInstance().getRootControl();
2067
+ }
2068
+ oViewModel = oView.getModel();
2069
+ oViewController = oView.getController();
2070
+
2071
+ sUrl = oViewModel && oViewModel.getProperty ? oViewModel.getProperty("/nav/navigation_target_url") : undefined;
2072
+ oLinkTile = new GenericTile({
2073
+ mode: "{view>/mode}",
2074
+ header: "{view>/config/display_title_text}",
2075
+ subheader: "{view>/config/display_subtitle_text}",
2076
+ sizeBehavior: "{view>/sizeBehavior}",
2077
+ size: "Auto",
2078
+ url: oViewController.formatters && oViewController.formatters.leanURL(sUrl),
2079
+ press: [oViewController.onPress, oViewController]
2080
+ });
2077
2081
 
2078
- oLinkTile.setModel(oViewModel, "view");
2079
- oDeferred.resolve(oLinkTile);
2080
- return;
2081
- }
2082
+ oLinkTile.setModel(oViewModel, "view");
2083
+ oDeferred.resolve(oLinkTile);
2084
+ return;
2085
+ }
2082
2086
 
2083
- oDeferred.resolve(oView);
2087
+ oDeferred.resolve(oView);
2088
+ })
2089
+ .catch(doReject);
2084
2090
  }
2085
2091
 
2086
2092
  function doReject (sMessage) {
@@ -2092,11 +2098,11 @@ sap.ui.define([
2092
2098
 
2093
2099
  if (!oTile.$loadingPromise) { // loading resolved or failed
2094
2100
  if (!oTile.isStub()) { // success
2095
- // call getImplementationAsSapui5 async for non-AppLaunchers and resolves.
2101
+ // call getImplementationAsSapui5Async async for non-AppLaunchers and resolves.
2096
2102
  // For AppLaunchers, there is an optimization (requested by RT) to call it sync
2097
2103
  // as the resources are already bundled and loaded at startup.
2098
- // As a result, the Home will initially at least display app launchers.
2099
- sap.ui2.srvc.call(doResolve, doReject, /*async*/!isAppLauncher(oTile));
2104
+ // Although they are called sync the view creation is still async
2105
+ Utils.callHandler(doResolve, doReject, /*async*/!isAppLauncher(oTile));
2100
2106
  } else { // failed
2101
2107
  doReject();
2102
2108
  }
@@ -2118,7 +2124,7 @@ sap.ui.define([
2118
2124
  /**
2119
2125
  * Returns the tile size in the format <code>1x1</code> or <code>1x2</code>.
2120
2126
  *
2121
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile
2127
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile
2122
2128
  * @returns {string} the tile size
2123
2129
  * @since 1.11.0
2124
2130
  */
@@ -2132,7 +2138,7 @@ sap.ui.define([
2132
2138
  * Refresh a tile with its latest data.
2133
2139
  * Only dynamic data should be updated, not the tile configuration itself.
2134
2140
  *
2135
- * @param {sap.ui2.srvc.ChipInstance} oTile the tile
2141
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile
2136
2142
  */
2137
2143
  this.refreshTile = function (oTile) {
2138
2144
  oTile.refresh();
@@ -2241,20 +2247,23 @@ sap.ui.define([
2241
2247
  * but with the advantage of improved responsiveness.
2242
2248
  *
2243
2249
  * @example
2244
- * sap.ushell.Container.getService("LaunchPage").getCatalogs()
2245
- * .fail(function (sErrorMessage) { // string
2246
- * // handle error situation
2247
- * })
2248
- * .progress(function (oCatalog) { // object
2249
- * // do s.th. with single catalog
2250
- * })
2251
- * .done(function (aCatalogs) { // object[]
2252
- * aCatalogs.forEach(function (oCatalog) {
2253
- * // do s.th. with single catalog
2250
+ * sap.ushell.Container.getServiceAsync("LaunchPage")
2251
+ * .then(function (LaunchPageService) {
2252
+ * LaunchPageService.getCatalogs()
2253
+ * .fail(function (sErrorMessage) { // string
2254
+ * // handle error situation
2255
+ * })
2256
+ * .progress(function (oCatalog) { // object
2257
+ * // do s.th. with single catalog
2258
+ * })
2259
+ * .done(function (aCatalogs) { // object[]
2260
+ * aCatalogs.forEach(function (oCatalog) {
2261
+ * // do s.th. with single catalog
2262
+ * });
2263
+ * });
2254
2264
  * });
2255
- * });
2256
2265
  *
2257
- * @returns {object} A <code>jQuery.Deferred</code> object's promise which informs about success or failure
2266
+ * @returns {jQuery.Promise} A jQuery Promise which informs about success or failure
2258
2267
  * of this asynchronous operation. In case of success, an array of black-box catalog objects is provided (which might be empty).
2259
2268
  * In case of failure, an error message is passed. Progress notifications are sent for each single catalog,
2260
2269
  * providing a single black-box catalog object each time.
@@ -2265,146 +2274,182 @@ sap.ui.define([
2265
2274
  oOldGetCatalogsDeferred = oGetCatalogsDeferred,
2266
2275
  bRefreshRequired = bCatalogsValid === false;
2267
2276
 
2268
- /**
2269
- * Resolves the promise to return the user's catalogs by refreshing the first remote catalog found, failing gracefully.
2270
- */
2271
- function refreshRemoteCatalogs () {
2272
- var iPendingRequests = 0, aWrappedCatalogs = wrapCatalogs();
2273
-
2274
- aWrappedCatalogs.forEach(function (oWrappedCatalog) {
2275
- var oCatalog = oWrappedCatalog.ui2catalog;
2276
- // TODO Improve performance: One invalid remote catalog causes refresh of all
2277
- if (oCatalog.isStub() || oCatalog.getType() === "H"
2278
- || oCatalog.getType() === "REMOTE") {
2279
- iPendingRequests += 1;
2280
- oCatalog.refresh(function () {
2281
- oWrappedCatalog.title = oCatalog.getTitle();
2282
- oWrappedCatalog.tiles = wrapAsChipInstances(oCatalog.getChips());
2283
- // TODO oRemoteCatalogWrapper.errorMessage once wrappers are cached
2277
+ // Note: bCatalogsValid can be undefined, false, true
2278
+ if (oOldGetCatalogsDeferred && !oOldGetCatalogsDeferred.$notified && !bRefreshRequired) {
2279
+ // re-use existing Deferred object; we cannot miss any notifications!
2280
+ oDeferred = oOldGetCatalogsDeferred;
2281
+ } else {
2282
+ oGetCatalogsDeferred = new jQuery.Deferred();
2283
+ oDeferred = oGetCatalogsDeferred;
2284
+ oDeferred
2285
+ .done(function () {
2286
+ if (oDeferred === oGetCatalogsDeferred) {
2287
+ // only the last call is allowed to change "global" variables
2288
+ bCatalogsValid = true;
2289
+ }
2290
+ })
2291
+ .always(function () {
2292
+ if (oDeferred === oGetCatalogsDeferred) {
2293
+ // only the last call is allowed to change "global" variables
2294
+ oGetCatalogsDeferred = null;
2295
+ }
2296
+ });
2284
2297
 
2285
- oDeferred.notify(oWrappedCatalog);
2298
+ if (oOldGetCatalogsDeferred) {
2299
+ if (bRefreshRequired) {
2300
+ bCatalogsValid = undefined; // not yet valid, refresh is in progress...
2301
+ }
2302
+ // if we cannot reuse the old Deferred object, wait until it is done;
2303
+ // after invalidation, wait until old operations are complete and then start a new roundtrip
2304
+ oOldGetCatalogsDeferred
2305
+ .always(function () {
2306
+ this._startLoading(oDeferred, bRefreshRequired);
2307
+ }.bind(this));
2308
+ } else {
2309
+ this._startLoading(oDeferred, bRefreshRequired);
2310
+ }
2311
+ }
2286
2312
 
2287
- iPendingRequests -= 1;
2288
- if (iPendingRequests <= 0) {
2289
- oDeferred.resolve(aWrappedCatalogs);
2290
- }
2291
- }, function (sMessage) {
2292
- // log errors, but do not fail
2293
- jQuery.sap.log.error("Failed to load catalog: " + sMessage,
2294
- oCatalog.toString(), sCOMPONENT);
2295
- oWrappedCatalog.errorMessage = sMessage || "Error"; // not undefined!
2313
+ return oDeferred.promise();
2314
+ };
2296
2315
 
2316
+ /**
2317
+ * Resolves the promise to return the user's catalogs by refreshing the first remote catalog found, failing gracefully.
2318
+ *
2319
+ * @param {jQuery.Deferred} oDeferred A jQuery.Deferred to be resolved, rejected or notified.
2320
+ * @returns {Promise<sap.ushell.services.PageBuilding>} A promise that is resolved once the PageBuilding service is retrieved.
2321
+ * @private
2322
+ */
2323
+ this._refreshRemoteCatalogs = function (oDeferred) {
2324
+ return sap.ushell.Container.getServiceAsync("PageBuilding")
2325
+ .then(function (PageBuildingService) {
2326
+ var iPendingRequests = 0;
2327
+ var oFactory = PageBuildingService.getFactory();
2328
+ var aWrappedCatalogs = wrapCatalogs(oFactory);
2329
+
2330
+ aWrappedCatalogs.forEach(function (oWrappedCatalog) {
2331
+ var oCatalog = oWrappedCatalog.ui2catalog;
2332
+ // TODO Improve performance: One invalid remote catalog causes refresh of all
2333
+ if (oCatalog.isStub() || oCatalog.getType() === "H" || oCatalog.getType() === "REMOTE") {
2334
+ iPendingRequests += 1;
2335
+
2336
+ oCatalog.refresh(function () {
2337
+ oWrappedCatalog.title = oCatalog.getTitle();
2338
+ oWrappedCatalog.tiles = wrapAsChipInstances(oFactory, oCatalog.getChips());
2339
+ // TODO oRemoteCatalogWrapper.errorMessage once wrappers are cached
2340
+
2341
+ oDeferred.notify(oWrappedCatalog);
2342
+
2343
+ iPendingRequests -= 1;
2344
+ if (iPendingRequests <= 0) {
2345
+ oDeferred.resolve(aWrappedCatalogs);
2346
+ }
2347
+ }, function (sMessage) {
2348
+ // log errors, but do not fail
2349
+ Log.error("Failed to load catalog: " + sMessage, oCatalog.toString(), sCOMPONENT);
2350
+ oWrappedCatalog.errorMessage = sMessage || "Error"; // not undefined!
2351
+
2352
+ oDeferred.notify(oWrappedCatalog);
2353
+
2354
+ iPendingRequests -= 1;
2355
+ if (iPendingRequests <= 0) {
2356
+ oDeferred.resolve(aWrappedCatalogs);
2357
+ }
2358
+ });
2359
+ } else {
2297
2360
  oDeferred.notify(oWrappedCatalog);
2361
+ oDeferred.$notified = true; // notifications have already been sent
2362
+ }
2363
+ });
2298
2364
 
2299
- iPendingRequests -= 1;
2300
- if (iPendingRequests <= 0) {
2301
- oDeferred.resolve(aWrappedCatalogs);
2302
- }
2303
- });
2304
- } else {
2305
- oDeferred.notify(oWrappedCatalog);
2306
- oDeferred.$notified = true; // notifications have already been sent
2365
+ if (iPendingRequests <= 0) {
2366
+ oDeferred.resolve(aWrappedCatalogs);
2307
2367
  }
2308
2368
  });
2369
+ };
2309
2370
 
2310
- if (iPendingRequests <= 0) {
2311
- oDeferred.resolve(aWrappedCatalogs);
2312
- }
2313
- }
2371
+ /**
2372
+ * Resolves the promise to return the user's catalogs...by just knowing them already.
2373
+ *
2374
+ * @param {jQuery.Deferred} oDeferred A jQuery.Deferred to be resolved, rejected or notified.
2375
+ * @returns {Promise<sap.ushell.services.PageBuilding>} A promise that is resolved once the PageBuilding service is retrieved.
2376
+ * @private
2377
+ */
2378
+ this._useKnownCatalogs = function (oDeferred) {
2379
+ return sap.ushell.Container.getServiceAsync("PageBuilding")
2380
+ .then(function (PageBuildingService) {
2381
+ var aWrappedCatalogs = wrapCatalogs(PageBuildingService.getFactory());
2314
2382
 
2315
- /**
2316
- * Resolves the promise to return the user's catalogs...by just knowing them already.
2317
- */
2318
- function useKnownCatalogs () {
2319
- var aWrappedCatalogs = wrapCatalogs();
2383
+ aWrappedCatalogs.forEach(function (oWrappedCatalog) {
2384
+ oDeferred.notify(oWrappedCatalog);
2385
+ });
2320
2386
 
2321
- aWrappedCatalogs.forEach(function (oWrappedCatalog) {
2322
- oDeferred.notify(oWrappedCatalog);
2387
+ oDeferred.resolve(aWrappedCatalogs);
2323
2388
  });
2389
+ };
2324
2390
 
2325
- oDeferred.resolve(aWrappedCatalogs);
2326
- }
2391
+ /**
2392
+ * Resolves the promise to return the user's catalogs either by loading them, refreshing them, or just knowing them already.
2393
+ *
2394
+ * @param {jQuery.Deferred} oDeferred A jQuery.Deferred to be resolved, rejected or notified.
2395
+ * @param {boolean} bRefreshRequired Whether or not the catalogs should be loaded again.
2396
+ * @private
2397
+ */
2398
+ this._doGetCatalogs = function (oDeferred, bRefreshRequired) {
2399
+ var oAllCatalogs = this._oCurrentPageSet.getDefaultPage().getAllCatalogs();
2327
2400
 
2328
- /**
2329
- * Resolves the promise to return the user's catalogs either by loading them, refreshing them, or just knowing them already.
2330
- *
2331
- * @param {boolean} bSynchronous whether this method is called synchronous to the original <code>this.getCatalogs()</code> call.
2332
- */
2333
- function doGetCatalogs (bSynchronous) {
2334
- var oAllCatalogs = that._oCurrentPageSet.getDefaultPage().getAllCatalogs();
2335
-
2336
- if (oAllCatalogs.isStub()) {
2337
- oAllCatalogs.load(refreshRemoteCatalogs, oDeferred.reject.bind(oDeferred),
2338
- "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG'" +
2339
- " or type eq 'REMOTE'",
2340
- /*bPartially*/true, /*sorting field*/ "title", /*useCache*/ true);
2341
- } else {
2342
- // Make sure that oDeferred is not notified _before_ progress handler has been registered!
2343
- // Delay calls in case we are still synchronous!
2344
- sap.ui2.srvc.call(
2345
- bRefreshRequired ? refreshRemoteCatalogs : useKnownCatalogs,
2346
- oDeferred.reject.bind(oDeferred),
2347
- bSynchronous // = bAsync
2348
- );
2349
- }
2401
+ if (oAllCatalogs.isStub()) {
2402
+ oAllCatalogs.load(function () {
2403
+ this._refreshRemoteCatalogs(oDeferred);
2404
+ }.bind(this), oDeferred.reject, "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", true, "title", true);
2405
+ } else if (bRefreshRequired) {
2406
+ this._refreshRemoteCatalogs(oDeferred);
2407
+ } else {
2408
+ this._useKnownCatalogs(oDeferred);
2350
2409
  }
2410
+ };
2351
2411
 
2352
- /**
2353
- * Starts loading of catalogs, after parallel calls and invalidation have been taken care of.
2354
- *
2355
- * @param {boolean} bSynchronous whether this method is called synchronous to the original <code>this.getCatalogs()</code> call.
2356
- */
2357
- function startLoading (bSynchronous) {
2358
- if (oTargetMappingServiceConfig && oTargetMappingServiceConfig.cacheId) {
2359
- // add cache buster token for the allCatalogs request.
2360
- // Reuse TargetMappings token as it is also invalidated in case the user's catalogs changed
2361
- var oCacheTokens = sap.ushell.Container.getService("PageBuilding").getFactory().getPageBuildingService()
2362
- .readAllCatalogs.cacheBusterTokens;
2363
- oCacheTokens.put(sDEFAULT_PAGE_ID, oTargetMappingServiceConfig.cacheId);
2364
- if (Config.last("/core/spaces/enabled")) {
2365
- oCacheTokens.put(PAGE_ID_WITHOUT_TM, oTargetMappingServiceConfig.cacheId);
2366
- }
2367
- }
2412
+ /**
2413
+ * Starts loading of catalogs, after parallel calls and invalidation have been taken care of.
2414
+ *
2415
+ * @param {jQuery.Deferred} oDeferred A jQuery.Deferred to be resolved, rejected or notified.
2416
+ * @param {boolean} bRefreshRequired Whether or not the catalogs should be loaded again.
2417
+ * @private
2418
+ */
2419
+ this._startLoading = function (oDeferred, bRefreshRequired) {
2420
+ var oPromise;
2368
2421
 
2369
- if (that._bPageSetFullyLoaded) {
2370
- doGetCatalogs(bSynchronous);
2371
- } else {
2372
- // call getGroups because it is the entry point of the LPA
2373
- that.getGroups().done(doGetCatalogs).fail(oDeferred.reject.bind(oDeferred));
2374
- }
2375
- }
2422
+ if (oTargetMappingServiceConfig && oTargetMappingServiceConfig.cacheId) {
2423
+ // add cache buster token for the allCatalogs request.
2424
+ // Reuse TargetMappings token as it is also invalidated in case the user's catalogs changed
2425
+ oPromise = sap.ushell.Container.getServiceAsync("PageBuilding")
2426
+ .then(function (PageBuildingService) {
2427
+ var oCacheTokens = PageBuildingService.getFactory().getPageBuildingService().readAllCatalogs.cacheBusterTokens;
2376
2428
 
2377
- // Note: bCatalogsValid can be undefined, false, true
2378
- if (oGetCatalogsDeferred && !oGetCatalogsDeferred.$notified && !bRefreshRequired) {
2379
- // re-use existing Deferred object; we cannot miss any notifications!
2380
- oDeferred = oGetCatalogsDeferred;
2381
- } else {
2382
- oDeferred = oGetCatalogsDeferred = new jQuery.Deferred();
2383
- oDeferred.done(function () {
2384
- if (oDeferred === oGetCatalogsDeferred) {
2385
- // only the last call is allowed to change "global" variables
2386
- bCatalogsValid = true;
2387
- }
2388
- }).always(function () {
2389
- if (oDeferred === oGetCatalogsDeferred) {
2390
- // only the last call is allowed to change "global" variables
2391
- oGetCatalogsDeferred = null;
2392
- }
2393
- });
2429
+ oCacheTokens.put(sDEFAULT_PAGE_ID, oTargetMappingServiceConfig.cacheId);
2394
2430
 
2395
- if (oOldGetCatalogsDeferred) {
2396
- if (bRefreshRequired) {
2397
- bCatalogsValid = undefined; // not yet valid, refresh is in progress...
2398
- }
2399
- // if we cannot reuse the old Deferred object, wait until it is done;
2400
- // after invalidation, wait until old operations are complete and then start a new roundtrip
2401
- oOldGetCatalogsDeferred.always(startLoading);
2402
- } else {
2403
- startLoading(true);
2404
- }
2431
+ if (Config.last("/core/spaces/enabled")) {
2432
+ oCacheTokens.put(PAGE_ID_WITHOUT_TM, oTargetMappingServiceConfig.cacheId);
2433
+ }
2434
+ })
2435
+ .catch(oDeferred.reject);
2436
+ } else {
2437
+ oPromise = Promise.resolve();
2405
2438
  }
2406
2439
 
2407
- return oDeferred.promise();
2440
+ oPromise
2441
+ .then(function () {
2442
+ if (that._bPageSetFullyLoaded) {
2443
+ this._doGetCatalogs(oDeferred, bRefreshRequired);
2444
+ } else {
2445
+ this.getGroups()
2446
+ .done(function () {
2447
+ this._doGetCatalogs(oDeferred, bRefreshRequired);
2448
+ }.bind(this))
2449
+ .fail(oDeferred.reject);
2450
+ }
2451
+ }.bind(this))
2452
+ .catch(oDeferred.reject);
2408
2453
  };
2409
2454
 
2410
2455
  /**
@@ -2475,7 +2520,7 @@ sap.ui.define([
2475
2520
 
2476
2521
  /**
2477
2522
  * Returns the catalog's tiles. This is an asynchronous function using a jQuery.Promise.
2478
- * In case of success its <code>done</code> function is called and gets the tiles as array of <code>sap.ui2.srvc.Chip</code>.
2523
+ * In case of success its <code>done</code> function is called and gets the tiles as array of <code>sap.ushell_abap.pbServices.ui2.Chip</code>.
2479
2524
  * In case of error the promise's <code>fail</code> function is called.
2480
2525
  *
2481
2526
  * @param {object} oConfigCatalog the catalog
@@ -2498,8 +2543,7 @@ sap.ui.define([
2498
2543
 
2499
2544
  function onFailure (oCatalogTile, sMessage) {
2500
2545
  // log errors, but do not fail
2501
- jQuery.sap.log.error("Failed to load catalog tile: " + sMessage,
2502
- oCatalogTile.toString(), sCOMPONENT);
2546
+ Log.error("Failed to load catalog tile: " + sMessage, oCatalogTile.toString(), sCOMPONENT);
2503
2547
  onLoaded();
2504
2548
  }
2505
2549
 
@@ -2587,8 +2631,7 @@ sap.ui.define([
2587
2631
  // TODO cache the view for later re-use - might not work cause view can get destroyed and is not reusable!
2588
2632
  // Needs further investigation - don't implement cache for now
2589
2633
  if (oCatalogTile.isStub()) {
2590
- jQuery.sap.log.warning("CHIP (instance) is just a stub!", oCatalogTile.toString(true),
2591
- sCOMPONENT);
2634
+ Log.warning("CHIP (instance) is just a stub!", oCatalogTile.toString(true), sCOMPONENT);
2592
2635
  return new sap.ushell.ui.tile.StaticTile({ // TODO remove as soon as RT has a own // TODO: pending dependency migration
2593
2636
  icon: "sap-icon://hide",
2594
2637
  info: "",
@@ -2616,6 +2659,83 @@ sap.ui.define([
2616
2659
  return getImplementationAsSapui5(oCatalogTile, sTitle, "Cannot get catalog tile view as SAPUI5");
2617
2660
  };
2618
2661
 
2662
+ /**
2663
+ * A function which returns UI5 view / control of the catalog tile
2664
+ *
2665
+ * @param {sap.ui2.ChipInstance} oCatalogTile the catalog tile
2666
+ * @param {boolean} bPreview return the tile in preview mode, default is true
2667
+ * @returns {jQuery.Promise<sap.ui.core.Control>} the UI5 representation of the catalog tile
2668
+ * @since 1.97.0
2669
+ * @private
2670
+ */
2671
+ this.getCatalogTileViewControl = function (oCatalogTile, bPreview) {
2672
+ var oDeferred = new jQuery.Deferred();
2673
+ bPreview = typeof bPreview !== "undefined" ? bPreview : true;
2674
+ var sTitle = this.getCatalogTileTitle(oCatalogTile);
2675
+
2676
+ if (oCatalogTile.isStub()) {
2677
+ Log.warning("CHIP (instance) is just a stub!", oCatalogTile.toString(true), sCOMPONENT);
2678
+ oDeferred.resolve(this._createErrorTile(sTitle, "CHIP was just a stub!"));
2679
+ return oDeferred.promise();
2680
+ }
2681
+
2682
+ if (bPreview) {
2683
+ var oPreviewContract = oCatalogTile.getContract("preview");
2684
+ if (oPreviewContract) {
2685
+ oPreviewContract.setEnabled(true);
2686
+ } else {
2687
+ oDeferred.resolve(this._createPreviewTile(sTitle));
2688
+ return oDeferred.promise();
2689
+ }
2690
+ }
2691
+
2692
+ oCatalogTile.getImplementationAsSapui5Async()
2693
+ .catch(function (oError) {
2694
+ Log.error("Cannot get catalog tile view as SAPUI5: " + (oError.message || oError), oError.stack, sCOMPONENT);
2695
+ return this._createErrorTile(sTitle, (oError.message || oError));
2696
+ }.bind(this))
2697
+ .then(oDeferred.resolve);
2698
+
2699
+ return oDeferred.promise();
2700
+ };
2701
+
2702
+ /**
2703
+ * Returns an error tile
2704
+ * @param {string} sTitle The tile title
2705
+ * @param {string} [sMessage] A message which gets added to the tile as subtitle
2706
+ * @returns {sap.m.GenericTile} The error tile
2707
+ *
2708
+ * @private
2709
+ * @since 1.97.0
2710
+ */
2711
+ this._createErrorTile = function (sTitle, sMessage) {
2712
+ var oErrorTile = new GenericTile({
2713
+ state: LoadState.Failed,
2714
+ header: sTitle,
2715
+ subheader: sMessage || ""
2716
+ }).addStyleClass("sapUshellTileError");
2717
+ return oErrorTile;
2718
+ };
2719
+
2720
+ /**
2721
+ * Returns a Tile for preview purposes
2722
+ * @param {string} sTitle The title
2723
+ * @returns {sap.ushell.ui.tile.StaticTile} a Preview Tile
2724
+ *
2725
+ * @private
2726
+ * @since 1.97.0
2727
+ */
2728
+ this._createPreviewTile = function (sTitle) {
2729
+ // TODO remove as soon as RT has an own // TODO: pending dependency migration
2730
+ return new StaticTile({
2731
+ title: sTitle,
2732
+ subtitle: "",
2733
+ info: "",
2734
+ infoState: "Neutral",
2735
+ icon: "sap-icon://folder-full"
2736
+ });
2737
+ };
2738
+
2619
2739
  /**
2620
2740
  * Get navigation target URL for a catalog tile.
2621
2741
  *
@@ -2686,7 +2806,7 @@ sap.ui.define([
2686
2806
  sCatalogDescription = oCatalogTile.getChip().getDescription();
2687
2807
 
2688
2808
  function addKeywords (oKeywordsSet, aKeywordsList) {
2689
- if (sap.ui2.srvc.isArray(aKeywordsList)) {
2809
+ if (Utils.isArray(aKeywordsList)) {
2690
2810
  aKeywordsList.forEach(function (sKeyword) {
2691
2811
  if (oKeywordsSet.hasOwnProperty(sKeyword)) {
2692
2812
  return;
@@ -2700,7 +2820,7 @@ sap.ui.define([
2700
2820
  function getKeywordsDefinedInCatalogTileData (oCatalogTile) {
2701
2821
  var sKeywordsText = LaunchPageAdapter.prototype._getBagText(oCatalogTile, "tileProperties", "display_search_keywords");
2702
2822
 
2703
- if (!sap.ui2.srvc.isString(sKeywordsText) || sKeywordsText === "") {
2823
+ if (!Utils.isString(sKeywordsText) || sKeywordsText === "") {
2704
2824
  return [];
2705
2825
  }
2706
2826
 
@@ -2824,7 +2944,7 @@ sap.ui.define([
2824
2944
  oConfiguration.service_refresh_interval = oParameters.serviceRefreshInterval || 0;
2825
2945
  oConfiguration.service_url = oParameters.serviceUrl;
2826
2946
  }
2827
- if (oGroup && !(oGroup instanceof sap.ui2.srvc.Page)) {
2947
+ if (oGroup && !(oGroup instanceof Page)) {
2828
2948
  // same behavior like addCatalogTileToGroup of the Bookmark service:
2829
2949
  // if the group is unknown don't use the default group but reject.
2830
2950
  oDeferred.reject("The given object is not a group");
@@ -2885,7 +3005,7 @@ sap.ui.define([
2885
3005
  var oChipConfig = oBookmarkConfig.vizConfig["sap.flp"].chipConfig;
2886
3006
  var oDeferred = new jQuery.Deferred();
2887
3007
 
2888
- if (oGroup && !(oGroup instanceof sap.ui2.srvc.Page)) {
3008
+ if (oGroup && !(oGroup instanceof Page)) {
2889
3009
  // same behavior like addCatalogTileToGroup of the Bookmark service:
2890
3010
  // if the group is unknown don't use the default group but reject.
2891
3011
  oDeferred.reject("The given object is not a group");
@@ -3015,7 +3135,7 @@ sap.ui.define([
3015
3135
  resolve();
3016
3136
  } catch (oError) {
3017
3137
  var sMessage = "Chip configuration check failed: " + oError.toString();
3018
- jQuery.sap.log.error(sMessage, oChipInstance.getId(), sCOMPONENT);
3138
+ Log.error(sMessage, oChipInstance.getId(), sCOMPONENT);
3019
3139
  reject(sMessage);
3020
3140
  }
3021
3141
  }.bind(this));
@@ -3104,7 +3224,7 @@ sap.ui.define([
3104
3224
  /**
3105
3225
  * Tells whether the given CHIP instance represents a bookmark matching the given identifier.
3106
3226
  *
3107
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
3227
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
3108
3228
  * @param {string | object} vIdentifier the url as string or an identifier object
3109
3229
  * @returns {boolean}
3110
3230
  * @see #addBookmark
@@ -3130,7 +3250,7 @@ sap.ui.define([
3130
3250
  * This is a potentially asynchronous operation in case the user's groups have not yet been loaded completely!
3131
3251
  *
3132
3252
  * @param {string} sUrl The URL of the bookmarks to be visited, exactly as specified to {@link #addBookmark}.
3133
- * @param {function(sap.ui2.srvc.ChipInstance)} [fnVisitor] The asynchronous visitor function returning a
3253
+ * @param {function(sap.ushell_abap.pbServices.ui2.ChipInstance)} [fnVisitor] The asynchronous visitor function returning a
3134
3254
  * <code>jQuery.Deferred</code> object's promise.
3135
3255
  * In case of success, no details are expected. In case of failure, an error message is passed.
3136
3256
  * @returns {object} A <code>jQuery.Deferred</code> object's promise which informs about success or failure
@@ -3533,7 +3653,7 @@ sap.ui.define([
3533
3653
  .then(function (oPageBuildingService) {
3534
3654
  var oUI2PageBuildingService = oPageBuildingService.getFactory().getPageBuildingService();
3535
3655
  return new Promise(function (resolve, reject) {
3536
- // There is no good way to access the raw data as it is normalized and well hidden in closures in sap.ui2.srvc
3656
+ // There is no good way to access the raw data as it is normalized and well hidden in closures in sap.ushell_abap.pbServices.ui2
3537
3657
  // Therefore we trigger the allCatalogs request again which reads from the cache of the OData wrapper
3538
3658
  oUI2PageBuildingService.readAllCatalogs(PAGE_ID_WITHOUT_TM, resolve, reject,
3539
3659
  "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", "title", true);