@sapui5/sap.ushell_abap 1.97.1 → 1.99.1

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 +37 -4
  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 +35 -15
  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 +7 -0
  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 +6 -12
  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 +127 -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 +376 -30
  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,946 +0,0 @@
1
- // Copyright (c) 2009-2020 SAP SE, All Rights Reserved
2
-
3
- /**
4
- * @fileOverview A wrapper for a catalog loaded from the page building service.
5
- */
6
-
7
- this.sap = this.sap || {};
8
-
9
- (function () {
10
- "use strict";
11
-
12
- // namespace "sap.ui2.srvc" **************************************************
13
- sap.ui2 = sap.ui2 || {};
14
- /**
15
- * @namespace The namespace for services related to page building and CHIP implementation.
16
- * @since 1.2.0
17
- */
18
- sap.ui2.srvc = sap.ui2.srvc || {};
19
-
20
- // Only declare the module if jQuery.sap exists. Otherwise we do not even try to require assuming
21
- // that the script has been loaded manually (before SAPUI5).
22
- // Load time branching pattern
23
- var fnRequire = String; // NOP (String exists and is free of side-effects)
24
- if (typeof jQuery === "function" && jQuery.sap) {
25
- jQuery.sap.declare("sap.ui2.srvc.catalog");
26
- // avoid fnRequire = jQuery.sap.require as require cannot be spied on afterwards
27
- fnRequire = function () {
28
- jQuery.sap.require.apply(this, arguments);
29
- };
30
- }
31
-
32
- //TODO We cannot require utils (module path possibly unset)?!, but we need testPublishAt
33
- sap.ui2.srvc.testPublishAt = sap.ui2.srvc.testPublishAt || function () { /*NOP*/ };
34
-
35
- // "public class" ************************************************************
36
-
37
- /**
38
- * Constructs a new representation (wrapper) of the CHIP catalog with the given
39
- * ID to be loaded from the given factory's page building service.
40
- * <p>
41
- * Initially a stub is created, which can later load its properties and related objects
42
- * asynchronously.
43
- * <p>
44
- * Catalogs are currently read-only and cannot be updated through the page building service.
45
- *
46
- * @param {sap.ui2.srvc.Factory} oFactory
47
- * the factory
48
- * @param {object|string} vCatalogData
49
- * the catalog's ID or its catalog data as loaded via page building service
50
- *
51
- * @class
52
- * @see sap.ui2.srvc.PageBuildingService
53
- * @see sap.ui2.srvc.Chip
54
- * @since 1.2.0
55
- */
56
- sap.ui2.srvc.Catalog = function (oFactory, vCatalogData) {
57
- var oAlterEgo, // catalog's representation with all relations removed
58
- oCatalogPage, // {sap.ui2.srvc.Page}
59
- aChips = [], // {sap.ui2.srvc.Chip[]}
60
- oReadPromise, // if existing and in state "pending", a load/refresh is running; see read
61
- bIsStub = true, //TODO replace by aChips === undefined
62
- oCachedRemoteErrorArgs,
63
- sId,
64
- oReadRegisteredChipsPromise, // see readRegisteredChips
65
- aRegisteredChipIds = [],
66
- that = this;
67
-
68
- // BEWARE: constructor code below!
69
-
70
- // "private" methods ---------------------------------------------------------
71
- /**
72
- * Makes sure the given page is not just a stub.
73
- *
74
- * @private
75
- */
76
- function checkStub () {
77
- if (bIsStub) {
78
- throw new sap.ui2.srvc.Error(that + ": page is just a stub", "sap.ui2.srvc.Page");
79
- }
80
- }
81
-
82
- /**
83
- * Makes sure that not only the catalog's ID is known, but at least its alter ego.
84
- *
85
- * @private
86
- */
87
- function checkAlterEgo () {
88
- if (!oAlterEgo) {
89
- throw new sap.ui2.srvc.Error(that + ": catalog is just an ID", "sap.ui2.srvc.Catalog");
90
- }
91
- }
92
-
93
- /**
94
- * Releases all resources associated with this catalog. Call this method just before you stop
95
- * using it.
96
- *
97
- * @private
98
- */
99
- sap.ui2.srvc.testPublishAt(that);
100
- function exit () {
101
- var sToString = that.toString();
102
-
103
- //TODO exit() catalog's CHIPs?! what about oReadRegisteredChipsPromise then?
104
- if (oCatalogPage) {
105
- oCatalogPage.exit(); //TODO make sap.ui2.srvc.Page#exit also remove its API?! cf. below
106
- }
107
-
108
- // reset to initial state, but leave ID intact!
109
- oAlterEgo = undefined;
110
- vCatalogData = undefined;
111
- aChips = [];
112
- bIsStub = true;
113
- oReadPromise = undefined;
114
- oReadRegisteredChipsPromise = undefined;
115
- aRegisteredChipIds = [];
116
-
117
- // delete methods on deleted catalog to prevent wrong behavior
118
- Object.keys(that).forEach(function (sFunctionName) {
119
- if (!/getCatalogData|getId|isStub|toString/.test(sFunctionName)) {
120
- delete that[sFunctionName];
121
- }
122
- });
123
-
124
- oFactory.forgetCatalog(that);
125
-
126
- jQuery.sap.log.debug("Exited: " + sToString, null, "sap.ui2.srvc.Catalog");
127
- }
128
-
129
- /**
130
- * Gets this catalog's remote base URL.
131
- * @returns {string}
132
- * @private
133
- */
134
- sap.ui2.srvc.testPublishAt(that);
135
- function getRemoteBaseUrl () {
136
- return that.addSystemToServiceUrl(oAlterEgo.type === "H"
137
- ? "/sap/hba/apps/kpi/s/odata/hana_chip_catalog.xsodata/"
138
- : oAlterEgo.baseUrl);
139
- }
140
-
141
- /**
142
- * Gets the remote catalog service.
143
- *
144
- * @returns {sap.ui2.srvc.RemoteCatalogService}
145
- * @private
146
- */
147
- sap.ui2.srvc.testPublishAt(that);
148
- function getRemoteCatalogService () {
149
- return oFactory.getRemoteCatalogService(oAlterEgo) || {
150
- readChips: function (sBaseUrl, sCatalogId, aChipIds, fnSuccess, fnFailure) {
151
- jQuery.sap.log.error("Catalog '" + oAlterEgo.id + "', type '" + oAlterEgo.type
152
- + "' not supported", null, "sap.ui2.srvc.Catalog");
153
- // fake an empty response to make the catalog valid
154
- // When created with alterEgo, we're still synchronous, so make it async
155
- sap.ui2.srvc.call(fnSuccess.bind(null, { results: [] }), undefined, /*async=*/true);
156
- }
157
- };
158
- }
159
-
160
- /**
161
- * Success handler for loading a catalog.
162
- *
163
- * @private
164
- */
165
- function initialize () {
166
- var i, n,
167
- aResults;
168
-
169
- jQuery.sap.log.debug("Loaded: " + that, null, "sap.ui2.srvc.Catalog");
170
- if (oAlterEgo.Chips) {
171
- // fallback for HANA
172
- aResults = oAlterEgo.Chips.results || oAlterEgo.Chips;
173
- // remove relations and store catalog representation
174
- delete oAlterEgo.Chips;
175
-
176
- // create CHIP stubs
177
- aChips = [];
178
- for (i = 0, n = aResults.length; i < n; i += 1) {
179
- aChips[i] = oFactory.createChip(aResults[i]);
180
- }
181
- bIsStub = false;
182
- jQuery.sap.log.debug("Initialized: " + that, null, "sap.ui2.srvc.Catalog");
183
- }
184
-
185
- delete oAlterEgo.CatalogPage;
186
- }
187
-
188
- /**
189
- * Loads the catalog from the page building service, including its title and its contained
190
- * CHIPs (at least as stubs).
191
- *
192
- * If the catalog is a remote catalog, an attempt to load its chips is made.
193
- * In this case, if the loading fails, the catalog is fully initialized ( with an empty chips collection ) and
194
- * returned as 2nd argument of the reject handler (note that it is no longer a stub!)
195
- *
196
- * @param {function ()} fnSuccess
197
- * no-args success handler
198
- * @param {function (string, object=)} [fnFailure]
199
- * error handler taking an error message and, since version 1.28.6, an
200
- * optional object containing the complete error information as delivered
201
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
202
- * for more details.
203
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
204
- *
205
- * @private
206
- */
207
- sap.ui2.srvc.testPublishAt(that);
208
- function read (bRefresh, fnSuccess, fnFailure) {
209
- var oDeferred;
210
-
211
- /*
212
- * @param {object} oResult
213
- * the OData result from readCatalog
214
- */
215
- function onCatalogLoaded (oResult) {
216
- oAlterEgo = oResult;
217
- initialize();
218
- oDeferred.resolve();
219
- }
220
-
221
- /*
222
- * @param {object} oResult
223
- * the OData result from readCatalogChips
224
- */
225
- function onChipsLoaded (oResult) {
226
- oAlterEgo.Chips = oResult;
227
- initialize();
228
- oDeferred.resolve();
229
- }
230
-
231
- /*
232
- * Processes the remote response from readCatalogChips.
233
- * @param {object} oResult
234
- * the OData result from readCatalogChips
235
- */
236
- function processRemoteResponse (oResult) {
237
- oResult.results.forEach(function (oRawChip) {
238
- oRawChip.remoteCatalogId = sId;
239
- });
240
- onChipsLoaded(oResult);
241
- }
242
-
243
- /*
244
- * initialize the chip and reject the promise,
245
- * called when subsequent loading from a remote catalog fails
246
- * @param {string} sErrMsg
247
- * an error message from a failure
248
- * @param {object} [oErrDetails]
249
- * (since version 1.28.6) an optional object containing the complete
250
- * error information as
251
- * delivered by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
252
- * for more details.
253
- */
254
- function couldNotLoadRemoteChips () {
255
- initialize(); // fail gracefully
256
- oCachedRemoteErrorArgs = arguments;
257
- oDeferred.reject.apply(this, arguments);
258
- }
259
- /*
260
- * Processes the local response from readCatalog. Passes it on to initialize or requests the
261
- * CHIPS from the remote server.
262
- * @param {object} oResult
263
- * the OData result from the readCatalog
264
- */
265
- function processLocalResponse (oResult) {
266
- var sRemoteBaseUrl;
267
- if (oResult.remoteId) { //TODO || oResult.type === "REMOTE"
268
- oAlterEgo = oResult;
269
- try {
270
- sRemoteBaseUrl = getRemoteBaseUrl();
271
- } catch (e) {
272
- couldNotLoadRemoteChips(e.toString());
273
- return;
274
- }
275
- getRemoteCatalogService().readChips(sRemoteBaseUrl, oAlterEgo.remoteId, undefined,
276
- processRemoteResponse, couldNotLoadRemoteChips);
277
- } else if (oAlterEgo && bRefresh) {
278
- onChipsLoaded(oResult.Chips);
279
- } else {
280
- onCatalogLoaded(oResult);
281
- }
282
- }
283
-
284
- if (!oReadPromise || oReadPromise.state() !== "pending") {
285
- oDeferred = new jQuery.Deferred();
286
- oReadPromise = oDeferred.promise();
287
- if (!oAlterEgo || (bRefresh && !oAlterEgo.remoteId)) {
288
- // read the local catalog if it is unknown yet or if refreshing a non-remote catalog
289
- oFactory.getPageBuildingService().readCatalog(sId, processLocalResponse,
290
- oDeferred.reject.bind(oDeferred));
291
- } else {
292
- processLocalResponse(oAlterEgo);
293
- }
294
- }
295
- fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
296
- //TODO this needs "sap.ui2.srvc.utils" which is never required!
297
- oReadPromise.done(sap.ui2.srvc.call.bind(null, fnSuccess, fnFailure));
298
- oReadPromise.fail(fnFailure);
299
- }
300
-
301
- // "public" methods ----------------------------------------------------------
302
-
303
- /**
304
- * Makes the given server-relative service URL point to the system given as parameter
305
- * <code>sSystem</code> or to the system from which the catalog
306
- * loaded its CHIPs if <code>sSystem</code> is empty.
307
- * <em>Server-relative URL</em> means a URL starting with exactly one "/" (also known as
308
- * absolute-path URL).
309
- * <p>
310
- *
311
- * The system is added via segment parameter <code>o</code> to the last URL segment of the
312
- * service URL. It is also possible to make this function put the system to a different
313
- * URL path segment of the service URL by specifying the empty segment parameter
314
- * <code>o</code>. If both <code>sSystem</code> is empty and the catalog is a local
315
- * catalog, no system is added and the empty segment parameter <code>o</code> is removed.
316
- * <br/>
317
- * <b>Example 1:</b> <code>/sap/opu/odata/MyService/?p1=v1</code> is converted to
318
- * <code>/sap/opu/odata/MyService;o=SYS/?p1=v1</code> if the catalog is a remote catalog with
319
- * system ID &quot;SYS&quot;.
320
- * However it remains unchanged if the catalog is not remote <em>and</em>
321
- * the parameter <code>sSystem</code> is empty.<br/>
322
- * <b>Example 2:</b> <code>/sap/opu/odata/MyService;o=/MyEntities/$count?p1=v1</code> is
323
- * converted to <code>/sap/opu/odata/MyService;o=sid(SYS.123)/MyEntities/$count?p1=v1</code> if
324
- * parameter <code>sSystem</code> is set to &quot;sid(SYS.123)&quot;</code>.
325
- *
326
- * The URL is in no way normalized.
327
- *
328
- * @private
329
- * @param {string} sServiceUrl
330
- * a server-relative service URL (to be used when addressing the system directly)
331
- * @param {string} [sSystem]
332
- * a system specification like <code>SYS</code> or <code>sid(SYS.123)</code>; if empty the
333
- * system from which the catalog loaded its CHIPs is used
334
- * @returns {string}
335
- * the service URL pointing to the system specified in parameter <code>sSystem</code> or to
336
- * the catalog's system
337
- * @throws Error if the URL is not server-relative (such as <code>./something</code>,
338
- * <code>http://foo.bar/something</code>, ...)
339
- */
340
- this.addSystemToServiceUrl = function (sServiceUrl, sSystem) {
341
- /*jslint regexp:true */
342
- if (sServiceUrl.indexOf("/") !== 0 || sServiceUrl.indexOf("//") === 0) {
343
- throw new sap.ui2.srvc.Error("addSystemToServiceUrl: Invalid URL: " + sServiceUrl,
344
- "sap.ui2.srvc.Catalog");
345
- }
346
- sSystem = sSystem || this.getSystemAlias();
347
- //eslint-disable-next-line
348
- if (/^[^?]*(;o=([\/;?]|$))/.test(sServiceUrl)) {
349
- // URL with ";o=" *not* followed by system: insert system
350
- //eslint-disable-next-line
351
- sServiceUrl = sServiceUrl.replace(/;o=([\/;?]|$)/, (sSystem ? ";o=" + sSystem : "") + "$1");
352
- //eslint-disable-next-line
353
- } else if (!/^[^?]*;o=/.test(sServiceUrl) && sSystem) {
354
- // URL without ";o=": append system
355
- sServiceUrl = sServiceUrl.replace(/(\/[^?]*?)(\/$|$|(\/?\?.*))/,
356
- "$1;o=" + sSystem + "$2");
357
- }
358
- if (sap.ui) {
359
- sap.ui.getCore().getEventBus().publish("sap.ushell.Container",
360
- "addRemoteSystemForServiceUrl", sServiceUrl); //{ sValue : sServiceUrl }
361
- }
362
- return sServiceUrl;
363
- };
364
-
365
- /**
366
- * Creates a new catalog in the backend as a clone of this catalog, using the given domain ID.
367
- * All copied catalog CHIPs are references (see {@link sap.ui2.srvc.Chip#isReference})
368
- * until they are changed (copy on write).
369
- * Changes to the original CHIPs will be visible in the catalog copy after the next read.
370
- * The success handler is called as soon as the clone has been created and the new
371
- * <code>sap.ui2.srvc.Catalog</code> object is not a stub anymore. Access the
372
- * <code>sap.ui2.srvc.Catalog</code> instance passed to the success callback in order to learn
373
- * the resulting ID!
374
- * <p>
375
- * Can be called no matter whether this catalog is still a stub. For remote catalogs where
376
- * only the ID is known, this method currently fails!
377
- *
378
- * @param {string} sNewDomainId
379
- * the new catalog's domain-specific ID which must not contain a colon
380
- * @param {string} [sNewTitle]
381
- * the new catalog's title; if <code>undefined</code>, this catalog's title will be used
382
- * @param {function (sap.ui2.srvc.Catalog)} fnSuccess
383
- * success handler for asynchronous creation
384
- * @param {function (string, sap.ui2.srvc.Catalog=, object=)} fnFailure
385
- * error handler, taking an error message, an optional {@link sap.ui2.srvc.Catalog}
386
- * instance and, since version 1.28.6, an optional object containing the
387
- * complete error information.<br />
388
- * See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
389
- * for more details about the complete error information parameter.
390
- *
391
- * @see #getCatalogPage
392
- * @since 1.19.1
393
- */
394
- this.clone = function (sNewDomainId, sNewTitle, fnSuccess, fnFailure) {
395
- var oCatalogData,
396
- /*
397
- * keeps calls to failure handler consistent with failure handler calls
398
- * in sap.ui2.srvc.Factory#createNewCatalog
399
- */
400
- fnFailureWrapper = function (sErrorMessage, oMaybeErrorInformation) {
401
- return fnFailure(sErrorMessage, /*sap.ui2.srvc.Catalog*/undefined,
402
- oMaybeErrorInformation);
403
- };
404
-
405
- if (oAlterEgo && oAlterEgo.type === "REMOTE") {
406
- oCatalogData = this.getCatalogData();
407
- delete oCatalogData.id;
408
- oCatalogData.domainId = sNewDomainId;
409
- if (sNewTitle !== undefined) {
410
- oCatalogData.title = sNewTitle;
411
- }
412
- oFactory.createNewCatalog(oCatalogData, fnSuccess, fnFailure);
413
- } else {
414
- oFactory.getPageBuildingService().cloneCatalog(this.getId(), sNewDomainId, sNewTitle,
415
- function (oRawCatalog) {
416
- // Note: Chips relation is deferred, Catalog cannot handle this, thus use ID only!
417
- oFactory.createCatalog(oRawCatalog.id, fnSuccess, fnFailureWrapper);
418
- }, fnFailureWrapper);
419
- }
420
- };
421
-
422
- /**
423
- * Returns all of this catalog's properties or <code>undefined</code> if only the catalog's ID
424
- * is known.
425
- *
426
- * @returns {object}
427
- * all of this catalog's properties, e.g.
428
- * <pre>
429
- * {
430
- * baseUrl: "/sap/hba/apps/kpi/s/odata/hana_chip_catalog.xsodata/",
431
- * domainId: "Z_REMOTE_HANA_CATALOG",
432
- * remoteId: "HANA_CATALOG",
433
- * systemAlias: "sanssouci",
434
- * title: "Remote HANA catalog",
435
- * type: "REMOTE"
436
- * }
437
- * </pre>
438
- * @since 1.19.1
439
- *
440
- * @see #update
441
- * @see sap.ui2.srvc.Factory#createNewCatalog
442
- */
443
- this.getCatalogData = function () {
444
- /*jslint nomen:true */
445
- var oCatalogData;
446
-
447
- if (!oAlterEgo) {
448
- return undefined; // only ID is known!
449
- }
450
-
451
- oCatalogData = JSON.parse(JSON.stringify(oAlterEgo));
452
- delete oCatalogData.__metadata;
453
- return oCatalogData;
454
- };
455
-
456
- /**
457
- * Returns this catalog's corresponding catalog page (typically a stub only), if any
458
- * (see {@link sap.ui2.srvc.Factory#createNewPageBasedCatalog}).
459
- * This method is intended to be called in a design time use case only.
460
- * <p>
461
- * Catalog pages are an easy way to modify catalogs. A catalog based on a catalog page is not
462
- * only represented by a {@link sap.ui2.srvc.Catalog}, but also by a {@link sap.ui2.srvc.Page}.
463
- * This means that you can use the {@link sap.ui2.srvc.Page} and
464
- * {@link sap.ui2.srvc.ChipInstance} APIs to modify the catalog.
465
- * For example, you can add a new {@link sap.ui2.srvc.Chip} as a
466
- * {@link sap.ui2.srvc.ChipInstance} using the
467
- * {@link sap.ui2.srvc.Page#createNewPageBasedCatalog} method.
468
- * <p>
469
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
470
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
471
- *
472
- * @returns {sap.ui2.srvc.Page}
473
- * this catalog's corresponding catalog page, or <code>undefined</code> if this catalog is
474
- * not based on a catalog page
475
- * @since 1.19.1
476
- */
477
- this.getCatalogPage = function () {
478
- checkAlterEgo();
479
- if (oAlterEgo.type !== "P" && oAlterEgo.type !== "CATALOG_PAGE") {
480
- return undefined; // this catalog is not based on a catalog page
481
- }
482
-
483
- if (!oCatalogPage) {
484
- oCatalogPage = oFactory.createPage(sId);
485
- }
486
- return oCatalogPage;
487
- };
488
-
489
- /**
490
- * Returns this catalog's CHIPs (typically stubs only). Can be called only if the catalog
491
- * itself is not a stub anymore.
492
- *
493
- * @returns {sap.ui2.srvc.Chip[]}
494
- * this catalog's CHIPs
495
- * @since 1.2.0
496
- *
497
- * @see #isStub
498
- */
499
- this.getChips = function () {
500
- if (bIsStub) {
501
- throw new sap.ui2.srvc.Error(that + ": catalog is just a stub", "sap.ui2.srvc.Catalog");
502
- }
503
- return aChips.slice();
504
- };
505
-
506
- /**
507
- * Returns this catalog's domain ID which represents the catalog ID without any type-specific
508
- * prefixes (like "X-SAP-REMOTE:"). The domain ID is better human-readable than the ID (see
509
- * {@link #getId()}). Returns <code>undefined</code> as long as only the ID of this catalog
510
- * is known.
511
- *
512
- * @returns {string}
513
- * this catalog's domain ID
514
- * @since 1.19.1
515
- *
516
- * @see sap.ui2.srvc.Factory#createNewPageBasedCatalog
517
- * @see sap.ui2.srvc.PageBuildingService#createPageBasedCatalog
518
- */
519
- this.getDomainId = function () {
520
- return oAlterEgo && oAlterEgo.domainId;
521
- };
522
-
523
- /**
524
- * Returns this catalog's technical ID. In contrast to {@link #getDomainId} this method returns
525
- * the ID including type-specific prefixes (like "X-SAP-REMOTE:"). Those should not be
526
- * displayed on a UI, for example.
527
- *
528
- * @returns {string}
529
- * this catalog's technical ID including type-specific prefixes (like "X-SAP-REMOTE:")
530
- * @since 1.2.0
531
- */
532
- this.getId = function () {
533
- return sId;
534
- };
535
-
536
- /**
537
- * Returns this catalog's system alias.
538
- *
539
- * @returns {string}
540
- * this catalog's system alias
541
- * @private
542
- */
543
- this.getSystemAlias = function () {
544
- return (oAlterEgo && oAlterEgo.systemAlias) || undefined;
545
- };
546
-
547
- /**
548
- * Returns this catalog's title.
549
- * <p>
550
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
551
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
552
- *
553
- * @returns {string}
554
- * this catalog's title
555
- * @since 1.2.0
556
- *
557
- * @see #isStub
558
- */
559
- this.getTitle = function () {
560
- checkAlterEgo();
561
- return oAlterEgo.title;
562
- };
563
-
564
- /**
565
- * Returns this catalog's type.
566
- * <p>
567
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
568
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
569
- *
570
- * @returns {string}
571
- * this catalog's type
572
- * @since 1.16.4
573
- */
574
- this.getType = function () {
575
- checkAlterEgo();
576
- return oAlterEgo && oAlterEgo.type;
577
- };
578
-
579
- /**
580
- * Tells whether this catalog is marked as outdated. For a catalog based on a catalog page
581
- * (see {@link #getCatalogPage}), this means that the catalog page is marked as outdated
582
- * (see {@link sap.ui2.srvc.Page#isOutdated}).
583
- * <p>
584
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
585
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
586
- *
587
- * @returns {boolean}
588
- * whether this catalog is marked as outdated
589
- * @since 1.19.1
590
- */
591
- this.isOutdated = function () {
592
- checkAlterEgo();
593
-
594
- // Note: no use calling getCatalogPage(), it could only create a new stub
595
- return (oCatalogPage && !oCatalogPage.isStub() && oCatalogPage.isOutdated())
596
- || oAlterEgo.outdated === "X";
597
- };
598
-
599
- /**
600
- * Tells whether this catalog is readOnly.
601
- * <p>
602
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
603
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
604
- *
605
- * @returns {boolean}
606
- * true if this catalog is in read only mode
607
- * @since 1.32.0
608
- */
609
- this.isReadOnly = function () {
610
- checkStub();
611
- return oAlterEgo.isReadOnly === "X";
612
- };
613
-
614
- /**
615
- * Tells whether this catalog is still only a stub and does not yet know its CHIPs or title.
616
- *
617
- * @returns {boolean}
618
- * whether this catalog is still only a stub
619
- * @since 1.2.0
620
- *
621
- * @see #load
622
- */
623
- this.isStub = function () {
624
- return bIsStub;
625
- };
626
-
627
- /**
628
- * In case of a remote catalog which failed for some reason to read its CHIPs
629
- * (see {@link #readChips}), this method can be used to retrieve the original failure
630
- * handler arguments. This is needed because of the graceful degradation (the catalog
631
- * keeps usable and simply behaves as if it would be empty).
632
- * Will be reset on call of {@link #update}.
633
- *
634
- * @returns {arguments}
635
- * the arguments as originally received by the {@link #readChips} failure handler
636
- * @since 1.34.0
637
- *
638
- * @see #readChips
639
- */
640
- this.getCachedRemoteFailureArguments = function () {
641
- return oCachedRemoteErrorArgs;
642
- };
643
-
644
- /**
645
- * Loads the catalog from the page building service, including its title and its contained CHIPs
646
- * (at least as stubs). Must not be called twice! If needed, call <code>refresh()</code>.
647
- *
648
- * @param {function ()} fnSuccess
649
- * no-args success handler
650
- * @param {function (string, object=)} [fnFailure]
651
- * error handler taking an error message and, since version 1.28.6, an
652
- * optional object containing the complete error information as delivered
653
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
654
- * for more details.
655
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
656
- * @since 1.2.0
657
- *
658
- * @see #isStub
659
- * @see #refresh
660
- */
661
- this.load = function (fnSuccess, fnFailure) {
662
- if (!bIsStub) {
663
- throw new sap.ui2.srvc.Error("Catalog is not a stub anymore", "sap.ui2.srvc.Catalog");
664
- }
665
- read(false, fnSuccess, fnFailure);
666
- };
667
-
668
- /**
669
- * Reads all CHIPs into the factory's CHIP cache. The catalog itself remains unchanged. This
670
- * method may be called even if the catalog is a stub.
671
- *
672
- * @param {string[]} aChipIds
673
- * the IDs of the CHIPs to be read.
674
- * @param {function ()} fnSuccess
675
- * no-args success handler
676
- * @param {function (string, object=)} [fnFailure]
677
- * error handler taking an error message and, since version 1.28.6, an
678
- * optional object containing the complete error information as delivered
679
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
680
- * for more details. Please see also {@link #getCachedRemoteFailureArguments}.
681
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
682
- * @since 1.16.4
683
- *
684
- * @see #getCachedRemoteFailureArguments
685
- */
686
- this.readChips = function (aChipIds, fnSuccess, fnFailure) {
687
- function createChips (oRawData) {
688
- oRawData.results.forEach(function (oRawChipData) {
689
- oFactory.createChip(oRawChipData);
690
- });
691
- //TODO this needs "sap.ui2.srvc.utils" which is never required!
692
- sap.ui2.srvc.call(fnSuccess, fnFailure);
693
- }
694
-
695
- function createRemoteChips (oRawData) {
696
- // add remoteCatalogId to each CHIP
697
- oRawData.results.forEach(function (oRawChipData) {
698
- oRawChipData.remoteCatalogId = sId;
699
- });
700
- createChips(oRawData);
701
- }
702
-
703
- function requestChips (oResult) {
704
- oAlterEgo = oResult;
705
- if (oAlterEgo.remoteId) {
706
- getRemoteCatalogService().readChips(getRemoteBaseUrl(), oAlterEgo.remoteId, aChipIds,
707
- createRemoteChips, fnFailure);
708
- } else {
709
- oFactory.getPageBuildingService().readCatalogChips(sId, aChipIds, createChips, fnFailure);
710
- }
711
- }
712
-
713
- if (!oAlterEgo) {
714
- // ensure that we have the alter ego to know type and remoteId, but do not load CHIPs
715
- oFactory.getPageBuildingService().readCatalog(sId, requestChips, fnFailure, true);
716
- } else {
717
- requestChips(oAlterEgo);
718
- }
719
- };
720
-
721
- /**
722
- * Reads all registered CHIPs using {@link #readChips}. The catalog itself remains unchanged.
723
- * This method may be called even if the catalog is a stub.
724
- * @param {function ()} fnSuccess
725
- * no-args success handler
726
- * @param {function (string, object=)} [fnFailure]
727
- * error handler taking an error message and, since version 1.28.6, an
728
- * optional object containing the complete error information as delivered
729
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
730
- * for more details.
731
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
732
- * @since 1.19.0
733
- * @private
734
-
735
- * @see #readChips
736
- * @see #registerChip
737
- */
738
- this.readRegisteredChips = function (fnSuccess, fnFailure) {
739
- function start () {
740
- var oDeferred = new jQuery.Deferred(),
741
- aChipIds = aRegisteredChipIds;
742
-
743
- aRegisteredChipIds = [];
744
- if (aChipIds.length) {
745
- that.readChips(aChipIds, oDeferred.resolve.bind(oDeferred),
746
- oDeferred.reject.bind(oDeferred));
747
- } else {
748
- oDeferred.resolve();
749
- }
750
- return oDeferred.promise();
751
- }
752
-
753
- if (!oReadRegisteredChipsPromise || oReadRegisteredChipsPromise.state() !== "pending") {
754
- oReadRegisteredChipsPromise = start();
755
- }
756
- fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
757
- //TODO this needs "sap.ui2.srvc.utils" which is never required!
758
- oReadRegisteredChipsPromise.fail(fnFailure)
759
- .done(sap.ui2.srvc.call.bind(null, fnSuccess, fnFailure));
760
- };
761
-
762
- /**
763
- * Refreshes the catalog's CHIPs by reading them (again) from the backend. The catalog may be a
764
- * stub before refresh (since 1.19.0), but is not a stub anymore once refresh succeeds.
765
- * <p>
766
- * When a catalog is still a stub, <code>refresh</code> is the same as <code>load</code>. When
767
- * the catalog has been loaded before, <code>refresh</code> fetches only the CHIPs.
768
- *
769
- * @param {function ()} fnSuccess
770
- * no-args success handler
771
- * @param {function (string, object=)} [fnFailure]
772
- * error handler taking an error message and, since version 1.28.6, an
773
- * optional object containing the complete error information as delivered
774
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
775
- * for more details.
776
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
777
- * @since 1.11.0
778
- *
779
- * @see #load
780
- */
781
- this.refresh = function (fnSuccess, fnFailure) {
782
- read(true, fnSuccess, fnFailure);
783
- };
784
-
785
- /**
786
- * Registers a CHIP to be read later via {@link #readRegisteredChips}.
787
- *
788
- * @param {sap.ui2.srvc.Chip} oChip
789
- * the CHIP to be registered
790
- * @since 1.19.0
791
- * @private
792
- */
793
- this.registerChip = function (oChip) {
794
- if (oReadRegisteredChipsPromise && oReadRegisteredChipsPromise.state() === "pending") {
795
- throw new sap.ui2.srvc.Error(
796
- "Invalid state: registerChip while readRegisteredChips pending",
797
- "sap.ui2.srvc.Catalog"
798
- );
799
- }
800
- aRegisteredChipIds.push(oChip.getId());
801
- };
802
-
803
- /**
804
- * Removes this catalog by deleting it within the page building service. Also deletes the
805
- * corresponding catalog page, if applicable (see {@link #getCatalogPage} and
806
- * {@link sap.ui2.srvc.Factory#createNewPageBasedCatalog}).
807
- * <p>
808
- * <b>BEWARE:</b> Do not continue to use this object afterwards!
809
- * <p>
810
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
811
- * not be called if only the catalog's ID is known (see {@link #getCatalogData}) or if the
812
- * catalog is being refreshed currently (see {@link #refresh})!
813
- *
814
- * @param {function ()} [fnSuccess]
815
- * no-args success handler
816
- * @param {function (string, object=)} [fnFailure]
817
- * error handler taking an error message and, since version 1.28.6, an
818
- * optional object containing the complete error information as delivered
819
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
820
- * for more details.
821
- * If not given
822
- * <code>{@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}</code> is used
823
- * @since 1.19.1
824
- */
825
- this.remove = function (fnSuccess, fnFailure) {
826
- checkAlterEgo();
827
- if (oReadPromise && oReadPromise.state() === "pending") {
828
- throw new sap.ui2.srvc.Error("Catalog is being refreshed: " + this,
829
- "sap.ui2.srvc.Catalog");
830
- }
831
-
832
- jQuery.sap.log.debug("Removing: " + this, null, "sap.ui2.srvc.Catalog");
833
- oFactory.getPageBuildingService().deleteCatalog(oAlterEgo, function () {
834
- exit();
835
- fnSuccess();
836
- }, fnFailure);
837
- };
838
-
839
- /**
840
- * Returns this catalog's string representation.
841
- *
842
- * @param {boolean} [bVerbose=false]
843
- * flag whether to show all properties
844
- * @returns {string}
845
- * this catalog's string representation
846
- * @since 1.2.0
847
- */
848
- this.toString = function (bVerbose) {
849
- var aResult = ['sap.ui2.srvc.Catalog({sId:"', sId, '"', ",bIsStub:", bIsStub];
850
- if (bVerbose) {
851
- aResult.push(",oAlterEgo:", JSON.stringify(oAlterEgo),
852
- ",oFactory:", oFactory.toString(bVerbose),
853
- ",aChips:", JSON.stringify(aChips)
854
- );
855
- }
856
- aResult.push("})");
857
- return aResult.join("");
858
- };
859
-
860
- /**
861
- * Updates one or more properties of this catalog in the backend based on the given raw data.
862
- * Properties which are not given keep their current value. Keys cannot be updated this way!
863
- * Note that for a catalog based on a catalog page ({@link #getCatalogPage}), the "title"
864
- * property is shared between the catalog and its corresponding catalog page!
865
- * <p>
866
- * Can safely be called if the catalog itself is not a stub anymore ({@link #isStub}). Must
867
- * not be called if only the catalog's ID is known (see {@link #getCatalogData})!
868
- * <p>
869
- * The catalog becomes a stub immediately. As soon as the update succeeds, the catalog is
870
- * loaded automatically and only after that, the success handler is called.
871
- * It is not wise to keep references to old CHIPs loaded from this catalog before an update
872
- * that changes the catalog's "identity", e.g. the "remoteId" property of a remote catalog.
873
- *
874
- * @param {object} oCatalogData
875
- * any subset of the catalog's properties, e.g.
876
- * <pre>
877
- * {
878
- * baseUrl: "/sap/hba/apps/kpi/s/odata/hana_chip_catalog.xsodata/",
879
- * domainId: "Z_REMOTE_HANA_CATALOG",
880
- * remoteId: "HANA_CATALOG",
881
- * systemAlias: "sanssouci",
882
- * title: "Remote HANA catalog",
883
- * type: "REMOTE"
884
- * }
885
- * </pre>
886
- * @param {function ()} fnSuccess
887
- * no-args success handler
888
- * @param {function (string, object=)} [fnFailure]
889
- * error handler taking an error message and, since version 1.28.6, an
890
- * optional object containing the complete error information as delivered
891
- * by the ODataService. See fnFailure parameter of {@link sap.ui2.srvc.ODataWrapper#onError}
892
- * for more details.
893
- * Default: see {@link sap.ui2.srvc.ODataService#getDefaultErrorHandler}
894
- * @throws Error when trying to update the "__metadata" property.
895
- * @since 1.19.1
896
- *
897
- * @see #getCatalogData
898
- */
899
- this.update = function (oCatalogData, fnSuccess, fnFailure) {
900
- var oNewAlterEgo;
901
-
902
- checkAlterEgo();
903
- if (Object.hasOwnProperty.call(oCatalogData, "__metadata")) {
904
- // sap.ui2.srvc.ODataWrapper#update() relies on __metadata!
905
- throw new sap.ui2.srvc.Error("Unsupported __metadata update", "sap.ui2.srvc.Catalog");
906
- }
907
- oNewAlterEgo = JSON.parse(JSON.stringify(oAlterEgo));
908
- Object.keys(oCatalogData).forEach(function (sName) {
909
- oNewAlterEgo[sName] = oCatalogData[sName];
910
- });
911
-
912
- bIsStub = true;
913
- oCachedRemoteErrorArgs = undefined;
914
-
915
- oFactory.getPageBuildingService().updateCatalog(oNewAlterEgo, function () {
916
- oAlterEgo = oNewAlterEgo; // update head data
917
- read(true, fnSuccess, fnFailure); // if this fails, we are stuck with a stub!
918
- }, function () {
919
- bIsStub = false; // update failed, e.g. wrong properties --> no change to catalog!
920
- fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
921
- fnFailure.apply(null, arguments); // forward call
922
- });
923
- };
924
-
925
- // constructor code -------------------------------------------------------
926
- if (!sap.ui2.srvc.Error) {
927
- fnRequire("sap.ui2.srvc.error");
928
- }
929
- if (typeof vCatalogData === "object") {
930
- // direct creation
931
- sId = vCatalogData.id;
932
- // Robustness: we prefer remoteId over Chips in case there is both
933
- if (vCatalogData.remoteId) {
934
- delete vCatalogData.Chips;
935
- }
936
- oAlterEgo = vCatalogData;
937
- initialize();
938
- } else if (typeof vCatalogData === "string") {
939
- sId = vCatalogData;
940
- }
941
- if (!sId) {
942
- throw new sap.ui2.srvc.Error("Missing ID", "sap.ui2.srvc.Catalog");
943
- }
944
- jQuery.sap.log.debug("Created: " + this, null, "sap.ui2.srvc.Catalog");
945
- };
946
- }());