@sapui5/sap.ushell_abap 1.94.1 → 1.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/package.json +1 -1
  2. package/src/main/js/sap/ui2/srvc/ODataWrapper.js +1 -1
  3. package/src/main/js/sap/ushell_abap/.library +4 -9
  4. package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +12 -5
  5. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +11 -7
  6. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +47 -32
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
  8. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +46 -38
  9. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +574 -454
  10. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
  11. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +25 -15
  12. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +3 -2
  13. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +16 -7
  14. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
  15. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +8 -8
  16. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
  17. package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +11 -4
  18. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +9 -3
  19. package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +13 -11
  20. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def-dev.js +1 -1
  21. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def.js +1 -1
  22. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +8 -4
  23. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
  24. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.constants.js +9 -0
  25. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.get.server.config.Urls.js +12 -5
  26. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.load.launchpad.js +21 -22
  27. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +8 -2
  28. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.server.config.js +6 -3
  29. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +10 -5
  30. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.ui5.boot.handler.js +7 -4
  31. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.xhr.handler.js +10 -3
  32. package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +21 -16
  33. package/src/main/js/sap/ushell_abap/library.js +2 -2
  34. package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +186 -0
  35. package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +718 -0
  36. package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +930 -0
  37. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +1027 -0
  38. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +216 -0
  39. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +951 -0
  40. package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +45 -0
  41. package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +647 -0
  42. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +251 -0
  43. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1262 -0
  44. package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +920 -0
  45. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +1498 -0
  46. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +466 -0
  47. package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +52 -0
  48. package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +767 -0
  49. package/src/main/js/sap/ushell_abap/pbServices/ui2/chipdefinition.xsd +139 -0
  50. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +244 -0
  51. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/bag.js +150 -0
  52. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +165 -0
  53. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +330 -0
  54. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/fullscreen.js +70 -0
  55. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/navigation.js +50 -0
  56. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/preview.js +289 -0
  57. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/refresh.js +43 -0
  58. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/search.js +115 -0
  59. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/types.js +9 -0
  60. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/url.js +105 -0
  61. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +128 -0
  62. package/ui5.yaml +31 -0
  63. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/Component.js +0 -426
  64. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/css/style.css +0 -1
  65. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n.properties +0 -56
  66. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ar.properties +0 -36
  67. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_bg.properties +0 -36
  68. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ca.properties +0 -36
  69. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cs.properties +0 -36
  70. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cy.properties +0 -36
  71. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_da.properties +0 -36
  72. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_de.properties +0 -36
  73. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_el.properties +0 -36
  74. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en.properties +0 -36
  75. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_GB.properties +0 -36
  76. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_sappsd.properties +0 -36
  77. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saprigi.properties +0 -36
  78. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saptrc.properties +0 -36
  79. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es.properties +0 -36
  80. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es_MX.properties +0 -36
  81. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_et.properties +0 -36
  82. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fi.properties +0 -36
  83. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr.properties +0 -36
  84. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr_CA.properties +0 -36
  85. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hi.properties +0 -36
  86. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hr.properties +0 -36
  87. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hu.properties +0 -36
  88. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_id.properties +0 -36
  89. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_it.properties +0 -36
  90. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_iw.properties +0 -36
  91. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ja.properties +0 -36
  92. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_kk.properties +0 -36
  93. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ko.properties +0 -36
  94. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lt.properties +0 -36
  95. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lv.properties +0 -36
  96. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ms.properties +0 -36
  97. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_nl.properties +0 -36
  98. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_no.properties +0 -36
  99. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pl.properties +0 -36
  100. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt.properties +0 -36
  101. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt_PT.properties +0 -36
  102. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ro.properties +0 -36
  103. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ru.properties +0 -36
  104. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sh.properties +0 -36
  105. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sk.properties +0 -36
  106. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sl.properties +0 -36
  107. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sv.properties +0 -36
  108. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_th.properties +0 -36
  109. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_tr.properties +0 -36
  110. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_uk.properties +0 -36
  111. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_vi.properties +0 -36
  112. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_CN.properties +0 -36
  113. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_TW.properties +0 -36
  114. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/manifest.json +0 -153
  115. package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/model/models.js +0 -14
