@sapui5/sap.ushell_abap 1.98.0 → 1.99.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 (95) hide show
  1. package/package.json +1 -1
  2. package/src/main/js/sap/ushell_abap/.library +2 -2
  3. package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +1 -1
  4. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +2 -2
  5. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +2 -2
  6. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +2 -2
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +2 -2
  8. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +2 -2
  9. package/src/main/js/sap/ushell_abap/adapters/abap/MenuAdapter.js +1 -1
  10. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +2 -2
  11. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +2 -2
  12. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +2 -2
  13. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +2 -2
  14. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +2 -2
  15. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +2 -2
  16. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +2 -2
  17. package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +1 -1
  18. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +2 -2
  19. package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +1 -1
  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-loader.js +3 -2
  22. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def.js +1 -1
  23. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +1 -1
  24. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +2 -2
  25. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.constants.js +1 -1
  26. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.get.server.config.Urls.js +1 -1
  27. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.js +1 -1
  28. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.load.launchpad.js +2 -17
  29. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +1 -1
  30. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.server.config.js +1 -1
  31. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +1 -1
  32. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.theme.handler.js +1 -1
  33. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.ui5.boot.handler.js +1 -1
  34. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.validate.Url.js +1 -1
  35. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.xhr.handler.js +1 -1
  36. package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +3 -5
  37. package/src/main/js/sap/ushell_abap/library.js +3 -3
  38. package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +1 -1
  39. package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +1 -6
  40. package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +1 -1
  41. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +115 -15
  42. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +1 -1
  43. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +14 -6
  44. package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +1 -1
  45. package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +1 -1
  46. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +1 -1
  47. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1 -1
  48. package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +1 -8
  49. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +1 -1
  50. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +1 -1
  51. package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +1 -1
  52. package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +1 -8
  53. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +1 -1
  54. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/bag.js +1 -1
  55. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +1 -1
  56. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +1 -1
  57. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/fullscreen.js +1 -1
  58. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/preview.js +1 -1
  59. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/refresh.js +1 -1
  60. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/search.js +1 -1
  61. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/types.js +1 -1
  62. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/url.js +1 -1
  63. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +1 -1
  64. package/src/main/js/sap/ushell_abap/support/plugins/app-infra/AppInfraOnSapNetWeaverSupportPlugin.js +1 -1
  65. package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +1 -1
  66. package/ui5.yaml +3 -17
  67. package/src/main/js/sap/ui2/srvc/ODataService.js +0 -267
  68. package/src/main/js/sap/ui2/srvc/ODataWrapper.js +0 -1283
  69. package/src/main/js/sap/ui2/srvc/PageBuildingService.js +0 -1508
  70. package/src/main/js/sap/ui2/srvc/RemoteCatalogService.js +0 -49
  71. package/src/main/js/sap/ui2/srvc/allcatalogs.js +0 -197
  72. package/src/main/js/sap/ui2/srvc/bag.js +0 -711
  73. package/src/main/js/sap/ui2/srvc/catalog.js +0 -946
  74. package/src/main/js/sap/ui2/srvc/chip.js +0 -1035
  75. package/src/main/js/sap/ui2/srvc/chipdefinition.js +0 -228
  76. package/src/main/js/sap/ui2/srvc/chipinstance.js +0 -944
  77. package/src/main/js/sap/ui2/srvc/contracts/actions.js +0 -239
  78. package/src/main/js/sap/ui2/srvc/contracts/bag.js +0 -145
  79. package/src/main/js/sap/ui2/srvc/contracts/configuration.js +0 -161
  80. package/src/main/js/sap/ui2/srvc/contracts/configurationUi.js +0 -326
  81. package/src/main/js/sap/ui2/srvc/contracts/fullscreen.js +0 -69
  82. package/src/main/js/sap/ui2/srvc/contracts/navigation.js +0 -48
  83. package/src/main/js/sap/ui2/srvc/contracts/preview.js +0 -289
  84. package/src/main/js/sap/ui2/srvc/contracts/refresh.js +0 -42
  85. package/src/main/js/sap/ui2/srvc/contracts/search.js +0 -109
  86. package/src/main/js/sap/ui2/srvc/contracts/searchProvider.js +0 -46
  87. package/src/main/js/sap/ui2/srvc/contracts/types.js +0 -9
  88. package/src/main/js/sap/ui2/srvc/contracts/url.js +0 -104
  89. package/src/main/js/sap/ui2/srvc/contracts/visible.js +0 -122
  90. package/src/main/js/sap/ui2/srvc/error.js +0 -54
  91. package/src/main/js/sap/ui2/srvc/factory.js +0 -656
  92. package/src/main/js/sap/ui2/srvc/page.js +0 -934
  93. package/src/main/js/sap/ui2/srvc/pageset.js +0 -466
  94. package/src/main/js/sap/ui2/srvc/utils.js +0 -923
  95. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/navigation.js +0 -50
