@sapui5/sap.ushell_abap 1.94.0 → 1.96.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 (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 +438 -398
  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 +704 -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 +933 -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 +30 -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
@@ -0,0 +1,920 @@
1
+ // Copyright (c) 2009-2021 SAP SE. All rights reserved.
2
+
3
+ /**
4
+ * @fileOverview A wrapper for a page loaded from the page building service.
5
+ */
6
+
7
+ this.sap = this.sap || {};
8
+
9
+ sap.ui.define([
10
+ "sap/ushell_abap/pbServices/ui2/Bag",
11
+ "sap/ushell_abap/pbServices/ui2/AllCatalogs",
12
+ "sap/ushell_abap/pbServices/ui2/Utils",
13
+ "sap/ushell_abap/pbServices/ui2/Error",
14
+ "sap/base/Log"
15
+ ], function (
16
+ Bag,
17
+ AllCatalogs,
18
+ Utils,
19
+ SrvcError,
20
+ Log
21
+ ) {
22
+ "use strict";
23
+
24
+
25
+ // "public class" ************************************************************
26
+
27
+ /**
28
+ * Constructs a new representation (wrapper) of the page with the given ID
29
+ * or the given page data to be loaded from the given factory's page building
30
+ * service. Associated CHIP instances (see {@link sap.ushell_abap.pbServices.ui2.ChipInstance}), catalogs (see
31
+ * {@link sap.ushell_abap.pbServices.ui2.Catalog} and {@link sap.ushell_abap.pbServices.ui2.AllCatalogs}), and bags (see
32
+ * {@link sap.ushell_abap.pbServices.ui2.Bag}) are also constructed.
33
+ * <p>
34
+ * Initially a stub is created, which can later load its properties and related objects
35
+ * asynchronously.
36
+ *<p>
37
+ * A page is a mutable object and changes can be persisted by the page building service.
38
+ *
39
+ * @param {sap.ushell_abap.pbServices.ui2.Factory} oFactory
40
+ * the factory
41
+ * @param {string|object} vPageData
42
+ * the page's ID or its page data as loaded via page building service
43
+ *
44
+ * @class
45
+ * @since 1.2.0
46
+ * @see sap.ushell_abap.pbServices.ui2.PageBuildingService
47
+ */
48
+ var Page = function (oFactory, vPageData) {
49
+ var sId, // the page ID
50
+ oAllCatalogs,
51
+ oAlterEgo, // page's representation with all relations removed
52
+ mBags,
53
+ oCatalog, // created on demand
54
+ aChipInstances = [],
55
+ bIsLoadingBagsOnDemand = true,
56
+ bIsStub = true,
57
+ that = this;
58
+
59
+ // BEWARE: constructor code below!
60
+
61
+ // "private" methods ---------------------------------------------------------
62
+
63
+ /**
64
+ * Makes sure the given page is not just a stub.
65
+ *
66
+ * @private
67
+ */
68
+ function checkStub () {
69
+ if (bIsStub) {
70
+ throw new SrvcError(that + ": page is just a stub", "Page");
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Initializes the page when the alter ego is known
76
+ * @param {object} oNewAlterEgo
77
+ * the page data as loaded via page building service
78
+ *
79
+ * @private
80
+ */
81
+ function initialize (oNewAlterEgo) {
82
+ var i,
83
+ bBagsLoaded = !!(oNewAlterEgo.Bags && oNewAlterEgo.Bags.results),
84
+ aRawBags = bBagsLoaded ? oNewAlterEgo.Bags.results : [],
85
+ aRawChipInstances
86
+ = (oNewAlterEgo.PageChipInstances && oNewAlterEgo.PageChipInstances.results) || [],
87
+ iBagCount = aRawBags.length,
88
+ iChipInstanceCount = aRawChipInstances.length;
89
+
90
+ bIsLoadingBagsOnDemand = !bBagsLoaded;
91
+ // remove relations and store page representation
92
+ delete oNewAlterEgo.Bags;
93
+ delete oNewAlterEgo.Catalog;
94
+ delete oNewAlterEgo.PageChipInstances;
95
+ oAlterEgo = oNewAlterEgo;
96
+ bIsStub = false;
97
+
98
+ for (i = 0; i < iBagCount; i += 1) {
99
+ // for each bag instance: create wrapper
100
+ mBags.put(aRawBags[i].id, new Bag(oFactory, aRawBags[i]));
101
+ }
102
+
103
+ // create CHIP instances
104
+ for (i = 0; i < iChipInstanceCount; i += 1) {
105
+ // for each CHIP instance: create wrapper
106
+ aChipInstances[i] = oFactory.createChipInstance(aRawChipInstances[i], null, null, that);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Persists this page.
112
+ *
113
+ * @param {function ()} fnSuccess
114
+ * no-args success handler
115
+ * @param {function (string, object=)} [fnFailure]
116
+ * error handler taking an error message and, since version 1.28.6, an
117
+ * optional object containing the complete error information as delivered
118
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
119
+ * for more details.
120
+ * If not given
121
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
122
+ *
123
+ * @private
124
+ */
125
+ function persist (fnSuccess, fnFailure) {
126
+ oFactory.getPageBuildingService().updatePage(oAlterEgo,
127
+ function (oRawPage) {
128
+ that.updateScope();
129
+ if (fnSuccess) {
130
+ fnSuccess(); // no-args!
131
+ }
132
+ }, fnFailure);
133
+ }
134
+
135
+ // "public" methods ----------------------------------------------------------
136
+
137
+ /**
138
+ * Adds a new instance for the given CHIP to this page and loads that CHIP
139
+ * instance completely unless requested otherwise. Can only be called if the page is not a stub
140
+ * anymore.
141
+ * <p>
142
+ * Note: Does not affect this page's layout.
143
+ *
144
+ * @param {sap.ushell_abap.pbServices.ui2.Chip|sap.ushell_abap.pbServices.ui2.ChipInstance} vTemplate
145
+ * the CHIP (or stub) which is to be used; (since 1.11.0) alternatively a CHIP instance, in
146
+ * this case a new CHIP instance is created referring to the same CHIP and having the same
147
+ * title and configuration. The layout data will not be copied. It is up to the caller to
148
+ * update that value.
149
+ * No bags will be copied!
150
+ * @param {function (sap.ushell_abap.pbServices.ui2.ChipInstance)} fnSuccess
151
+ * success handler, taking the newly created CHIP instance which knows its page
152
+ * @param {function (string, object=)} [fnFailure]
153
+ * error handler taking an error message and, since version 1.28.6, an
154
+ * optional object containing the complete error information as delivered
155
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
156
+ * for more details.
157
+ * If not given
158
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
159
+ * @param {boolean} [bPartially=false]
160
+ * whether to create the new CHIP instance as a stub only
161
+ * @since 1.2.0
162
+ *
163
+ * @throws Error if the page is still a stub
164
+ * @see #isStub()
165
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getPage
166
+ */
167
+ this.addChipInstance = function (vTemplate, fnSuccess, fnFailure, bPartially) {
168
+ var oPbs = oFactory.getPageBuildingService(),
169
+ oChip,
170
+ oChipInstance;
171
+
172
+ function update (oRawChipInstance) {
173
+ var oChipInstance = oFactory.createChipInstance(oRawChipInstance,
174
+ bPartially ? null : fnSuccess, fnFailure, that);
175
+ aChipInstances.push(oChipInstance);
176
+ that.updateScope();
177
+
178
+ if (bPartially) {
179
+ fnSuccess(oChipInstance);
180
+ }
181
+ }
182
+
183
+ checkStub();
184
+ if (vTemplate.getChip) {
185
+ oChipInstance = vTemplate;
186
+ oChip = oChipInstance.getChip();
187
+ } else {
188
+ oChip = vTemplate;
189
+ }
190
+ if (oChip.getRemoteCatalog()) {
191
+ oPbs.createPageChipInstanceFromRawData({
192
+ pageId: oAlterEgo.id,
193
+ chipId: oChip.getId(),
194
+ configuration: (oChipInstance && oChipInstance.getConfiguration()) || "",
195
+ // layoutData will not be copied, it is up to the page builder to update that value
196
+ title: oChipInstance && oChipInstance.getTitle(),
197
+ remoteCatalogId: oChip.getRemoteCatalog().getId()
198
+ }, update, fnFailure);
199
+ } else {
200
+ oPbs.createPageChipInstance(oAlterEgo.id, /*sInstanceId*/null, oChip.getId(),
201
+ oChipInstance && oChipInstance.getTitle(),
202
+ (oChipInstance && oChipInstance.getConfiguration()) || "",
203
+ // layoutData will not be copied, it is up to the page builder to update that value
204
+ /*sLayoutData*/"",
205
+ update, fnFailure);
206
+ }
207
+ };
208
+
209
+ /**
210
+ * Adds a new CHIP instance to this page which refers to the given original CHIP instance and
211
+ * loads the reference completely if and only if the original is not a stub anymore.
212
+ * Can only be called if this page is not a stub anymore.
213
+ * <p>
214
+ * Note: Does not affect this page's layout.
215
+ *
216
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oOriginal
217
+ * the CHIP instance (or stub) to refer to (which MUST know its page)
218
+ * @param {function (sap.ushell_abap.pbServices.ui2.ChipInstance)} fnSuccess
219
+ * success handler, taking the newly created reference which knows its page
220
+ * @param {function (string, object=)} [fnFailure]
221
+ * error handler taking an error message and, since version 1.28.6, an
222
+ * optional object containing the complete error information as delivered
223
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
224
+ * for more details.
225
+ * If not given
226
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
227
+ * @since 1.21.1
228
+ *
229
+ * @throws Error if the page is still a stub
230
+ * @see #isStub()
231
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getPage
232
+ */
233
+ this.addChipInstanceReference = function (oOriginal, fnSuccess, fnFailure) {
234
+ var oPbs = oFactory.getPageBuildingService();
235
+
236
+ function update (oRawChipInstance) {
237
+ var oChipInstance = oFactory.createChipInstance(oRawChipInstance,
238
+ oOriginal.isStub() ? null : fnSuccess, fnFailure, that);
239
+
240
+ aChipInstances.push(oChipInstance);
241
+ // that.updateScope() is currently not necessary as this is a feature for catalog pages
242
+ // and they are not maintained on scope PERS.
243
+ // Scope changes from CONF -> CUST are not tracked
244
+
245
+ if (oOriginal.isStub()) {
246
+ fnSuccess(oChipInstance);
247
+ }
248
+ }
249
+
250
+ checkStub();
251
+ oPbs.clonePageChipInstance(oOriginal.getPage().getId(), oOriginal.getId(), this.getId(),
252
+ update, fnFailure);
253
+ };
254
+
255
+ /**
256
+ * Releases all resources associated with this page. Call this method
257
+ * just before you stop using it.
258
+ *
259
+ * @since 1.2.0
260
+ */
261
+ this.exit = function () {
262
+ var i, n;
263
+
264
+ Log.debug("Exiting: " + this, null, "Page");
265
+ // exit children
266
+ for (i = 0, n = aChipInstances.length; i < n; i += 1) {
267
+ aChipInstances[i].exit();
268
+ }
269
+ // reset to initial state
270
+ oAlterEgo = null; // page's representation with all relations removed
271
+ mBags = new Utils.Map(); // all bags removed
272
+ oCatalog = null; // created on demand
273
+ aChipInstances = [];
274
+ bIsStub = true;
275
+ Log.debug("Exited: " + this, null, "Page");
276
+ };
277
+
278
+ /**
279
+ * Returns this page's collection of all catalogs, which might still be a stub.
280
+ * <p>
281
+ * <b>Note:</b> Returns <code>undefined</code> in case the JavaScript file for
282
+ * <code>AllCatalogs</code> has not been included!
283
+ *
284
+ * @returns {sap.ushell_abap.pbServices.ui2.AllCatalogs}
285
+ * this page's collection of all catalogs
286
+ * @since 1.7.0
287
+ */
288
+ this.getAllCatalogs = function () {
289
+ if (!oAllCatalogs) {
290
+ oAllCatalogs = new AllCatalogs(oFactory, sId);
291
+ }
292
+ return oAllCatalogs;
293
+ };
294
+
295
+ /**
296
+ * Returns an array of bag IDs attached to this page.
297
+ *
298
+ * @returns {string[]}
299
+ * array of bag IDs
300
+ * @since 1.3.0
301
+ */
302
+ this.getBagIds = function () {
303
+ if (bIsLoadingBagsOnDemand) {
304
+ throw new SrvcError(that + ": page is just a stub, load bags on demand",
305
+ "Page");
306
+ }
307
+ return mBags.keys();
308
+ };
309
+
310
+ /**
311
+ * Returns the property bag with given ID attached to this page.
312
+ * <p>
313
+ * If there is no bag with that ID an empty bag is returned.
314
+ *
315
+ * @param {string} sBagId
316
+ * the bag ID
317
+ *
318
+ * @returns {sap.ushell_abap.pbServices.ui2.Bag}
319
+ * the page's bag for given ID
320
+ * @since 1.3.0
321
+ */
322
+ this.getBag = function (sBagId) {
323
+ var oBag;
324
+
325
+ if (bIsLoadingBagsOnDemand) {
326
+ throw new SrvcError(that + ": page is just a stub, load bags on demand",
327
+ "Page");
328
+ }
329
+
330
+ if (!sBagId) {
331
+ throw new SrvcError("Missing bag ID", "Page");
332
+ }
333
+
334
+ if (mBags.containsKey(sBagId)) {
335
+ return mBags.get(sBagId);
336
+ }
337
+
338
+ oBag = new Bag(oFactory, { pageId: this.getId(), id: sBagId, $tmp: true });
339
+ mBags.put(sBagId, oBag);
340
+ return oBag;
341
+ };
342
+
343
+ /**
344
+ * Asynchronously get the property bag with given ID attached to this page. If that bag has not
345
+ * yet been loaded the bag is loaded first.
346
+ * <p>
347
+ * The <code>done</code> function will be called with a <code>sap.ushell_abap.pbServices.ui2.Bag</code> instance.
348
+ * If there was no such bag an empty <code>sap.ushell_abap.pbServices.ui2.Bag</code> is passed.
349
+ *
350
+ * @param {string} sBagId
351
+ * the bag ID
352
+ *
353
+ * @returns {object}
354
+ * jQuery.promise object
355
+ * @since 1.11.0
356
+ */
357
+ this.loadBag = function (sBagId) {
358
+ var oDeferred;
359
+
360
+ if (!sBagId) {
361
+ throw new SrvcError("Missing bag ID", "Page");
362
+ }
363
+
364
+ if (mBags.containsKey(sBagId)) {
365
+ oDeferred = mBags.get(sBagId);
366
+ } else {
367
+ oDeferred = new jQuery.Deferred();
368
+ mBags.put(sBagId, oDeferred);
369
+ oFactory.getPageBuildingService().readBag(sId, sBagId, function (oRawBag) {
370
+ oDeferred.resolve(new Bag(oFactory, oRawBag));
371
+ }, function () {
372
+ oDeferred.resolve(new Bag(oFactory, { pageId: sId, id: sBagId, $tmp: true }));
373
+ });
374
+ }
375
+ return oDeferred.promise();
376
+ };
377
+
378
+ /**
379
+ * Returns this page's catalog, which might still be a stub. Can only be called if the page
380
+ * itself is not a stub anymore.
381
+ *
382
+ * @returns {sap.ushell_abap.pbServices.ui2.Catalog}
383
+ * this page's catalog or <code>undefined</code> if the page has no catalog
384
+ * @since 1.2.0
385
+ *
386
+ * @throws Error if the page is still a stub
387
+ * @see #isStub()
388
+ */
389
+ this.getCatalog = function () {
390
+ checkStub();
391
+ if (!oCatalog && oAlterEgo.catalogId) {
392
+ oCatalog = oFactory.createCatalog(oAlterEgo.catalogId);
393
+ }
394
+ return oCatalog;
395
+ };
396
+
397
+ /**
398
+ * Returns this page's CHIP instances. Can only be called if the page is not a stub anymore.
399
+ *
400
+ * @returns {sap.ushell_abap.pbServices.ui2.ChipInstance[]}
401
+ * this page's CHIP instances
402
+ * @since 1.2.0
403
+ *
404
+ * @throws Error if the page is still a stub
405
+ * @see #isStub()
406
+ */
407
+ this.getChipInstances = function () {
408
+ checkStub();
409
+ return aChipInstances.slice();
410
+ };
411
+
412
+ /**
413
+ * Returns this page's ID.
414
+ *
415
+ * @returns {string}
416
+ * this page's ID
417
+ * @since 1.2.0
418
+ */
419
+ this.getId = function () {
420
+ return sId;
421
+ };
422
+
423
+ /**
424
+ * Returns the layout for this page. Can only be called if the page is not a stub anymore.
425
+ *
426
+ * @returns {string}
427
+ * the layout for this page
428
+ * @since 1.2.0
429
+ *
430
+ * @throws Error if the page is still a stub
431
+ * @see #isStub()
432
+ */
433
+ this.getLayout = function () {
434
+ checkStub();
435
+ return oAlterEgo.layout;
436
+ };
437
+
438
+ /**
439
+ * Sets the layout (encoded as a string, for example in JSON) for this page and persists it.
440
+ * Can only be called if the page is not a stub anymore.
441
+ *
442
+ * @param {string} sLayout
443
+ * the new layout
444
+ * @param {function ()} fnSuccess
445
+ * no-args success handler
446
+ * @param {function (string, object=)} [fnFailure]
447
+ * error handler taking an error message and, since version 1.28.6, an
448
+ * optional object containing the complete error information as delivered
449
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
450
+ * for more details.
451
+ * If not given
452
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
453
+ * @since 1.2.0
454
+ *
455
+ * @throws Error if the page is still a stub
456
+ * @see #isStub()
457
+ */
458
+ this.setLayout = function (sLayout, fnSuccess, fnFailure) {
459
+ checkStub();
460
+ if (oAlterEgo.layout === sLayout) {
461
+ if (fnSuccess) {
462
+ fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
463
+ Utils.callHandler(fnSuccess, fnFailure, true);
464
+ }
465
+ return;
466
+ }
467
+ oAlterEgo.layout = sLayout;
468
+ persist(fnSuccess, fnFailure);
469
+ };
470
+
471
+ /**
472
+ * Returns this page's original language (in which the page has been created) as BCP-47.
473
+ * If you are logged on in the same language or if the original language is empty, translatable
474
+ * texts can be created and modified on this page and its bags. The same is valid for the
475
+ * page's CHIP instances and their bags. See {@link sap.ushell_abap.pbServices.ui2.Bag#setText}.
476
+ * <p>
477
+ * Note: Handling of translatable texts depends on the layer used. In some layers the original
478
+ * language is important; in others it does not matter. In the latter case the empty string
479
+ * (<code>""</code>) is returned, which indicates that the user is allowed to edit the
480
+ * translatable texts in any language.
481
+ * <p>
482
+ * The following code is a flexible way of checking the current situation without knowing the
483
+ * current language or layer:
484
+ * <pre>
485
+ * if (oPage.getOriginalLanguage() === "" ||
486
+ * oPage.getOriginalLanguage() === sap.ui.getCore().getConfiguration().getLanguage()) {
487
+ * // create and modify the page's texts
488
+ * }
489
+ * </pre>
490
+ * <p>
491
+ * This method is intended to be only called in a design time use case.
492
+ * Can only be called if the page is not a stub anymore.
493
+ *
494
+ * @returns {string}
495
+ * this page's original language (BCP-47) or <code>""</code>
496
+ * @since 1.17.1
497
+ *
498
+ * @throws Error if the page is still a stub
499
+ * @see #isStub()
500
+ */
501
+ this.getOriginalLanguage = function () {
502
+ checkStub();
503
+ return oAlterEgo.originalLanguage;
504
+ };
505
+
506
+ /**
507
+ * Returns this page's scope. This method is intended to be only called on catalog pages (see
508
+ * {@link sap.ushell_abap.pbServices.ui2.Catalog#getCatalogPage}), so only in a design time use case.
509
+ * If you want to check if the page has been personalized (so in a runtime use case) you should
510
+ * rather use {@link #isPersonalized}.
511
+ * Can only be called if the page is not a stub anymore.
512
+ *
513
+ * @returns {string}
514
+ * returns "PERSONALIZATION", "CUSTOMIZATION" or "CONFIGURATION".
515
+ * @since 1.34.0
516
+ *
517
+ * @throws Error if the page is still a stub
518
+ * @see #isStub()
519
+ * @see #isPersonalized()
520
+ */
521
+ this.getScope = function () {
522
+ checkStub();
523
+ return oAlterEgo.scope;
524
+ };
525
+
526
+ /**
527
+ * Returns this page's title. Can only be called if the page is not a stub anymore.
528
+ *
529
+ * @returns {string}
530
+ * this page's title
531
+ * @since 1.2.0
532
+ *
533
+ * @throws Error if the page is still a stub
534
+ * @see #isStub()
535
+ */
536
+ this.getTitle = function () {
537
+ checkStub();
538
+ return oAlterEgo.title;
539
+ };
540
+
541
+ /**
542
+ * Sets the title for this page and persists it. Can only be called if the page is not a stub
543
+ * anymore.
544
+ *
545
+ * @param {string} sTitle
546
+ * the new title
547
+ * @param {function ()} fnSuccess
548
+ * no-args success handler
549
+ * @param {function (string, object=)} [fnFailure]
550
+ * error handler taking an error message and, since version 1.28.6, an
551
+ * optional object containing the complete error information as delivered
552
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
553
+ * for more details.
554
+ * If not given
555
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
556
+ * @since 1.2.0
557
+ *
558
+ * @throws Error if the page is still a stub
559
+ * @see #getOriginalLanguage()
560
+ * @see #isStub()
561
+ */
562
+ this.setTitle = function (sTitle, fnSuccess, fnFailure) {
563
+ checkStub();
564
+ if (oAlterEgo.title === sTitle) {
565
+ if (fnSuccess) {
566
+ fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
567
+ Utils.callHandler(fnSuccess, fnFailure, true);
568
+ }
569
+ return;
570
+ }
571
+ oAlterEgo.title = sTitle;
572
+ persist(fnSuccess, fnFailure);
573
+ };
574
+
575
+ /**
576
+ * Tells whether this page is a catalog page (see {@link sap.ushell_abap.pbServices.ui2.Catalog#getCatalogPage}
577
+ * and {@link sap.ushell_abap.pbServices.ui2.Factory#createNewPageBasedCatalog}).
578
+ * This method is intended to be only called in a design time use case.
579
+ * Can only be called if the page is not a stub anymore (see {@link #isStub}).
580
+ *
581
+ * @returns {boolean}
582
+ * whether this page is a catalog page
583
+ * @since 1.19.1
584
+
585
+ * @throws Error if the page is still a stub
586
+ * @see #isStub()
587
+ */
588
+ this.isCatalogPage = function () {
589
+ checkStub();
590
+ return oAlterEgo.isCatalogPage === "X";
591
+ };
592
+
593
+ /**
594
+ * Tells whether this page can be altered on Personalization scope or not. Can only be called
595
+ * if the page is not a stub anymore.
596
+ *
597
+ * @returns {boolean}
598
+ * true if this page is locked and false if not
599
+ * @since 1.25.0
600
+ *
601
+ * @throws Error if the page is still a stub
602
+ * @see #isStub()
603
+ */
604
+ this.isPersonalizationLocked = function () {
605
+ checkStub();
606
+ return oAlterEgo.isPersLocked === "X";
607
+ };
608
+
609
+ /**
610
+ * Determines and persists the locking status of a page which determines if
611
+ * a page can be altered on Personalization scope or not.
612
+ * This method is intended to be only called in a design time use case.
613
+ * Can only be called if the page is not a stub anymore.
614
+ *
615
+ * @param {boolean} bIsPersLocked
616
+ * Desired locking status
617
+ * @param {function ()} fnSuccess
618
+ * no-args success handler
619
+ * @param {function (string, object=)} [fnFailure]
620
+ * error handler taking an error message and, since version 1.28.6, an
621
+ * optional object containing the complete error information as delivered
622
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
623
+ * for more details.
624
+ * If not given
625
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
626
+ * @since 1.25.0
627
+ *
628
+ * @throws Error if the page is still a stub
629
+ * @see #isStub()
630
+ */
631
+ this.setPersonalizationLocked = function (bIsPersLocked, fnSuccess, fnFailure) {
632
+ checkStub();
633
+
634
+ if (oFactory.getPageBuildingService().isPersonalization()) {
635
+ throw new SrvcError(
636
+ "Personalization locking cannot be changed at personalization scope",
637
+ "Page"
638
+ );
639
+ }
640
+
641
+ if ((oAlterEgo.isPersLocked === "X" && bIsPersLocked)
642
+ || (oAlterEgo.isPersLocked !== "X" && !bIsPersLocked)) {
643
+ if (fnSuccess) {
644
+ fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
645
+ Utils.callHandler(fnSuccess, fnFailure, true);
646
+ }
647
+ return;
648
+ }
649
+
650
+ oAlterEgo.isPersLocked = bIsPersLocked ? "X" : " ";
651
+
652
+ persist(fnSuccess, fnFailure);
653
+ };
654
+
655
+ /**
656
+ * Tells whether this page is marked as outdated.
657
+ * This method is intended to be only called in a design time use case.
658
+ * Can only be called if the page is not a stub anymore.
659
+ *
660
+ * @returns {boolean}
661
+ * whether this page is marked as outdated
662
+ * @since 1.7.0
663
+ *
664
+ * @throws Error if the page is still a stub
665
+ * @see #isStub()
666
+ */
667
+ this.isOutdated = function () {
668
+ checkStub();
669
+ return oAlterEgo.outdated === "X";
670
+ };
671
+
672
+ /**
673
+ * Tells whether this page is read-only. Can only be called if the page is not a stub anymore.
674
+ *
675
+ * @returns {boolean}
676
+ * true if this page is read-only
677
+ * @since 1.32.0
678
+ *
679
+ * @throws Error if the page is still a stub
680
+ * @see #isStub()
681
+ */
682
+ this.isReadOnly = function () {
683
+ checkStub();
684
+ return oAlterEgo.isReadOnly === "X";
685
+ };
686
+
687
+ /**
688
+ * Tells whether this page was originally read from 'PERSONALIZATION' scope or was modified in
689
+ * a way that had copied the page to that scope. Such modifications include changes of layout
690
+ * data and changes to CHIP instances, but not to property bags.
691
+ * This method is intended to be only called in a runtime use case.
692
+ * Can only be called if the page is not a stub anymore.
693
+ *
694
+ * @returns {boolean}
695
+ * whether this page is personalized
696
+ * @since 1.16.1
697
+ *
698
+ * @throws Error if the page is still a stub
699
+ * @see #isStub()
700
+ * @see #addChipInstance()
701
+ * @see #removeChipInstance()
702
+ * @see #setLayout()
703
+ * @see #setTitle()
704
+ */
705
+ this.isPersonalized = function () {
706
+ checkStub();
707
+ return oAlterEgo.scope === "PERSONALIZATION";
708
+ };
709
+
710
+ /**
711
+ * Tells whether this page is still only a stub and does not yet know its properties or related
712
+ * objects, for example layout, title, catalog, or CHIP instances.
713
+ *
714
+ * @returns {boolean}
715
+ * whether this page is still only a stub
716
+ * @since 1.2.0
717
+ *
718
+ * @see #load()
719
+ */
720
+ this.isStub = function () {
721
+ return bIsStub;
722
+ };
723
+
724
+ /**
725
+ * Loads the current page including its layout, title, (stub) catalog, and CHIP instances (see
726
+ * <code>bPartially</code> parameter). Notifies one of the given handlers. All CHIP instances
727
+ * know their page, see {@link sap.ushell_abap.pbServices.ui2.ChipInstance#getPage}.
728
+ * <p>
729
+ * Note: Preferably, CHIP instances should be loaded individually as needed (e.g. as they
730
+ * become visible).
731
+ *
732
+ * @param {function ()} fnSuccess
733
+ * no-args success handler
734
+ * @param {function (string, object=)} [fnFailure]
735
+ * error handler taking an error message and, since version 1.28.6, an
736
+ * optional object containing the complete error information as delivered
737
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
738
+ * for more details.
739
+ * If not given
740
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
741
+ * @param {boolean} [bPartially=false]
742
+ * whether to load the page only partially (instead of completely, including its CHIP
743
+ * instances)
744
+ * @since 1.2.0
745
+ */
746
+ this.load = function (fnSuccess, fnFailure, bPartially) {
747
+ var iAsyncCount;
748
+
749
+ if (!bIsStub) {
750
+ throw new SrvcError("Page is not a stub anymore", "Page");
751
+ }
752
+
753
+ function checkDone () {
754
+ if (iAsyncCount === 0) {
755
+ // all async operations done, call success handler
756
+ Log.debug("Initialized: " + that, null, "Page");
757
+ fnSuccess();
758
+ }
759
+ }
760
+
761
+ function onLoad () {
762
+ iAsyncCount -= 1;
763
+ checkDone();
764
+ }
765
+
766
+ oFactory.getPageBuildingService().readPage(sId,
767
+ function (oNewAlterEgo) {
768
+ var i,
769
+ aRawChipInstances
770
+ = (oNewAlterEgo.PageChipInstances && oNewAlterEgo.PageChipInstances.results) || [],
771
+ iChipInstanceCount = aRawChipInstances.length;
772
+
773
+ Log.debug("Loaded: " + that, null, "Page");
774
+ initialize(oNewAlterEgo);
775
+
776
+ iAsyncCount = bPartially ? 0 : iChipInstanceCount;
777
+ if (!bPartially) {
778
+ for (i = 0; i < iChipInstanceCount; i += 1) {
779
+ aChipInstances[i].load(onLoad, fnFailure);
780
+ }
781
+ }
782
+ checkDone();
783
+ }, fnFailure);
784
+ };
785
+
786
+ /**
787
+ * Removes (in other words, deletes) this page from the page building service.
788
+ *
789
+ * @param {function ()} fnSuccess
790
+ * no-args success handler
791
+ * @param {function (string, object=)} [fnFailure]
792
+ * error handler taking an error message and, since version 1.28.6, an
793
+ * optional object containing the complete error information as delivered
794
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
795
+ * for more details.
796
+ * If not given
797
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
798
+ * @since 1.2.0
799
+ */
800
+ this.remove = function (fnSuccess, fnFailure) {
801
+ this.exit();
802
+ oFactory.getPageBuildingService().deletePage(sId, fnSuccess, fnFailure);
803
+ };
804
+
805
+ /**
806
+ * Removes the given page CHIP instance from this page's collection of CHIP instances, calls
807
+ * the instance's <code>remove()</code> method and returns <code>true</code>.
808
+ * If the given page CHIP instance does not belong to this page (any more), <code>false</code>
809
+ * is returned and nothing else happens.
810
+ * Can only be called if the page is not a stub anymore.
811
+ *
812
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
813
+ * the CHIP instance to remove from this page
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.ushell_abap.pbServices.ui2.ODataWrapper#onError}
820
+ * for more details.
821
+ * If not given
822
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
823
+ * @returns {boolean}
824
+ * <code>true</code> iff. the given CHIP instance's <code>remove()</code> method has been
825
+ * called
826
+ * @since 1.9.0
827
+ *
828
+ * @throws Error if the page is still a stub
829
+ * @see #isStub()
830
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#getPage
831
+ * @see sap.ushell_abap.pbServices.ui2.ChipInstance#remove
832
+ */
833
+ this.removeChipInstance = function (oChipInstance, fnSuccess, fnFailure) {
834
+ var i = aChipInstances.indexOf(oChipInstance);
835
+
836
+ checkStub();
837
+ if (i >= 0) {
838
+ // remove to avoid endless loops
839
+ aChipInstances.splice(i, 1);
840
+
841
+ oChipInstance.remove(function () {
842
+ that.updateScope();
843
+ if (fnSuccess) {
844
+ fnSuccess.apply(this, arguments);
845
+ }
846
+ }, function () {
847
+ // reinsert CHIP instance because backend call failed
848
+ aChipInstances.splice(i, 0, oChipInstance);
849
+ fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
850
+ fnFailure.apply(this, arguments);
851
+ });
852
+
853
+ return true;
854
+ }
855
+
856
+ return false;
857
+ };
858
+
859
+ /**
860
+ * Returns this page's string representation.
861
+ *
862
+ * @param {boolean} [bVerbose=false]
863
+ * flag whether to show all properties
864
+ * @returns {string}
865
+ * this page's string representation
866
+ * @since 1.2.0
867
+ */
868
+ this.toString = function (bVerbose) {
869
+ var aResult = ['Page({sId:"', sId, '",bIsStub:', bIsStub,
870
+ ",bIsLoadingBagsOnDemand:", bIsLoadingBagsOnDemand];
871
+ if (bVerbose) {
872
+ aResult.push(",oAlterEgo:", JSON.stringify(oAlterEgo),
873
+ ",oCatalog:", oCatalog ? oCatalog.toString(bVerbose) : oCatalog,
874
+ ",oFactory:", oFactory.toString(bVerbose),
875
+ ",aChipInstances:", JSON.stringify(aChipInstances)
876
+ );
877
+ }
878
+ aResult.push("})");
879
+ return aResult.join("");
880
+ };
881
+
882
+ /**
883
+ * Changes to pages on CUSTOMIZING or CONFIGURATION scope will create a page copy on scope
884
+ * PERSONALIZATION automatically in the backend; thus we update the scope accordingly.
885
+ * Note: Can also be called by CHIP instances in case they are modified.
886
+ *
887
+ * @since 1.16.1
888
+ * @private
889
+ * @see #isPersonalized
890
+ */
891
+ this.updateScope = function () {
892
+ if (oFactory.getPageBuildingService().isPersonalization()) {
893
+ oAlterEgo.scope = "PERSONALIZATION";
894
+ }
895
+ };
896
+
897
+ // constructor code -------------------------------------------------------
898
+ if (typeof vPageData === "object") {
899
+ // direct creation
900
+ sId = vPageData.id;
901
+ initialize(vPageData);
902
+ } else if (typeof vPageData === "string") {
903
+ sId = vPageData;
904
+ }
905
+ if (!sId) {
906
+ throw new SrvcError("Missing ID", "Page");
907
+ }
908
+ mBags = new Utils.Map();
909
+ Log.debug("Created: " + this, null, "Page");
910
+ };
911
+
912
+ // TODO remove when SSB is adapted (uses this module in global namespace)
913
+ if (jQuery && jQuery.sap) { // true only in FLPD case
914
+ jQuery.sap.declare("sap.ui2.srvc.chip");
915
+ jQuery.sap.declare("sap.ui2.srvc.Chip");
916
+ sap.ui2.srvc.Page = sap.ui2.srvc.page = Page;
917
+ }
918
+
919
+ return Page;
920
+ }, true);