@@ -0,0 +1,466 @@
1
+ // Copyright (c) 2009-2021 SAP SE. All rights reserved.
2
+
3
+ /**
4
+ * @fileOverview A wrapper for a page set loaded from the page building service.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ushell_abap/pbServices/ui2/Utils",
9
+ "sap/ushell_abap/pbServices/ui2/Page",
10
+ "sap/ushell_abap/pbServices/ui2/Error",
11
+ "sap/base/Log"
12
+ ], function (
13
+ Utils,
14
+ Page,
15
+ SrvcError,
16
+ Log
17
+ ) {
18
+ "use strict";
19
+
20
+ var O_PAGE_TYPES = {
21
+ // don't start with 0 because it is falsy
22
+ assigned: 1, // contained in AssignedPages and scope is not PERSONALIZATION
23
+ userCreated: 2, // not contained in AssignedPages or DefaultPage
24
+ personalized: 3, // contained in AssignedPages and scope is PERSONALIZATION
25
+ defaultPage: 4 // assigned as DefaultPage
26
+ };
27
+
28
+ // "public class" ************************************************************
29
+
30
+ /**
31
+ * Constructs for the given ID a new representation (wrapper) of the page set with associated
32
+ * pages (see {@link sap.ushell_abap.pbServices.ui2.Page}).
33
+ * A page set is a mutable object and changes can be persisted by the page building service (see
34
+ * {@link sap.ushell_abap.pbServices.ui2.PageBuildingService}).
35
+ *
36
+ * @param {sap.ushell_abap.pbServices.ui2.Factory} oFactory
37
+ * the factory
38
+ * @param {string} sPageSetId
39
+ * the page set's ID
40
+ * @class
41
+ * @since 1.11.0
42
+ * @private
43
+ */
44
+ var PageSet = function (oFactory, sPageSetId) {
45
+ var sId, // the page set ID
46
+ oAlterEgo, // page set's representation with all relations removed
47
+ oDefaultPage,
48
+ aPages = [],
49
+ oPageTypes,
50
+ bIsStub = true,
51
+ that = this;
52
+
53
+ /**
54
+ * Makes sure the given page set is not just a stub.
55
+ *
56
+ * @private
57
+ */
58
+ function checkStub () {
59
+ if (bIsStub) {
60
+ throw new SrvcError(that + ": page set is just a stub", "sap.ushell_abap.pbServices.ui2.PageSet");
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Returns the type of the given page.
66
+ *
67
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oPage
68
+ * any page of this page set
69
+ * @returns {int}
70
+ * the page type as defined privately
71
+ * @private
72
+ */
73
+ this.getPageType = function (oPage) {
74
+ var sId = oPage.getId(),
75
+ iPageType;
76
+
77
+ checkStub();
78
+ if (!oPageTypes.containsKey(sId)) {
79
+ throw new SrvcError("Unknown page " + sId, "sap.ushell_abap.pbServices.ui2.PageSet");
80
+ }
81
+
82
+ iPageType = oPageTypes.get(sId);
83
+ if (iPageType === O_PAGE_TYPES.assigned && oPage.isPersonalized()) {
84
+ iPageType = O_PAGE_TYPES.personalized;
85
+ }
86
+ return iPageType;
87
+ };
88
+
89
+ /**
90
+ * Initializes the page set when the alter ego is known
91
+ * @param {object} oNewAlterEgo
92
+ * JSON representation of the page set (as received from the OData service)
93
+ * @private
94
+ */
95
+ function initialize (oNewAlterEgo) {
96
+ var sDefaultPageId = oNewAlterEgo.DefaultPage.id,
97
+ aRawAssignedPages = (oNewAlterEgo.AssignedPages && oNewAlterEgo.AssignedPages.results)
98
+ || [];
99
+
100
+ oAlterEgo = oNewAlterEgo;
101
+
102
+ // initialize type for assigned pages
103
+ oPageTypes = new Utils.Map();
104
+ aRawAssignedPages.forEach(function (oRawAssignedPage) {
105
+ // assume only ID is present
106
+ oPageTypes.put(oRawAssignedPage.id, O_PAGE_TYPES.assigned);
107
+ });
108
+
109
+ // initialize already loaded pages
110
+ oAlterEgo.Pages.results.forEach(function (oRawPage) {
111
+ var oPage = new Page(oFactory, oRawPage),
112
+ sPageId = oPage.getId();
113
+
114
+ aPages.push(oPage);
115
+
116
+ if (sDefaultPageId === sPageId) {
117
+ oDefaultPage = oPage;
118
+ oPageTypes.put(sPageId, O_PAGE_TYPES.defaultPage);
119
+ } else if (!oPageTypes.containsKey(sPageId)) { // not AssignedPage
120
+ oPageTypes.put(sPageId, O_PAGE_TYPES.userCreated);
121
+ }
122
+ });
123
+
124
+ // remove relations
125
+ delete oAlterEgo.AssignedPages;
126
+ delete oAlterEgo.DefaultPage;
127
+ delete oAlterEgo.Pages;
128
+
129
+ bIsStub = false;
130
+ Log.debug("Initialized: " + that, null, "PageSet");
131
+ }
132
+
133
+ /**
134
+ * Appends a new page with given title to this page set.
135
+ *
136
+ * @param {string} [sPageTitle]
137
+ * title for the new page
138
+ * @param {string} sCatalogId
139
+ * id of the default catalog of the new page
140
+ * @param {function (sap.ushell_abap.pbServices.ui2.Page)} fnSuccess
141
+ * success handler taking new page that has been appended to this page set
142
+ * @param {function (string, object=)} [fnFailure]
143
+ * error handler taking an error message and, since version 1.28.6, an
144
+ * optional object containing the complete error information as delivered
145
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
146
+ * for more details.
147
+ * If not given
148
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
149
+ * @since 1.11.0
150
+ */
151
+ this.appendPage = function (sPageTitle, sCatalogId, fnSuccess, fnFailure) {
152
+ checkStub();
153
+ if (typeof fnSuccess !== "function") {
154
+ throw new SrvcError("Missing success handler", "PageSet");
155
+ }
156
+
157
+ oFactory.getPageBuildingService().createPageInPageSet(sId, sPageTitle, sCatalogId,
158
+ function (oNewRawPage) {
159
+ var oNewPage = new Page(oFactory, oNewRawPage); //TODO oFactory.createPage()
160
+ aPages.push(oNewPage);
161
+ // all new pages are user created:
162
+ oPageTypes.put(oNewPage.getId(), O_PAGE_TYPES.userCreated);
163
+ Log.debug("Appended new page with ID " + oNewPage.getId() + " to pageset "
164
+ + that, null, "PageSet");
165
+
166
+ fnSuccess(oNewPage);
167
+ }, fnFailure);
168
+ };
169
+
170
+ /**
171
+ * Returns true if oPage can entirely be deleted (without a page shining through afterwards).
172
+ * See also <code>isPageResettable</code>.
173
+ *
174
+ *@param {sap.ushell_abap.pbServices.ui2.Page} oPage
175
+ * the page to be checked
176
+ * @returns {boolean}
177
+ * true if page can be removed
178
+ * @since 1.11.0
179
+ *
180
+ * @see #isPageResettable
181
+ * @see #removePage
182
+ */
183
+ this.isPageRemovable = function (oPage) {
184
+ return this.getPageType(oPage) === O_PAGE_TYPES.userCreated;
185
+ };
186
+
187
+ /**
188
+ * Returns true if a delete on oPage only has effect like a reset (with a page shining
189
+ * through afterwards). However, check also method <code>isPageRemovable</code>.
190
+ *
191
+ *@param {sap.ushell_abap.pbServices.ui2.Page} oPage
192
+ * the page to be checked
193
+ * @returns {boolean}
194
+ * true if page can be reset
195
+ * @since 1.11.0
196
+ *
197
+ * @see #isPageRemovable
198
+ * @see #removePage
199
+ */
200
+ this.isPageResettable = function (oPage) {
201
+ return this.getPageType(oPage) === O_PAGE_TYPES.personalized;
202
+ };
203
+
204
+ /**
205
+ * Remove given page from this page set; fails if the page is not removable.
206
+ *
207
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oPage
208
+ * the page to be removed
209
+ * @param {function ()} [fnSuccess]
210
+ * no-args success handler
211
+ * @param {function (string, object=)} [fnFailure]
212
+ * error handler taking an error message and, since version 1.28.6, an
213
+ * optional object containing the complete error information as delivered
214
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
215
+ * for more details.
216
+ * If not given
217
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
218
+ * @see #isPageRemovable
219
+ * @since 1.11.0
220
+ */
221
+ this.removePage = function (oPage, fnSuccess, fnFailure) {
222
+ if (!this.isPageRemovable(oPage)) {
223
+ throw new SrvcError("Cannot remove page " + oPage.getId(),
224
+ "PageSet");
225
+ }
226
+
227
+ oPage.remove(function () {
228
+ aPages.splice(aPages.indexOf(oPage), 1);
229
+ oPageTypes.remove(oPage.getId());
230
+ if (fnSuccess) {
231
+ fnSuccess();
232
+ }
233
+ }, fnFailure);
234
+ };
235
+
236
+ /**
237
+ * Reset given page from this page set; fails if the page is not resettable.
238
+ *
239
+ * @param {sap.ushell_abap.pbServices.ui2.Page} oPage
240
+ * the page to be reset
241
+ * @param {function ()} [fnSuccess]
242
+ * no-args success handler
243
+ * @param {function (string, object=)} [fnFailure]
244
+ * error handler taking an error message and, since version 1.28.6, an
245
+ * optional object containing the complete error information as delivered
246
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
247
+ * for more details.
248
+ * If not given
249
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
250
+ * @see #isPageResettable
251
+ * @since 1.16.1
252
+ */
253
+ this.resetPage = function (oPage, fnSuccess, fnFailure) {
254
+ if (!this.isPageResettable(oPage)) {
255
+ throw new SrvcError("Cannot reset page " + oPage.getId(),
256
+ "sap.ushell_abap.pbServices.ui2.PageSet");
257
+ }
258
+
259
+ // remove page copy from PERSONALIZATION scope
260
+ oPage.remove(function () {
261
+ // reload page from underlying scope
262
+ oPage.load(fnSuccess, fnFailure, /*bPartially*/true);
263
+ }, fnFailure);
264
+ };
265
+
266
+ /**
267
+ * Removes all pages from pageset which does not match given page ID or catalog ID.
268
+ * If the pageset is not loaded an error is thrown.
269
+ *
270
+ * @param {string[]} aPageIds
271
+ * array of valid page IDs
272
+ * @param {string[]} aCatalogIds
273
+ * array of valid catalog IDs
274
+ * @since 1.16.2
275
+ *
276
+ * @see #isStub()
277
+ * @private
278
+ */
279
+ this.filter = function (aPageIds, aCatalogIds) {
280
+ var i,
281
+ aResult = [],
282
+ oCurrentPage;
283
+
284
+ checkStub();
285
+ aPageIds = aPageIds || [];
286
+ aCatalogIds = aCatalogIds || [];
287
+
288
+ for (i = 0; i < aPages.length; i += 1) {
289
+ oCurrentPage = aPages[i];
290
+ if (aPageIds.indexOf(oCurrentPage.getId()) !== -1) {
291
+ aResult.push(oCurrentPage);
292
+ } else if (oCurrentPage.getCatalog()
293
+ && aCatalogIds.indexOf(oCurrentPage.getCatalog().getId()) !== -1) {
294
+ aResult.push(oCurrentPage);
295
+ }
296
+ }
297
+ aPages = aResult;
298
+ };
299
+
300
+ /**
301
+ * Returns this page set's configuration.
302
+ *
303
+ * @returns {string}
304
+ * this page set's configuration
305
+ * @since 1.11.0
306
+ *
307
+ * @see #isStub()
308
+ */
309
+ this.getConfiguration = function () {
310
+ checkStub();
311
+ return oAlterEgo.configuration;
312
+ };
313
+
314
+ /**
315
+ * Sets this page set's configuration.
316
+ *
317
+ * @param {string} sConfiguration
318
+ * new configuration string for this page set
319
+ * @param {function ()} fnSuccess
320
+ * no-args success handler
321
+ * @param {function (string, object=)} [fnFailure]
322
+ * error handler taking an error message and, since version 1.28.6, an
323
+ * optional object containing the complete error information as delivered
324
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
325
+ * for more details.
326
+ * If not given
327
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
328
+ * @since 1.11.0
329
+ *
330
+ * @see #isStub()
331
+ */
332
+ this.setConfiguration = function (sConfiguration, fnSuccess, fnFailure) {
333
+ checkStub();
334
+ if (typeof fnSuccess !== "function") {
335
+ throw new SrvcError("Missing success handler", "PageSet");
336
+ }
337
+
338
+ if (oAlterEgo.configuration === sConfiguration) {
339
+ // no change: call success handler async
340
+ Utils.callHandler(fnSuccess, fnFailure, true);
341
+ return;
342
+ }
343
+
344
+ oAlterEgo.configuration = sConfiguration;
345
+ oFactory.getPageBuildingService().updatePageSet(oAlterEgo, function (oNewAlterEgo) {
346
+ fnSuccess();
347
+ }, fnFailure);
348
+ };
349
+
350
+ /**
351
+ * Returns this page set's default page. Can only be called if the page set is not a stub
352
+ * anymore.
353
+ *
354
+ * @returns {sap.ushell_abap.pbServices.ui2.Page}
355
+ * this page set's default page
356
+ * @since 1.11.0
357
+ *
358
+ * @see #isStub()
359
+ */
360
+ this.getDefaultPage = function () {
361
+ checkStub();
362
+ return oDefaultPage;
363
+ };
364
+
365
+ /**
366
+ * Returns this page set's ID.
367
+ *
368
+ * @returns {string}
369
+ * this page set's ID
370
+ * @since 1.11.0
371
+ */
372
+ this.getId = function () {
373
+ return sId;
374
+ };
375
+
376
+ /**
377
+ * Returns this page set's pages. Can only be called if the page set is not a stub anymore.
378
+ *
379
+ * @returns {sap.ushell_abap.pbServices.ui2.Page[]}
380
+ * this page set's pages
381
+ * @since 1.11.0
382
+ *
383
+ * @see #isStub()
384
+ */
385
+ this.getPages = function () {
386
+ checkStub();
387
+ return aPages.slice();
388
+ };
389
+
390
+ /**
391
+ * Tells whether this page set is still only a stub and does not yet know its properties or
392
+ * related objects, for example pages.
393
+ *
394
+ * @returns {boolean}
395
+ * whether this page set is still only a stub
396
+ * @since 1.11.0
397
+ *
398
+ * @see #load()
399
+ */
400
+ this.isStub = function () {
401
+ return bIsStub;
402
+ };
403
+
404
+ /**
405
+ * Loads the current page set including its configuration, title and pages (aka groups).
406
+ * Property bags of the pages are not loaded. The function <code>loadBag</code> (see
407
+ * {@link sap.ushell_abap.pbServices.ui2.Page#loadBag}) of the page objects needs to be used to get a property
408
+ * bag.
409
+ * Notifies one of the given handlers.
410
+ *
411
+ * @param {function ()} fnSuccess
412
+ * no-args success handler
413
+ * @param {function (string, object=)} [fnFailure]
414
+ * error handler taking an error message and, since version 1.28.6, an
415
+ * optional object containing the complete error information as delivered
416
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
417
+ * for more details.
418
+ * If not given
419
+ * <code>{@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler}</code> is used
420
+ * @since 1.11.0
421
+ */
422
+ this.load = function (fnSuccess, fnFailure) {
423
+ if (!bIsStub) {
424
+ throw new SrvcError("Page set is not a stub anymore", "PageSet");
425
+ }
426
+
427
+ oFactory.getPageBuildingService().readPageSet(sId,
428
+ function (oNewAlterEgo) {
429
+ Log.debug("Loaded: " + that, null, "PageSet");
430
+ initialize(oNewAlterEgo);
431
+
432
+ fnSuccess();
433
+ }, fnFailure, /*bCache*/true);
434
+ };
435
+
436
+ /**
437
+ * Returns this page set's string representation.
438
+ *
439
+ * @param {boolean} [bVerbose=false]
440
+ * flag whether to show all properties
441
+ * @returns {string}
442
+ * this page set's string representation
443
+ * @since 1.11.0
444
+ */
445
+ this.toString = function (bVerbose) {
446
+ var aResult = ['PageSet({sId:"', sId, '",bIsStub:', bIsStub];
447
+ if (bVerbose) {
448
+ aResult.push(",oAlterEgo:", JSON.stringify(oAlterEgo),
449
+ ",oFactory:", oFactory.toString(bVerbose),
450
+ ",aPages:", JSON.stringify(aPages)
451
+ );
452
+ }
453
+ aResult.push("})");
454
+ return aResult.join("");
455
+ };
456
+
457
+ // constructor code -------------------------------------------------------
458
+ sId = sPageSetId;
459
+ if (!sId) {
460
+ throw new SrvcError("Missing page set ID", "PageSet");
461
+ }
462
+ Log.debug("Created: " + this, null, "PageSet");
463
+ };
464
+
465
+ return PageSet;
466
+ }, true);
@@ -0,0 +1,52 @@
1
+ // Copyright (c) 2009-2021 SAP SE. All rights reserved.
2
+
3
+ /**
4
+ * @fileOverview A catalog service which is able to read CHIPs from a remote server.
5
+ */
6
+ sap.ui.define([
7
+ "sap/ushell_abap/pbServices/ui2/PageBuildingService"
8
+ ], function (
9
+ PageBuildingService
10
+ ) {
11
+ "use strict";
12
+
13
+
14
+ // "public class" ************************************************************
15
+
16
+ /**
17
+ * Constructs a remote catalog service which is able to read CHIPs from a remote server.
18
+ *
19
+ * @class
20
+ * @constructor
21
+ * @since 1.19.1
22
+ */
23
+ var RemoteCatalogService = function () {
24
+ // "public" methods --------------------------------------------------------
25
+
26
+ /**
27
+ * Reads the CHIPs with given IDs from the catalog with the given ID, using the given base URL.
28
+ *
29
+ * @param {string} sBaseUrl
30
+ * the base URL of the remote catalog
31
+ * @param {string} sCatalogId
32
+ * the ID of the remote catalog
33
+ * @param {string[]} [aChipIds]
34
+ * the IDs of the CHIPs to be loaded; if <code>undefined</code>, all CHIPs are loaded
35
+ * @param {function (object)} fnSuccess
36
+ * a callback function that is executed if the request succeeds, taking the processed data
37
+ * @param {function (string, object=)} [fnFailure]
38
+ * error handler taking an error message and, since version 1.28.6, an
39
+ * optional object containing the complete error information as delivered
40
+ * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
41
+ * for more details.
42
+ * @throws Error if <code>aChipIds === []</code>
43
+ * @since 1.19.1
44
+ */
45
+ this.readChips = function (sBaseUrl, sCatalogId, aChipIds, fnSuccess, fnFailure) {
46
+ PageBuildingService.createPageBuildingService(sBaseUrl)
47
+ .readCatalogChips(sCatalogId, aChipIds, fnSuccess, fnFailure);
48
+ };
49
+ };
50
+
51
+ return RemoteCatalogService;
52
+ }, true);