@@ -1,1035 +0,0 @@
1
- // Copyright (c) 2009-2020 SAP SE, All Rights Reserved
2
-
3
- /**
4
- * @fileOverview The <code>sap.ui2.srvc.Chip</code> object with related functions.
5
- */
6
-
7
- this.sap = this.sap || {};
8
-
9
- (function () {
10
- "use strict";
11
-
12
- sap.ui2 = sap.ui2 || {};
13
- sap.ui2.srvc = sap.ui2.srvc || {};
14
-
15
- /*
16
- * A map of all registered contracts by name.
17
- * @see sap.ui2.srvc.Chip.addContract
18
- */
19
- var mContractsByName = {},
20
- fnRequire = String; // NOP (String exists and is free of side-effects)
21
-
22
- // Only declare the module if jQuery.sap exists. Otherwise we do not even try to require assuming
23
- // that the script has been loaded manually (before SAPUI5).
24
- // Load time branching pattern
25
- if (typeof jQuery === "function" && jQuery.sap) {
26
- jQuery.sap.declare("sap.ui2.srvc.chip");
27
- // avoid fnRequire = jQuery.sap.require as require cannot be spied on afterwards
28
- fnRequire = function () {
29
- jQuery.sap.require.apply(this, arguments);
30
- };
31
- }
32
-
33
- // We cannot require utils (module path possibly unset), but we urgently need testPublishAt
34
- sap.ui2.srvc.testPublishAt = sap.ui2.srvc.testPublishAt || function () { /*NOP*/
35
- };
36
-
37
- // "private" methods (static) without need to access properties -------------
38
-
39
- /**
40
- * Returns the initializer function for the given contract name or <code>null</code> if not found.
41
- *
42
- * @param {string} sName
43
- * name of the contract to be return
44
- * @returns {function}
45
- * function to be called to initialize the contract or null if none was found
46
- */
47
- function getContractInitializer (sName) {
48
- return Object.prototype.hasOwnProperty.call(mContractsByName, sName) ?
49
- mContractsByName[sName] : null;
50
- }
51
-
52
- // "public class" -----------------------------------------------------------
53
-
54
- /**
55
- * Constructs a new representation (wrapper) of the CHIP with the given CHIP data as loaded from
56
- * the page building service.
57
- * <p>
58
- * Initially a stub is created which can load its CHIP definition XML later on in an asynchronous
59
- * fashion.
60
- * <p>
61
- * CHIPs are currently read-only and cannot be updated through the page building service.
62
- * (see {@link sap.ui2.srvc.PageBuildingService})
63
- *
64
- * @param {object} oAlterEgo
65
- * the CHIP data as loaded via page building service
66
- * @param {sap.ui2.srvc.Factory} oFactory
67
- * the factory
68
- *
69
- * @class
70
- * @since 1.2.0
71
- */
72
- sap.ui2.srvc.Chip = function (oAlterEgo, oFactory) {
73
- var that = this,
74
- oBags, // {sap.ui2.srvc.Map<string,sap.ui2.srvc.Bag>}
75
- /*
76
- * {string}
77
- * The URL of the CHIP definition XML (as base for the referenced files)
78
- */
79
- sChipUrl,
80
- /*
81
- * {map<string,string>}
82
- * The configuration as read from the CHIP spec in the page building service.
83
- * The values are already validated and typed correctly. (Must be initialized
84
- * after the CHIP definition XML has been parsed.)
85
- */
86
- oConfiguration,
87
- /*
88
- * {sap.ui2.srvc.ChipDefinition}
89
- * The data from the CHIP definition XML. If undefined, the CHIP is still a stub.
90
- */
91
- oDefinition,
92
- /*
93
- * {string}
94
- * Cached error message in case loading fails.
95
- */
96
- sErrorMessage,
97
- /*
98
- * {object}
99
- * Cached error information in case loading fails.
100
- */
101
- oErrorInformation,
102
- /*
103
- * List of all success and failure handlers passed to a <code>load()</code> call while this
104
- * CHIP is already loading its XML; these will all be called after initialization has
105
- * finished. This list is non-<code>null</code> iff. this CHIP is currently loading its XML.
106
- *
107
- * @see #load()
108
- */
109
- aLoadHandlers,
110
- /*
111
- * The remote catalog if there is one.
112
- */
113
- oRemoteCatalog,
114
- /*
115
- * whether the chip expects to be updated from a (remote) catalog
116
- */
117
- bWaitingForUpdateViaCatalog;
118
-
119
- // BEWARE: constructor code below!
120
-
121
- // "private" or hidden methods --------------------------------------------
122
-
123
- /**
124
- * Makes sure this CHIP is not just a stub.
125
- *
126
- * @private
127
- */
128
- function checkStub () {
129
- if (!oDefinition) {
130
- throw new sap.ui2.srvc.Error(that + ": CHIP is just a stub", "sap.ui2.srvc.Chip");
131
- }
132
- }
133
-
134
- /**
135
- * Initialize the bags from raw CHIP bags array.
136
- *
137
- * @param {object[]} aRawChipBags
138
- * Array of raw CHIP bags
139
- *
140
- * @private
141
- */
142
- function initBags (aRawChipBags) {
143
- var i;
144
-
145
- oBags = new sap.ui2.srvc.Map();
146
- if (!aRawChipBags) {
147
- return;
148
- }
149
- for (i = 0; i < aRawChipBags.length; i += 1) {
150
- // for each bag instance: create wrapper
151
- fnRequire("sap.ui2.srvc.bag");
152
- oBags.put(aRawChipBags[i].id,
153
- new sap.ui2.srvc.Bag(oFactory, aRawChipBags[i]));
154
- }
155
- }
156
-
157
- /**
158
- * Initialize some details (which need only be computed once) in the given SAPUI5
159
- * implementation by decorating it with additional properties starting with "$".
160
- *
161
- * @param {object} oImplementation
162
- * UI5 inplementation
163
- * @private
164
- */
165
- function initSAPUI5 (oImplementation) {
166
- /*jslint regexp: true */
167
- var sBasePath = oImplementation.basePath,
168
- iLastSlash,
169
- aMatches,
170
- sNamespace,
171
- sViewName = oImplementation.viewName;
172
-
173
- if (oImplementation.componentName) {
174
- oImplementation.$Namespace = oImplementation.componentName;
175
- } else {
176
- // (namespace)/(viewName).view.(viewType)
177
-
178
- // eslint-disable-next-line no-useless-escape
179
- aMatches = /^(?:([^\/]+)\/)?(.*)\.view\.(.*)$/.exec(sViewName);
180
- if (!aMatches) {
181
- throw new sap.ui2.srvc.Error(that + ": Illegal view name: " + sViewName,
182
- "sap.ui2.srvc.Chip");
183
- }
184
-
185
- // determine namespace, view name, and view type
186
- sNamespace = aMatches[1];
187
- sViewName = aMatches[2];
188
- oImplementation.$ViewType = aMatches[3].toUpperCase(); // @see sap.ui.core.mvc.ViewType
189
- if (sNamespace) {
190
- // prefix view name with namespace
191
- sViewName = sNamespace + "." + sViewName;
192
- } else {
193
- // derive namespace from view name's "package"
194
- iLastSlash = sViewName.lastIndexOf(".");
195
- if (iLastSlash < 1) {
196
- throw new sap.ui2.srvc.Error(that + ": Missing namespace: " + sViewName,
197
- "sap.ui2.srvc.Chip");
198
- }
199
- sNamespace = sViewName.substring(0, iLastSlash);
200
- }
201
- oImplementation.$Namespace = sNamespace;
202
- oImplementation.$ViewName = sViewName;
203
- }
204
-
205
- // if virtualNameSpace is set, carry with oImplementation
206
- var bVirtualNamespace = oImplementation.virtualNamespace;
207
- if (bVirtualNamespace) {
208
- oImplementation.$VirtualNamespace = bVirtualNamespace;
209
- }
210
-
211
- // URL prefix to load module for given namespace relative to CHIP definition XML
212
- oImplementation.$UrlPrefix = oImplementation.$Namespace.replace(/\./g, "/");
213
- if (sBasePath !== ".") {
214
- sBasePath = sBasePath.replace(/\/?$/, "/"); // ensure it ends with a slash
215
- oImplementation.$UrlPrefix = sBasePath + oImplementation.$UrlPrefix;
216
- }
217
- oImplementation.$UrlPrefix = that.toAbsoluteUrl(oImplementation.$UrlPrefix);
218
- }
219
-
220
- /**
221
- * Initializes the configuration, considers defaults set in the CHIP definition XML.
222
- *
223
- * @private
224
- */
225
- function initConfiguration () {
226
- oConfiguration = {};
227
- if (oDefinition.contracts.configuration && oDefinition.contracts.configuration.parameters) {
228
- // clone the parameters so that we can merge in oAlterEgo.configuration
229
- oConfiguration = JSON.parse(JSON.stringify(oDefinition.contracts.configuration.parameters));
230
- }
231
- that.updateConfiguration(oConfiguration, oAlterEgo.configuration);
232
- }
233
-
234
- /**
235
- * Initialize this CHIP using the given CHIP definition.
236
- *
237
- * @param {sap.ui2.srvc.ChipDefinition} oNewDefinition
238
- * the CHIP definition
239
- *
240
- * @private
241
- */
242
- function initialize (oNewDefinition) {
243
- var i1, n1;
244
-
245
- if (oDefinition) {
246
- throw new sap.ui2.srvc.Error(that + ": cannot initialize twice", null, "sap.ui2.srvc.Chip");
247
- }
248
- oDefinition = oNewDefinition;
249
- oDefinition.contracts = oDefinition.contracts || {};
250
-
251
- if (!oDefinition.implementation || !oDefinition.implementation.sapui5) {
252
- throw new sap.ui2.srvc.Error(that + ": Missing SAPUI5 implementation",
253
- "sap.ui2.srvc.Chip");
254
- }
255
- initSAPUI5(oDefinition.implementation.sapui5);
256
-
257
- initConfiguration();
258
-
259
- jQuery.sap.log.debug("Initialized: " + that, null, "sap.ui2.srvc.Chip");
260
- if (aLoadHandlers) {
261
- // initialization has finished, call all waiting success handlers
262
- for (i1 = 0, n1 = aLoadHandlers.length; i1 < n1; i1 += 2) {
263
- aLoadHandlers[i1]();
264
- }
265
- aLoadHandlers = null;
266
- }
267
- }
268
-
269
- /**
270
- * Updates property bags with given raw data.
271
- *
272
- * @param {object[]} aRawChipBags
273
- * Array of raw CHIP bags
274
- *
275
- * @private
276
- */
277
- sap.ui2.srvc.testPublishAt(that);
278
- function updateBags (aRawChipBags) {
279
- var i, sKey, aExistingKeys = oBags.keys();
280
- for (i = 0; i < aRawChipBags.length; i += 1) {
281
- sKey = aRawChipBags[i].id;
282
- if (oBags.containsKey(sKey)) {
283
- oBags.get(sKey).update(aRawChipBags[i]);
284
- aExistingKeys.splice(aExistingKeys.indexOf(sKey), 1);
285
- } else {
286
- oBags.put(sKey, new sap.ui2.srvc.Bag(oFactory, aRawChipBags[i]));
287
- }
288
- }
289
- for (i = 0; i < aExistingKeys.length; i += 1) {
290
- oBags.remove(aExistingKeys[i]);
291
- }
292
- }
293
-
294
- // "public" methods -------------------------------------------------------
295
-
296
- /**
297
- * Creates the API object for a CHIP instance. Can only be called if the CHIP is not a stub
298
- * anymore.
299
- *
300
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
301
- * the CHIP instance
302
- * @param {sap.ui2.srvc.Map} [oContractsByName]
303
- * CHIP instance's map from contract name to contract interface for page builder
304
- * (since 1.11.0)
305
- * @return {object}
306
- * the API object
307
- * @since 1.2.0
308
- *
309
- * @see #isStub()
310
- * @see sap.ui2.srvc.ChipInstance#getContract()
311
- */
312
- this.createApi = function (oChipInstance, oContractsByName) {
313
- var oApi = {},
314
- oContract,
315
- fnInitializer,
316
- sName,
317
- mRequestedContracts;
318
-
319
- checkStub();
320
- mRequestedContracts = oDefinition.contracts;
321
- if (mRequestedContracts) {
322
- for (sName in mRequestedContracts) {
323
- if (Object.prototype.hasOwnProperty.call(mRequestedContracts, sName)) {
324
- fnInitializer = getContractInitializer(sName);
325
- if (!fnInitializer) {
326
- throw new sap.ui2.srvc.Error(this + ": Contract '" + sName + "' is not supported",
327
- "sap.ui2.srvc.Chip");
328
- }
329
- oApi[sName] = {};
330
- oContract = fnInitializer.call(oApi[sName], oChipInstance);
331
- if (oContractsByName) {
332
- oContractsByName.put(sName, oContract);
333
- }
334
- }
335
- }
336
- }
337
- return oApi;
338
- };
339
-
340
- /**
341
- * Returns the list of available types of visualization. The types are always lower case.
342
- *
343
- * @returns {string[]}
344
- * the available tile types in lower case, e.g. <code>["tile", "link"]</code>
345
- * @private
346
- * @see chip.types.getAvailableTypes
347
- */
348
- this.getAvailableTypes = function () {
349
- var sTypes;
350
- checkStub();
351
- if (oDefinition.contracts.types &&
352
- oDefinition.contracts.types.parameters &&
353
- typeof oDefinition.contracts.types.parameters.supportedTypes === "string" &&
354
- oDefinition.contracts.types.parameters.supportedTypes !== "") {
355
- // convert all supported types to lower case to make comparison easier
356
- sTypes = oDefinition.contracts.types.parameters.supportedTypes.toLowerCase();
357
- // types are comma separated
358
- return sTypes.split(",");
359
- }
360
- return [];
361
- };
362
-
363
- /**
364
- * Returns the default type. The type is always lower case.
365
- * If no default type is specified "tile" is used if it is supported.
366
- * If no default type is specified and "tile" is not supported. The first supported one will be used
367
- *
368
- * @returns {string}
369
- * the default tile type in lower case, e.g. <code>"tile"</code>
370
- * @private
371
- *
372
- * @since 1.86.0
373
- */
374
- this.getDefaultType = function () {
375
- //If you refactor this out make sure to call 'checkStub' as it is now called in 'getAvailableTypes'
376
- var aSupportedTypes = this.getAvailableTypes();
377
-
378
- if (oDefinition.contracts.types &&
379
- oDefinition.contracts.types.parameters &&
380
- typeof oDefinition.contracts.types.parameters.defaultType === "string" &&
381
- oDefinition.contracts.types.parameters.defaultType !== "") {
382
- var sDefaultType = oDefinition.contracts.types.parameters.defaultType;
383
-
384
- // the supported types are returned in lower case
385
- sDefaultType = sDefaultType.toLowerCase();
386
- if (aSupportedTypes.indexOf(sDefaultType) > -1) {
387
- return sDefaultType;
388
- }
389
- throw new Error("The chip has the default type: " + sDefaultType + " which is not supported");
390
- }
391
- if (aSupportedTypes.indexOf("tile") > -1) {
392
- return "tile";
393
- }
394
- if (aSupportedTypes.length > 0) {
395
- return aSupportedTypes[0];
396
- }
397
- return "";
398
- };
399
-
400
- /**
401
- * Returns the property bag with given ID attached to this CHIP.
402
- * <p>
403
- * If there is no bag with that ID <code>undefined</code> is returned.
404
- *
405
- * @param {string} sBagId
406
- * the bag ID
407
- *
408
- * @returns {sap.ui2.srvc.Bag}
409
- * the CHIP's bag for given ID
410
- * @private
411
- */
412
- this.getBag = function (sBagId) {
413
- if (!sBagId) {
414
- throw new sap.ui2.srvc.Error("Missing bag ID", "sap.ui2.srvc.Chip");
415
- }
416
-
417
- return oBags.get(sBagId);
418
- };
419
-
420
- /**
421
- * Returns an array of bag IDs attached to this CHIP.
422
- *
423
- * @returns {string[]}
424
- * array of bag IDs
425
- * @private
426
- */
427
- this.getBagIds = function () {
428
- return oBags.keys();
429
- };
430
-
431
- /**
432
- * Returns the id of this CHIP's base CHIP as defined by the page building service. Returns
433
- * the empty String if the CHIP does not have a base CHIP.
434
- *
435
- * @returns {string}
436
- * the id of this CHIP's base CHIP. Empty string in case the CHIP has no base CHIP.
437
- * @see #isBasedOn()
438
- * @since 1.11.0
439
- */
440
- this.getBaseChipId = function () {
441
- return oAlterEgo.baseChipId;
442
- };
443
-
444
- /**
445
- * Returns the catalog by which this CHIP was loaded. The result may be
446
- * <code>undefined</code> if the CHIP is only a proxy and the actual
447
- * instance has been deleted in the backend server. This may happen for
448
- * CHIPs referenced by a chip instance.
449
- *
450
- * @returns {sap.ui2.srvc.Catalog}
451
- * this CHIP's catalog or <code>undefined</code>
452
- * @since 1.19.0
453
- */
454
- this.getCatalog = function () {
455
- // CHIP from remote catalog
456
- if (oRemoteCatalog) {
457
- return oRemoteCatalog;
458
- }
459
-
460
- return oAlterEgo.$proxy ? undefined : oFactory.createCatalog(oAlterEgo.catalogId);
461
- };
462
-
463
- /**
464
- * Gets the value of a configuration parameter. Can only be called if the CHIP is not a stub
465
- * anymore.
466
- *
467
- * @param {string} sKey
468
- * the name of the parameter
469
- * @returns {string}
470
- * the value of the parameter or <code>undefined</code> if it does not exist
471
- * @since 1.2.0
472
- *
473
- * @see #isStub()
474
- */
475
- this.getConfigurationParameter = function (sKey) {
476
- checkStub();
477
- return oConfiguration[sKey];
478
- };
479
-
480
- /**
481
- * Returns the raw configuration of the OData CHIP entity ignoring defaults from
482
- * CHIP Definition XML.
483
- *
484
- * @returns {string}
485
- * raw configuration of the OData CHIP entity; may be undefined
486
- * @private
487
- */
488
- this._getChipRawConfigurationString = function () {
489
- return oAlterEgo.configuration;
490
- };
491
-
492
- /**
493
- * Returns this CHIP's description as defined by the page building service.
494
- *
495
- * @returns {string}
496
- * this CHIP's description
497
- * @since 1.2.0
498
- */
499
- this.getDescription = function () {
500
- return oAlterEgo.description;
501
- };
502
-
503
- /**
504
- * Returns this CHIP's ID.
505
- *
506
- * @returns {string}
507
- * this CHIP's ID
508
- * @since 1.2.0
509
- */
510
- this.getId = function () {
511
- return oAlterEgo.id;
512
- };
513
-
514
- /**
515
- * Returns this CHIP instance's implementation of type SAPUI5 as a control. This control
516
- * represents the root of this CHIP instance's UI from a page builder point of view. Can only
517
- * be called if the CHIP is not a stub anymore.
518
- *
519
- * @param {object} oApi
520
- * the CHIP instance specific API
521
- * @returns {sap.ui.core.Control}
522
- * this CHIP instance's SAPUI5 implementation as a control
523
- * @since 1.2.0
524
- *
525
- * @see #isStub()
526
- */
527
- this.getImplementationAsSapui5 = function (oApi) {
528
- var oData, oImplementation, sBaseChipId;
529
-
530
- checkStub();
531
- oData = {
532
- /*
533
- * @namespace The namespace for the instance specific CHIP API, which allows you to
534
- * access the various contracts consumed by your CHIP instance.
535
- * @name chip
536
- */
537
- chip: oApi
538
- };
539
- oImplementation = oDefinition.implementation.sapui5;
540
-
541
- // In case the chip is used in FLP wave 2 or later context we load it from the standard path
542
- sBaseChipId = this.getBaseChipId();
543
- if ((sBaseChipId !== "X-SAP-UI2-CHIP:/UI2/STATIC_APPLAUNCHER") && (sBaseChipId !== "X-SAP-UI2-CHIP:/UI2/DYNAMIC_APPLAUNCHER")) {
544
- if (oImplementation.$VirtualNamespace) {
545
- oImplementation.$absolutePath = this.toAbsoluteUrl(oImplementation.basePath);
546
- jQuery.sap.registerModulePath(oImplementation.$Namespace, oImplementation.$absolutePath);
547
- } else {
548
- jQuery.sap.registerModulePath(oImplementation.$Namespace, oImplementation.$UrlPrefix);
549
- }
550
- }
551
-
552
- if (oImplementation.componentName) {
553
- // SAPUI5 component
554
- return new sap.ui.core.ComponentContainer({
555
- component: sap.ui.getCore().createComponent({
556
- componentData: oData,
557
- name: oImplementation.componentName
558
- })
559
- });
560
- }
561
-
562
- // SAPUI5 MVC
563
- return sap.ui.view({
564
- type: oImplementation.$ViewType,
565
- viewName: oImplementation.$ViewName,
566
- viewData: oData
567
- });
568
- };
569
-
570
- /**
571
- * Returns the catalog by which this remote CHIP was loaded. This catalog is
572
- * <code>undefined</code> if the CHIP is from the same system as the catalog.
573
- *
574
- * @returns {sap.ui2.srvc.Catalog}
575
- * this CHIP's remote catalog or <code>undefined</code>
576
- * @since 1.9.0
577
- */
578
- this.getRemoteCatalog = function () {
579
- return oRemoteCatalog;
580
- };
581
-
582
- /**
583
- * Returns this CHIP's title as defined by the page building service or the CHIP definition XML
584
- * (if available).
585
- *
586
- * @returns {string}
587
- * this CHIP's title
588
- * @since 1.2.0
589
- */
590
- this.getTitle = function () {
591
- return oAlterEgo.title
592
- || (oDefinition && oDefinition.appearance && oDefinition.appearance.title);
593
- };
594
-
595
- /**
596
- * Checks whether this CHIP is based on the given CHIP instance. This can happen because there
597
- * is a catalog type which is built on a catalog page. In such a case the ABAP backend maps
598
- * each CHIP instance on that page to a CHIP in the resulting catalog.
599
- * <p>
600
- * Note: This CHIP's <code>baseChipId</code> is exactly non-empty if the CHIP is catalog-page
601
- * based. Then it is the ID of the CHIP used to build the CHIP instance. (This is recursive.
602
- * So if that CHIP is again catalog-page based...)
603
- *
604
- * @param {sap.ui2.srvc.ChipInstance} oChipInstance
605
- * the CHIP instance to compare with
606
- * @returns {boolean}
607
- * <code>true</code> iff the CHIP is based on the given CHIP instance
608
- * @since 1.19.1
609
- * @see #refresh()
610
- */
611
- this.isBasedOn = function (oChipInstance) {
612
- var sExpectedId
613
- = "X-SAP-UI2-PAGE:" + oChipInstance.getPage().getId()
614
- + ":" + oChipInstance.getId();
615
-
616
- /*
617
- * @param {string} sActualId
618
- * @returns {boolean}
619
- * @private
620
- */
621
- function matchesExpectation (sActualId) {
622
- // TODO use oAlterEgo.catalogPageChipInstanceId
623
- return sActualId === sExpectedId
624
- || sActualId.indexOf(sExpectedId + ":") === 0; // old IDs still contain the scope
625
- }
626
-
627
- return (oAlterEgo.referenceChipId && matchesExpectation(oAlterEgo.referenceChipId))
628
- || matchesExpectation(oAlterEgo.id);
629
- };
630
-
631
- /**
632
- * Tells whether this CHIP is a reference, pointing to its original CHIP.
633
- * Note: A refresh on the CHIP may be needed before calling this method, but only if the CHIP
634
- * is based on a catalog page and that corresponding catalog page may be updated in your use
635
- * case after the CHIP has been loaded.
636
- *
637
- * @returns {boolean}
638
- * whether this CHIP is a reference
639
- * @since 1.19.1
640
- * @see #refresh()
641
- *
642
- */
643
- this.isReference = function () {
644
- return !!oAlterEgo.referenceChipId;
645
- };
646
-
647
- /**
648
- * Tells whether this CHIP is a broken reference,
649
- * as indicated by referenceChipId being set to "O" (Orphaned)
650
- *
651
- * @returns {boolean}
652
- * whether this CHIP is a broken reference
653
- * @since 1.23.1
654
- *
655
- */
656
- this.isBrokenReference = function () {
657
- // If an underlying chip of a reference is deleted, the property referenceChipId is set
658
- // to "O" (Orphaned)
659
- return oAlterEgo.referenceChipId === "O";
660
- };
661
-
662
- /**
663
- * Tells whether this CHIP is still only a stub and does not yet know its CHIP definition XML.
664
- *
665
- * @returns {boolean}
666
- * whether this CHIP is still only a stub
667
- * @since 1.2.0
668
- *
669
- * @see #load()
670
- */
671
- this.isStub = function () {
672
- return !oDefinition;
673
- };
674
-
675
- /**
676
- * Loads the CHIP definition XML in case this has not yet been done. If this CHIP is not a stub
677
- * anymore this method fails!
678
- *
679
- * @param {function ()} fnSuccess
680
- * no-args success handler
681
- * @param {function (string, [object])} [fnFailure]
682
- * error handler taking an error message and, since version 1.28.6, an
683
- * optional object containing the complete error information as delivered
684
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
685
- * for more details.
686
- * If not given
687
- * <code>{@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}</code> is used.
688
- * @since 1.2.0
689
- *
690
- * @see #isStub()
691
- */
692
- this.load = function (fnSuccess, fnFailure) {
693
- function onError (sErrMessage, oErrDetails) {
694
- // loading has failed, call all waiting error handlers
695
- sErrorMessage = sErrMessage;
696
- oErrorInformation = oErrDetails;
697
- var i, n;
698
- if (aLoadHandlers) {
699
- for (i = 1, n = aLoadHandlers.length; i < n; i += 2) {
700
- aLoadHandlers[i](sErrMessage, oErrDetails);
701
- }
702
- aLoadHandlers = null;
703
- }
704
- }
705
-
706
- // Note: might fail synchronously!
707
- function createChipDefinition () {
708
- if (oFactory) { // Note: factory is optional!
709
- oFactory.createChipDefinition(oAlterEgo.url, initialize, onError);
710
- return;
711
- }
712
- sap.ui2.srvc.get(oAlterEgo.url, /*XML=*/true,
713
- function (oXml) {
714
- jQuery.sap.log.debug("Loaded: " + that, null, "sap.ui2.srvc.Chip");
715
- initialize(new sap.ui2.srvc.ChipDefinition(oXml));
716
- }, onError);
717
- }
718
-
719
- function onChipUpdated () {
720
- if (!oAlterEgo.url) {
721
- if (bWaitingForUpdateViaCatalog) {
722
- throw new sap.ui2.srvc.Error("Remote catalog did not deliver CHIP '" + oAlterEgo.id
723
- + "'", "sap.ui2.srvc.Chip");
724
- }
725
- throw new sap.ui2.srvc.Error("Missing module URL", "sap.ui2.srvc.Chip");
726
- }
727
- bWaitingForUpdateViaCatalog = false;
728
- sChipUrl = sap.ui2.srvc.absoluteUrl(oAlterEgo.url);
729
- createChipDefinition();
730
- }
731
-
732
- if (!this.isStub()) {
733
- throw new sap.ui2.srvc.Error("Chip is not a stub anymore", "sap.ui2.srvc.Chip");
734
- }
735
- if (typeof fnSuccess !== "function") {
736
- throw new sap.ui2.srvc.Error("Missing success handler", "sap.ui2.srvc.Chip");
737
- }
738
- fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
739
-
740
- if (sErrorMessage) { // NOTE: check sErrorMessage only
741
- sap.ui2.srvc.call(fnFailure.bind(null, sErrorMessage, oErrorInformation), null, true);
742
- return;
743
- }
744
-
745
- if (aLoadHandlers) {
746
- // wait until loading has finished (one way or the other)
747
- aLoadHandlers.push(fnSuccess, fnFailure);
748
- return;
749
- }
750
-
751
- // start loading
752
- if (oAlterEgo.url) {
753
- createChipDefinition();
754
- } else if (oAlterEgo.remoteCatalogId) {
755
- // a remote chip, request the catalog to update all registered CHIPs (incl. this one)
756
- this.getRemoteCatalog().readRegisteredChips(onChipUpdated, onError);
757
- bWaitingForUpdateViaCatalog = true;
758
- } else {
759
- // this looks like a null object, try to read our raw data and expect a failure
760
- // Note: might fail synchronously!
761
- oFactory.getPageBuildingService().readChip(
762
- oAlterEgo.id,
763
- function (oRawChip) {
764
- oAlterEgo = oRawChip;
765
- onChipUpdated();
766
- },
767
- onError
768
- );
769
- }
770
- aLoadHandlers = [fnSuccess, fnFailure];
771
- };
772
-
773
- /**
774
- * Refreshes the CHIP from the OData service. Use this only for CHIPs that you received via a
775
- * catalog. When called on a CHIP received via a page, the function may fail.
776
- * <p>
777
- * This method is intended to refresh a CHIP in a catalog based on a catalog page. Such a CHIP
778
- * is based on a CHIP instance of this catalog page. If such a CHIP instance is changed this
779
- * method can be used to refresh the corresponding CHIP.
780
- * <p>
781
- * Note: This method does not replace the {@link #load} method, as the CHIP definition is not
782
- * loaded. Thus, if the CHIP was a stub before the refresh, it is still a stub afterwards.
783
- *
784
- * @param {function ()} fnSuccess
785
- * no-args success handler
786
- * @param {function (string, [object])} [fnFailure]
787
- * error handler taking an error message and, since version 1.28.6, an
788
- * optional object containing the complete error information as delivered
789
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
790
- * for more details.
791
- * If not given
792
- * <code>{@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}</code> is used
793
- * @since 1.16.5
794
- *
795
- * @see #load()
796
- * @see #isStub()
797
- * @see #isBasedOn()
798
- */
799
- this.refresh = function (fnSuccess, fnFailure) {
800
- function updateChip (oNewAlterEgo) {
801
- oAlterEgo.title = oNewAlterEgo.title;
802
- oAlterEgo.configuration = oNewAlterEgo.configuration;
803
- oAlterEgo.referenceChipId = oNewAlterEgo.referenceChipId;
804
- initBags(oNewAlterEgo.ChipBags && oNewAlterEgo.ChipBags.results);
805
- // All other fields cannot be changed via the corresponding CHIP instance.
806
- // TODO throw exception if URL changes?
807
- if (!that.isStub()) {
808
- that.updateConfiguration(oConfiguration, oAlterEgo.configuration);
809
- }
810
- fnSuccess();
811
- }
812
-
813
- function updateRemoteChip (oResult) {
814
- if (oResult.results[0]) {
815
- updateChip(oResult.results[0]);
816
- } else {
817
- fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
818
- fnFailure("Could not refresh CHIP. No update received from catalog "
819
- + oAlterEgo.remoteCatalogId);
820
- }
821
- }
822
-
823
- if (typeof fnSuccess !== "function") {
824
- throw new sap.ui2.srvc.Error("Missing success handler", "sap.ui2.srvc.Chip");
825
- }
826
- if (!oAlterEgo.url) {
827
- throw new sap.ui2.srvc.Error(that + ": CHIP is just a stub", "sap.ui2.srvc.Chip");
828
- }
829
- if (oAlterEgo.remoteCatalogId) {
830
- this.getRemoteCatalog().readChips([oAlterEgo.id], updateRemoteChip, fnFailure);
831
- } else {
832
- oFactory.getPageBuildingService().readChip(oAlterEgo.id, updateChip, fnFailure);
833
- }
834
- };
835
-
836
- /**
837
- * Updates the CHIP. This is an internal function, used when a "preliminary" object has been
838
- * created and the data from the page building service are delivered together with another
839
- * object (e.g. the catalog).
840
- *
841
- * @param {object} oNewAlterEgo
842
- * the CHIP data as loaded via page building service
843
- * @private
844
- * @throws Error when the update data do not match or when the CHIP already is complete
845
- */
846
- this.update = function (oNewAlterEgo) {
847
- // was erroneously publicly documented in 1.18 and made @private in 1.19.0
848
- if (typeof oNewAlterEgo !== "object" || oNewAlterEgo.id !== this.getId()) {
849
- throw new sap.ui2.srvc.Error("Invalid update data: " + this, "sap.ui2.srvc.Chip");
850
- }
851
- // update bags if available
852
- if (oNewAlterEgo.ChipBags && oNewAlterEgo.ChipBags.results) {
853
- updateBags(oNewAlterEgo.ChipBags && oNewAlterEgo.ChipBags.results);
854
- }
855
-
856
- if (oAlterEgo.url) {
857
- return; // No more update, please!
858
- }
859
- if (!oNewAlterEgo.url) {
860
- return; // This is not really an update!
861
- }
862
- oAlterEgo = oNewAlterEgo;
863
- sChipUrl = sap.ui2.srvc.absoluteUrl(oAlterEgo.url);
864
- jQuery.sap.log.debug("Updated: " + this, null, "sap.ui2.srvc.Chip");
865
- };
866
-
867
- /**
868
- * Updates the given parameter map from the given JSON string. All parameters that actually were
869
- * defined in the CHIP definition XML are accepted. All others will raise a warning to the log.
870
- *
871
- * @param {map<String,String>} mParameters
872
- * the parameter map to fill
873
- * @param {map<String,String>|string} vConfigurationUpdates
874
- * the configuration updates as parameter map or as JSON string
875
- * <p>If one parameter value is <code>undefined</code> (which can only happen by supplying a
876
- * map) then this property is removed from <code>mParameters</code>.
877
- *
878
- * @since 1.2.0
879
- */
880
- this.updateConfiguration = function (mParameters, vConfigurationUpdates) {
881
- var mConfigurationUpdates,
882
- sKey,
883
- sValue;
884
- if (!vConfigurationUpdates) {
885
- return;
886
- }
887
- if (typeof vConfigurationUpdates === "string") {
888
- try {
889
- mConfigurationUpdates = JSON.parse(vConfigurationUpdates);
890
- } catch (e) {
891
- // configuration as a whole is incorrect and will be ignored
892
- // Note: toString(true) will also output configuration, thus it is no secret
893
- jQuery.sap.log.warning(this + ': ignoring invalid configuration "'
894
- + vConfigurationUpdates + '"', null, "sap.ui2.srvc.Chip");
895
- return;
896
- }
897
- } else {
898
- mConfigurationUpdates = vConfigurationUpdates;
899
- }
900
- for (sKey in mConfigurationUpdates) {
901
- if (Object.prototype.hasOwnProperty.call(mConfigurationUpdates, sKey)) {
902
- if (Object.prototype.hasOwnProperty.call(oConfiguration, sKey)) {
903
- sValue = mConfigurationUpdates[sKey];
904
- if (sValue === undefined) {
905
- delete mParameters[sKey];
906
- } else if (typeof sValue !== "string") {
907
- throw new sap.ui2.srvc.Error("Value for '" + sKey + "' must be a string",
908
- "sap.ui2.srvc.Chip");
909
- } else {
910
- mParameters[sKey] = sValue;
911
- }
912
- } else {
913
- jQuery.sap.log.warning(this + ": ignoring unknown configuration parameter " + sKey,
914
- null, "sap.ui2.srvc.Chip");
915
- }
916
- }
917
- }
918
- };
919
-
920
- /**
921
- * Makes the given relative URL absolute. URLs containing host and/or protocol
922
- * and URLs with an absolute path remain unchanged. The URL is in no way
923
- * normalized; the function takes the URL of the CHIP definition XML as base.
924
- *
925
- * @param {string} sUrl
926
- * the (possibly server-relative) URL
927
- * @returns {string}
928
- * the absolute URL
929
- * @since 1.2.0
930
- */
931
- this.toAbsoluteUrl = function (sUrl) {
932
- return sap.ui2.srvc.absoluteUrl(sUrl, sChipUrl);
933
- };
934
-
935
- /**
936
- * Returns this CHIP's string representation.
937
- *
938
- * @param {boolean} [bVerbose=false]
939
- * flag whether to show all properties
940
- * @returns {string}
941
- * this CHIP's string representation
942
- * @since 1.2.0
943
- */
944
- this.toString = function (bVerbose) {
945
- var aResult = [
946
- 'sap.ui2.srvc.Chip({sChipUrl:"', sChipUrl, '"'
947
- ];
948
- if (bVerbose) {
949
- aResult.push(",oAlterEgo:", JSON.stringify(oAlterEgo),
950
- ",oBags:", oBags.toString(),
951
- ",oDefinition:", JSON.stringify(oDefinition)
952
- );
953
- }
954
- aResult.push("})");
955
- return aResult.join("");
956
- };
957
-
958
- /**
959
- * This method can be used to figure out if the CHIP initially existed.
960
- * This is only relevant when the CHIP navigation property was expanded
961
- * (OData $expand).
962
- *
963
- * @returns {boolean}
964
- * Whether the CHIP initially existed.
965
- *
966
- * @private
967
- */
968
- this.isInitiallyDefined = function (bDefined) {
969
- return bDefined;
970
- }.bind(
971
- null,
972
- oAlterEgo && !oAlterEgo.hasOwnProperty("$proxy") // $proxy (set from factory) when null
973
- );
974
-
975
- // constructor code -------------------------------------------------------
976
- if (!sap.ui2.srvc.Map) {
977
- fnRequire("sap.ui2.srvc.utils");
978
- }
979
- if (!oAlterEgo) {
980
- throw new sap.ui2.srvc.Error("Missing CHIP description", "sap.ui2.srvc.Chip");
981
- }
982
-
983
- sChipUrl = sap.ui2.srvc.absoluteUrl(oAlterEgo.url);
984
- if (oAlterEgo.remoteCatalogId) {
985
- oRemoteCatalog = oFactory.createCatalog(oAlterEgo.remoteCatalogId);
986
- if (!oAlterEgo.url) {
987
- oRemoteCatalog.registerChip(this);
988
- }
989
- }
990
- initBags(oAlterEgo.ChipBags && oAlterEgo.ChipBags.results);
991
- jQuery.sap.log.debug("Created: " + this, null, "sap.ui2.srvc.Chip");
992
- };
993
-
994
- // "public" methods (static) ------------------------------------------------
995
-
996
- /**
997
- * Adds a contract to the list of known contracts which can be consumed by CHIPs.
998
- *
999
- * @param {string} sName
1000
- * The name of the contract.
1001
- * @param {function (sap.ui2.srvc.ChipInstance)} fnInitializer
1002
- * This function will initialize the contract for a CHIP instance. When the API object for a
1003
- * CHIP instance requesting this contract is initialized, a sub-object with the contract's name
1004
- * is added to the API. The initializer is then called with this sub-object as <code>this</code>
1005
- * and the CHIP instance as parameter.
1006
- * @since 1.2.0
1007
- */
1008
- sap.ui2.srvc.Chip.addContract = function (sName, fnInitializer) {
1009
- if (getContractInitializer(sName)) {
1010
- if (!sap.ui2.srvc.Error) {
1011
- fnRequire("sap.ui2.srvc.error");
1012
- }
1013
- throw new sap.ui2.srvc.Error("Cannot register contract '" + sName + "' twice",
1014
- "sap.ui2.srvc.Chip");
1015
- }
1016
- mContractsByName[sName] = fnInitializer;
1017
- };
1018
-
1019
- /* eslint-disable no-unused-vars*/
1020
- /**
1021
- * Removes a contract from the list of known contracts which can be consumed by CHIPs. Does not
1022
- * fail even if the contract was not known before!
1023
- * Note: Only used in test code via testPublishAt
1024
- *
1025
- * @param {string} sName
1026
- * The name of the contract.
1027
- * @since 1.11.0
1028
- * @private
1029
- */
1030
- sap.ui2.srvc.testPublishAt(sap.ui2.srvc.Chip);
1031
- function removeContract (sName) {
1032
- delete mContractsByName[sName];
1033
- }
1034
- /* eslint-enable no-unused-vars*/
1035
- }());