@openui5/sap.ui.core 1.97.1 → 1.100.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 (441) hide show
  1. package/.eslintrc.json +92 -2
  2. package/.reuse/dep5 +25 -30
  3. package/THIRDPARTY.txt +15 -22
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +6 -3
  6. package/src/jquery.sap.mobile.js +29 -19
  7. package/src/jquery.sap.properties.js +1 -1
  8. package/src/jquery.sap.resources.js +1 -1
  9. package/src/jquery.sap.script.js +1 -1
  10. package/src/jquery.sap.storage.js +3 -3
  11. package/src/sap/base/Log.js +1 -1
  12. package/src/sap/base/strings/whitespaceReplacer.js +1 -1
  13. package/src/sap/base/util/LoaderExtensions.js +1 -10
  14. package/src/sap/base/util/UriParameters.js +2 -2
  15. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  16. package/src/sap/base/util/restricted/_castArray.js +1 -1
  17. package/src/sap/base/util/restricted/_compact.js +1 -1
  18. package/src/sap/base/util/restricted/_curry.js +1 -1
  19. package/src/sap/base/util/restricted/_debounce.js +1 -1
  20. package/src/sap/base/util/restricted/_difference.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  22. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  25. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  26. package/src/sap/base/util/restricted/_flatten.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  28. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  29. package/src/sap/base/util/restricted/_intersection.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  31. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  33. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  34. package/src/sap/base/util/restricted/_isNil.js +1 -1
  35. package/src/sap/base/util/restricted/_max.js +1 -1
  36. package/src/sap/base/util/restricted/_merge.js +1 -1
  37. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  38. package/src/sap/base/util/restricted/_min.js +1 -1
  39. package/src/sap/base/util/restricted/_omit.js +1 -1
  40. package/src/sap/base/util/restricted/_pick.js +1 -1
  41. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  42. package/src/sap/base/util/restricted/_throttle.js +1 -1
  43. package/src/sap/base/util/restricted/_toArray.js +1 -1
  44. package/src/sap/base/util/restricted/_union.js +1 -1
  45. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  46. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  47. package/src/sap/base/util/restricted/_uniq.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  49. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  50. package/src/sap/base/util/restricted/_without.js +1 -1
  51. package/src/sap/base/util/restricted/_xor.js +1 -1
  52. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  53. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  55. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  56. package/src/sap/ui/Device.js +80 -168
  57. package/src/sap/ui/Global.js +4 -4
  58. package/src/sap/ui/VersionInfo.js +13 -10
  59. package/src/sap/ui/base/BindingParser.js +34 -7
  60. package/src/sap/ui/base/Event.js +1 -1
  61. package/src/sap/ui/base/EventProvider.js +1 -1
  62. package/src/sap/ui/base/ExpressionParser.js +1 -1
  63. package/src/sap/ui/base/Interface.js +1 -1
  64. package/src/sap/ui/base/ManagedObject.js +48 -27
  65. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  66. package/src/sap/ui/base/ManagedObjectObserver.js +2 -0
  67. package/src/sap/ui/base/Metadata.js +1 -1
  68. package/src/sap/ui/base/Object.js +1 -1
  69. package/src/sap/ui/base/ObjectPool.js +1 -1
  70. package/src/sap/ui/core/.library +2 -2
  71. package/src/sap/ui/core/BusyIndicator.js +1 -1
  72. package/src/sap/ui/core/BusyIndicatorUtils.js +1 -1
  73. package/src/sap/ui/core/Component.js +3 -3
  74. package/src/sap/ui/core/ComponentContainer.js +1 -1
  75. package/src/sap/ui/core/ComponentMetadata.js +2 -2
  76. package/src/sap/ui/core/ComponentSupport.js +1 -1
  77. package/src/sap/ui/core/Configuration.js +82 -15
  78. package/src/sap/ui/core/Control.js +3 -2
  79. package/src/sap/ui/core/Core.js +5 -6
  80. package/src/sap/ui/core/CustomData.js +1 -1
  81. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  82. package/src/sap/ui/core/Element.js +5 -7
  83. package/src/sap/ui/core/ElementMetadata.js +1 -1
  84. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  85. package/src/sap/ui/core/EventBus.js +1 -1
  86. package/src/sap/ui/core/ExtensionPoint.js +1 -1
  87. package/src/sap/ui/core/FocusHandler.js +1 -1
  88. package/src/sap/ui/core/Fragment.js +1 -1
  89. package/src/sap/ui/core/HTML.js +1 -1
  90. package/src/sap/ui/core/HTMLRenderer.js +1 -1
  91. package/src/sap/ui/core/History.js +1 -1
  92. package/src/sap/ui/core/Icon.js +18 -5
  93. package/src/sap/ui/core/IconRenderer.js +1 -1
  94. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  95. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  96. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  97. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  98. package/src/sap/ui/core/InvisibleText.js +1 -1
  99. package/src/sap/ui/core/Item.js +1 -1
  100. package/src/sap/ui/core/LabelEnablement.js +9 -2
  101. package/src/sap/ui/core/LayoutData.js +1 -1
  102. package/src/sap/ui/core/ListItem.js +1 -1
  103. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  104. package/src/sap/ui/core/LocalBusyIndicatorRenderer.js +2 -2
  105. package/src/sap/ui/core/LocalBusyIndicatorSupport.js +1 -1
  106. package/src/sap/ui/core/Locale.js +1 -1
  107. package/src/sap/ui/core/LocaleData.js +60 -6
  108. package/src/sap/ui/core/Manifest.js +1 -1
  109. package/src/sap/ui/core/Message.js +1 -1
  110. package/src/sap/ui/core/Patcher.js +3 -3
  111. package/src/sap/ui/core/Placeholder.js +28 -28
  112. package/src/sap/ui/core/Popup.js +12 -9
  113. package/src/sap/ui/core/RenderManager.js +1 -1
  114. package/src/sap/ui/core/Renderer.js +1 -1
  115. package/src/sap/ui/core/ResizeHandler.js +1 -1
  116. package/src/sap/ui/core/ScrollBar.js +1 -1
  117. package/src/sap/ui/core/ScrollBarRenderer.js +1 -1
  118. package/src/sap/ui/core/SeparatorItem.js +1 -1
  119. package/src/sap/ui/core/Title.js +1 -1
  120. package/src/sap/ui/core/TooltipBase.js +2 -2
  121. package/src/sap/ui/core/UIArea.js +1 -1
  122. package/src/sap/ui/core/UIComponent.js +1 -1
  123. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  124. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  125. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  126. package/src/sap/ui/core/XMLComposite.js +1 -1
  127. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  128. package/src/sap/ui/core/XMLTemplateProcessor.js +7 -6
  129. package/src/sap/ui/core/_IconRegistry.js +13 -3
  130. package/src/sap/ui/core/cache/CacheManager.js +1 -1
  131. package/src/sap/ui/core/cache/LRUPersistentCache.js +2 -1
  132. package/src/sap/ui/core/cldr/en_AU.json +1 -1
  133. package/src/sap/ui/core/date/Buddhist.js +3 -3
  134. package/src/sap/ui/core/date/Japanese.js +4 -4
  135. package/src/sap/ui/core/date/UniversalDate.js +10 -0
  136. package/src/sap/ui/core/date/UniversalDateUtils.js +175 -5
  137. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  138. package/src/sap/ui/core/delegate/ScrollEnablement.js +9 -6
  139. package/src/sap/ui/core/dnd/DragAndDrop.js +21 -18
  140. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  141. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  142. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  143. package/src/sap/ui/core/dnd/DropInfo.js +3 -3
  144. package/src/sap/ui/core/format/DateFormat.js +654 -202
  145. package/src/sap/ui/core/format/DateFormatTimezoneDisplay.js +44 -0
  146. package/src/sap/ui/core/format/ListFormat.js +2 -2
  147. package/src/sap/ui/core/format/NumberFormat.js +502 -216
  148. package/src/sap/ui/core/format/TimezoneUtil.js +248 -0
  149. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  150. package/src/sap/ui/core/library.js +126 -53
  151. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  152. package/src/sap/ui/core/message/Message.js +1 -1
  153. package/src/sap/ui/core/message/MessageManager.js +1 -1
  154. package/src/sap/ui/core/message/MessageMixin.js +2 -1
  155. package/src/sap/ui/core/message/MessageParser.js +1 -1
  156. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  157. package/src/sap/ui/core/messagebundle.properties +2 -0
  158. package/src/sap/ui/core/messagebundle_ar.properties +1 -0
  159. package/src/sap/ui/core/messagebundle_bg.properties +6 -5
  160. package/src/sap/ui/core/messagebundle_ca.properties +1 -0
  161. package/src/sap/ui/core/messagebundle_cs.properties +1 -0
  162. package/src/sap/ui/core/messagebundle_cy.properties +1 -0
  163. package/src/sap/ui/core/messagebundle_da.properties +1 -0
  164. package/src/sap/ui/core/messagebundle_de.properties +2 -1
  165. package/src/sap/ui/core/messagebundle_el.properties +1 -0
  166. package/src/sap/ui/core/messagebundle_en.properties +1 -0
  167. package/src/sap/ui/core/messagebundle_en_GB.properties +1 -0
  168. package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +1 -0
  169. package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +1 -0
  170. package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +1 -0
  171. package/src/sap/ui/core/messagebundle_es.properties +1 -0
  172. package/src/sap/ui/core/messagebundle_es_MX.properties +1 -0
  173. package/src/sap/ui/core/messagebundle_et.properties +1 -0
  174. package/src/sap/ui/core/messagebundle_fi.properties +1 -0
  175. package/src/sap/ui/core/messagebundle_fr.properties +1 -0
  176. package/src/sap/ui/core/messagebundle_fr_CA.properties +1 -0
  177. package/src/sap/ui/core/messagebundle_hi.properties +1 -0
  178. package/src/sap/ui/core/messagebundle_hr.properties +1 -0
  179. package/src/sap/ui/core/messagebundle_hu.properties +1 -0
  180. package/src/sap/ui/core/messagebundle_id.properties +3 -2
  181. package/src/sap/ui/core/messagebundle_it.properties +2 -1
  182. package/src/sap/ui/core/messagebundle_iw.properties +1 -0
  183. package/src/sap/ui/core/messagebundle_ja.properties +1 -0
  184. package/src/sap/ui/core/messagebundle_kk.properties +1 -0
  185. package/src/sap/ui/core/messagebundle_ko.properties +2 -1
  186. package/src/sap/ui/core/messagebundle_lt.properties +1 -0
  187. package/src/sap/ui/core/messagebundle_lv.properties +2 -1
  188. package/src/sap/ui/core/messagebundle_ms.properties +1 -0
  189. package/src/sap/ui/core/messagebundle_nl.properties +1 -0
  190. package/src/sap/ui/core/messagebundle_no.properties +5 -4
  191. package/src/sap/ui/core/messagebundle_pl.properties +1 -0
  192. package/src/sap/ui/core/messagebundle_pt.properties +1 -0
  193. package/src/sap/ui/core/messagebundle_pt_PT.properties +1 -0
  194. package/src/sap/ui/core/messagebundle_ro.properties +1 -0
  195. package/src/sap/ui/core/messagebundle_ru.properties +1 -0
  196. package/src/sap/ui/core/messagebundle_sh.properties +1 -0
  197. package/src/sap/ui/core/messagebundle_sk.properties +1 -0
  198. package/src/sap/ui/core/messagebundle_sl.properties +1 -0
  199. package/src/sap/ui/core/messagebundle_sv.properties +1 -0
  200. package/src/sap/ui/core/messagebundle_th.properties +1 -0
  201. package/src/sap/ui/core/messagebundle_tr.properties +1 -0
  202. package/src/sap/ui/core/messagebundle_uk.properties +1 -0
  203. package/src/sap/ui/core/messagebundle_vi.properties +1 -0
  204. package/src/sap/ui/core/messagebundle_zh_CN.properties +1 -0
  205. package/src/sap/ui/core/messagebundle_zh_TW.properties +1 -0
  206. package/src/sap/ui/core/mvc/Controller.js +1 -1
  207. package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +1 -1
  208. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  209. package/src/sap/ui/core/mvc/HTMLViewRenderer.js +1 -1
  210. package/src/sap/ui/core/mvc/JSONView.js +2 -1
  211. package/src/sap/ui/core/mvc/JSONViewRenderer.js +1 -1
  212. package/src/sap/ui/core/mvc/JSView.js +1 -1
  213. package/src/sap/ui/core/mvc/JSViewRenderer.js +1 -1
  214. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  215. package/src/sap/ui/core/mvc/TemplateViewRenderer.js +1 -1
  216. package/src/sap/ui/core/mvc/View.js +2 -1
  217. package/src/sap/ui/core/mvc/ViewRenderer.js +1 -1
  218. package/src/sap/ui/core/mvc/XMLView.js +24 -3
  219. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  220. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  221. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  222. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  223. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  224. package/src/sap/ui/core/routing/Route.js +6 -6
  225. package/src/sap/ui/core/routing/Router.js +4 -3
  226. package/src/sap/ui/core/routing/Targets.js +17 -13
  227. package/src/sap/ui/core/rules/Misc.support.js +8 -3
  228. package/src/sap/ui/core/rules/Model.support.js +95 -8
  229. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  230. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  231. package/src/sap/ui/core/service/Service.js +1 -1
  232. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  233. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  234. package/src/sap/ui/core/support/Plugin.js +1 -1
  235. package/src/sap/ui/core/support/Support.js +3 -3
  236. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  237. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  238. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  239. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  240. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  241. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  242. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  243. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  244. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +1 -5
  245. package/src/sap/ui/core/themes/base/CommandShortcutHints.less +1 -1
  246. package/src/sap/ui/core/themes/base/base.less +1108 -35
  247. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  248. package/src/sap/ui/core/themes/base/global.less +158 -4
  249. package/src/sap/ui/core/themes/base/parameterClasses.less +21 -21
  250. package/src/sap/ui/core/themes/sap_hcb/global.less +157 -2
  251. package/src/sap/ui/core/theming/Parameters.js +22 -142
  252. package/src/sap/ui/core/theming/ThemeHelper.js +26 -37
  253. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  254. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  255. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  256. package/src/sap/ui/core/tmpl/Template.js +1 -1
  257. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  258. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  259. package/src/sap/ui/core/util/DraftEnabledMockServer.js +21 -16
  260. package/src/sap/ui/core/util/Export.js +1 -1
  261. package/src/sap/ui/core/util/ExportCell.js +1 -1
  262. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  263. package/src/sap/ui/core/util/ExportRow.js +1 -1
  264. package/src/sap/ui/core/util/ExportType.js +1 -1
  265. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  266. package/src/sap/ui/core/util/File.js +1 -1
  267. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  268. package/src/sap/ui/core/util/MockServer.js +157 -57
  269. package/src/sap/ui/core/util/PasteHelper.js +5 -5
  270. package/src/sap/ui/core/util/XMLPreprocessor.js +17 -4
  271. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +4 -0
  272. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +26 -16
  273. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +1 -1
  274. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  275. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  276. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  277. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  278. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  279. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  280. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  281. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  282. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  283. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  284. package/src/sap/ui/debug/ControlTree.js +1 -1
  285. package/src/sap/ui/debug/DebugEnv.js +1 -1
  286. package/src/sap/ui/debug/LogViewer.js +2 -2
  287. package/src/sap/ui/debug/PropertyList.js +1 -1
  288. package/src/sap/ui/dom/includeStylesheet.js +8 -3
  289. package/src/sap/ui/events/jquery/EventExtension.js +1 -1
  290. package/src/sap/ui/events/jquery/EventSimulation.js +3 -13
  291. package/src/sap/ui/model/Binding.js +4 -3
  292. package/src/sap/ui/model/ClientModel.js +1 -1
  293. package/src/sap/ui/model/ClientTreeBinding.js +1 -1
  294. package/src/sap/ui/model/CompositeBinding.js +4 -1
  295. package/src/sap/ui/model/CompositeDataState.js +26 -4
  296. package/src/sap/ui/model/CompositeType.js +13 -1
  297. package/src/sap/ui/model/ContextBinding.js +1 -1
  298. package/src/sap/ui/model/DataState.js +27 -6
  299. package/src/sap/ui/model/ListBinding.js +2 -2
  300. package/src/sap/ui/model/MetaModel.js +2 -3
  301. package/src/sap/ui/model/Model.js +2 -2
  302. package/src/sap/ui/model/SelectionModel.js +1 -1
  303. package/src/sap/ui/model/SimpleType.js +1 -1
  304. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  305. package/src/sap/ui/model/Type.js +1 -1
  306. package/src/sap/ui/model/_Helper.js +22 -0
  307. package/src/sap/ui/model/analytics/AnalyticalBinding.js +68 -42
  308. package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -15
  309. package/src/sap/ui/model/base/ManagedObjectModel.js +9 -7
  310. package/src/sap/ui/model/json/JSONListBinding.js +1 -1
  311. package/src/sap/ui/model/json/JSONModel.js +15 -8
  312. package/src/sap/ui/model/json/JSONPropertyBinding.js +1 -1
  313. package/src/sap/ui/model/message/MessageListBinding.js +1 -1
  314. package/src/sap/ui/model/message/MessageModel.js +1 -1
  315. package/src/sap/ui/model/message/MessagePropertyBinding.js +1 -1
  316. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  317. package/src/sap/ui/model/odata/ODataListBinding.js +1 -1
  318. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  319. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  320. package/src/sap/ui/model/odata/ODataMetadata.js +3 -3
  321. package/src/sap/ui/model/odata/ODataModel.js +2 -2
  322. package/src/sap/ui/model/odata/ODataPropertyBinding.js +3 -1
  323. package/src/sap/ui/model/odata/ODataTreeBinding.js +1 -1
  324. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +1 -1
  325. package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +1 -1
  326. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +1 -1
  327. package/src/sap/ui/model/odata/_ODataMetaModelUtils.js +1 -1
  328. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  329. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  330. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  331. package/src/sap/ui/model/odata/type/Date.js +1 -1
  332. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  333. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  334. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  335. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +346 -0
  336. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  337. package/src/sap/ui/model/odata/type/Double.js +1 -1
  338. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  339. package/src/sap/ui/model/odata/type/Int.js +1 -1
  340. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  341. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  342. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  343. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  344. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  345. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  346. package/src/sap/ui/model/odata/type/Single.js +1 -1
  347. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  348. package/src/sap/ui/model/odata/type/String.js +1 -1
  349. package/src/sap/ui/model/odata/type/Time.js +1 -1
  350. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  351. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  352. package/src/sap/ui/model/odata/type/UnitMixin.js +1 -1
  353. package/src/sap/ui/model/odata/v2/Context.js +62 -5
  354. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  355. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +8 -4
  356. package/src/sap/ui/model/odata/v2/ODataListBinding.js +324 -112
  357. package/src/sap/ui/model/odata/v2/ODataModel.js +324 -94
  358. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +3 -4
  359. package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +65 -5
  360. package/src/sap/ui/model/odata/v4/AnnotationHelper.js +21 -22
  361. package/src/sap/ui/model/odata/v4/Context.js +224 -101
  362. package/src/sap/ui/model/odata/v4/ODataBinding.js +99 -55
  363. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +272 -210
  364. package/src/sap/ui/model/odata/v4/ODataListBinding.js +557 -258
  365. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +131 -100
  366. package/src/sap/ui/model/odata/v4/ODataModel.js +503 -260
  367. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +106 -138
  368. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +87 -80
  369. package/src/sap/ui/model/odata/v4/ODataUtils.js +5 -5
  370. package/src/sap/ui/model/odata/v4/SubmitMode.js +0 -1
  371. package/src/sap/ui/model/odata/v4/ValueListType.js +0 -1
  372. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +20 -20
  373. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +3 -5
  374. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +5 -4
  375. package/src/sap/ui/model/odata/v4/lib/_Batch.js +21 -20
  376. package/src/sap/ui/model/odata/v4/lib/_Cache.js +322 -127
  377. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +5 -1
  378. package/src/sap/ui/model/odata/v4/lib/_Helper.js +28 -21
  379. package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +62 -61
  380. package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +1 -1
  381. package/src/sap/ui/model/odata/v4/lib/_Parser.js +52 -43
  382. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +216 -51
  383. package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +147 -147
  384. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +14 -13
  385. package/src/sap/ui/model/odata/v4/lib/_V4MetadataConverter.js +66 -67
  386. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  387. package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
  388. package/src/sap/ui/model/type/Boolean.js +1 -1
  389. package/src/sap/ui/model/type/Currency.js +1 -1
  390. package/src/sap/ui/model/type/Date.js +1 -1
  391. package/src/sap/ui/model/type/DateInterval.js +1 -1
  392. package/src/sap/ui/model/type/DateTime.js +1 -1
  393. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  394. package/src/sap/ui/model/type/FileSize.js +1 -1
  395. package/src/sap/ui/model/type/Float.js +1 -1
  396. package/src/sap/ui/model/type/Integer.js +1 -1
  397. package/src/sap/ui/model/type/String.js +1 -1
  398. package/src/sap/ui/model/type/Time.js +1 -1
  399. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  400. package/src/sap/ui/model/type/Unit.js +1 -1
  401. package/src/sap/ui/model/xml/XMLListBinding.js +1 -1
  402. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  403. package/src/sap/ui/model/xml/XMLPropertyBinding.js +1 -1
  404. package/src/sap/ui/performance/trace/FESR.js +1 -1
  405. package/src/sap/ui/performance/trace/FESRHelper.js +72 -0
  406. package/src/sap/ui/performance/trace/Interaction.js +6 -2
  407. package/src/sap/ui/performance/trace/Passport.js +3 -3
  408. package/src/sap/ui/qunit/qunit-2-css.js +4 -4
  409. package/src/sap/ui/qunit/qunit-css.js +4 -4
  410. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  411. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  412. package/src/sap/ui/test/BlanketReporter.js +1 -1
  413. package/src/sap/ui/test/BranchTracking.js +1 -0
  414. package/src/sap/ui/test/Opa5.js +1 -1
  415. package/src/sap/ui/test/OpaBuilder.js +7 -7
  416. package/src/sap/ui/test/TestUtils.js +12 -2
  417. package/src/sap/ui/test/_LogCollector.js +1 -1
  418. package/src/sap/ui/test/_UsageReport.js +1 -1
  419. package/src/sap/ui/test/actions/Action.js +4 -2
  420. package/src/sap/ui/test/actions/Press.js +51 -2
  421. package/src/sap/ui/test/autowaiter/_XHRWaiter.js +1 -1
  422. package/src/sap/ui/test/generic/GenericTestCollection.js +176 -0
  423. package/src/sap/ui/test/generic/TestBase.js +151 -0
  424. package/src/sap/ui/test/generic/Utils.js +284 -0
  425. package/src/sap/ui/test/selectors/_ControlSelectorGenerator.js +9 -8
  426. package/src/sap/ui/test/selectors/_ControlSelectorValidator.js +1 -1
  427. package/src/sap/ui/test/starter/_setupAndStart.js +4 -0
  428. package/src/sap/ui/test/starter/createSuite.js +3 -3
  429. package/src/sap/ui/thirdparty/IPv6.js +1 -1
  430. package/src/sap/ui/thirdparty/SecondLevelDomains.js +1 -1
  431. package/src/sap/ui/thirdparty/URI.js +7 -3
  432. package/src/sap/ui/thirdparty/URITemplate.js +1 -1
  433. package/src/sap/ui/thirdparty/jquery-mobile-custom.js +3 -6
  434. package/src/sap/ui/thirdparty/jqueryui/jquery-ui-datepicker.js +143 -3
  435. package/src/sap/ui/thirdparty/jqueryui/jquery-ui-position.js +8 -1
  436. package/src/sap/ui/thirdparty/jszip.js +17 -7
  437. package/src/sap/ui/thirdparty/mobify-carousel.js +1 -1
  438. package/src/sap/ui/util/Mobile.js +17 -0
  439. package/src/sap/ui/util/Storage.js +1 -1
  440. package/src/sap/ui/util/XMLHelper.js +53 -30
  441. package/src/ui5loader.js +4 -4
@@ -52,6 +52,8 @@ sap.ui.define([
52
52
  // system query options allowed within a $expand query option
53
53
  aExpandQueryOptions = ["$count", "$expand", "$filter", "$levels", "$orderby", "$search",
54
54
  "$select"],
55
+ // binding-specific parameters allowed in getKeepAliveContext
56
+ aGetKeepAliveParameters = ["$$groupId", "$$patchWithoutSideEffects", "$$updateGroupId"],
55
57
  rGroupID = /^(\$auto(\.\w+)?|\$direct|\w+)$/,
56
58
  MessageType = coreLibrary.MessageType,
57
59
  aMessageTypes = [
@@ -85,269 +87,288 @@ sap.ui.define([
85
87
  aSystemQueryOptions = ["$apply", "$count", "$expand", "$filter", "$orderby", "$search",
86
88
  "$select"],
87
89
  // valid header values: non-empty, only US-ASCII, no control chars
88
- rValidHeader = /^[ -~]+$/;
90
+ rValidHeader = /^[ -~]+$/,
91
+ /**
92
+ * Constructor for a new ODataModel.
93
+ *
94
+ * @param {object} mParameters
95
+ * The parameters
96
+ * @param {string|string[]} [mParameters.annotationURI]
97
+ * The URL (or an array of URLs) from which the annotation metadata are loaded.
98
+ * The annotation files are merged into the service metadata in the given order (last one
99
+ * wins). The same annotations are overwritten; if an annotation file contains other
100
+ * elements (like a type definition) that are already merged, an error is thrown.
101
+ * Supported since 1.41.0
102
+ * @param {boolean} [mParameters.autoExpandSelect]
103
+ * Whether the OData model's bindings automatically generate $select and $expand system
104
+ * query options from the binding hierarchy. Note: Dynamic changes to the binding
105
+ * hierarchy are not supported. This parameter is supported since 1.47.0, and since 1.75.0
106
+ * it also enables property paths containing navigation properties in
107
+ * <code>$select</code>.
108
+ * @param {boolean} [mParameters.earlyRequests]
109
+ * Whether the following is requested at the earliest convenience:
110
+ * <ul>
111
+ * <li> root $metadata document and annotation files;
112
+ * <li> the security token.
113
+ * </ul>
114
+ * Note: The root $metadata document and annotation files are just requested but not yet
115
+ * converted from XML to JSON unless really needed.
116
+ * Supported since 1.53.0.
117
+ * <b>BEWARE:</b> The default value may change to <code>true</code> in later releases.
118
+ * You may also set {@link topic:26ba6a5c1e5c417f8b21cce1411dba2c Manifest Model Preload}
119
+ * in order to further speed up the start of a UI5 component.
120
+ * @param {string} [mParameters.groupId="$auto"]
121
+ * Controls the model's use of batch requests: '$auto' bundles requests from the model in
122
+ * a batch request which is sent automatically before rendering; '$direct' sends requests
123
+ * directly without batch; other values result in an error
124
+ * @param {object} [mParameters.groupProperties]
125
+ * Controls the use of batch requests for application groups. A map of application
126
+ * group IDs having an object with exactly one property <code>submit</code>. Valid values
127
+ * are 'API', 'Auto', 'Direct' see {@link sap.ui.model.odata.v4.SubmitMode}. Supported
128
+ * since 1.51.0
129
+ * @param {object} [mParameters.httpHeaders]
130
+ * Map of HTTP header names to their values, see {@link #changeHttpHeaders}
131
+ * @param {object} [mParameters.metadataUrlParams]
132
+ * Additional map of URL parameters used specifically for $metadata requests. Note that
133
+ * "sap-context-token" applies only to the service's root $metadata, but not to
134
+ * "cross-service references". Supported since 1.81.0
135
+ * @param {string} [mParameters.odataVersion="4.0"]
136
+ * The version of the OData service. Supported values are "2.0" and "4.0".
137
+ * @param {sap.ui.model.odata.OperationMode} [mParameters.operationMode]
138
+ * The operation mode for filtering and sorting. Since 1.39.0, the operation mode
139
+ * {@link sap.ui.model.odata.OperationMode.Server} is supported. All other operation modes
140
+ * including <code>undefined</code> lead to an error if 'vFilters' or 'vSorters' are given
141
+ * or if {@link sap.ui.model.odata.v4.ODataListBinding#filter} or
142
+ * {@link sap.ui.model.odata.v4.ODataListBinding#sort} is called.
143
+ * @param {string} mParameters.serviceUrl
144
+ * Root URL of the service to request data from. The path part of the URL must end with a
145
+ * forward slash according to OData V4 specification ABNF, rule "serviceRoot". You may
146
+ * append OData custom query options to the service root URL separated with a "?", for
147
+ * example "/MyService/?custom=foo". See specification "OData Version 4.0 Part 2: URL
148
+ * Conventions", "5.2 Custom Query Options". OData system query options and OData
149
+ * parameter aliases lead to an error.
150
+ * @param {boolean} [mParameters.sharedRequests]
151
+ * Whether all list bindings for the same resource path share their data, so that it is
152
+ * requested only once; only the value <code>true</code> is allowed; see parameter
153
+ * "$$sharedRequest" of {@link #bindList}. Additionally,
154
+ * {@link sap.ui.model.BindingMode.OneWay} becomes the default binding mode and
155
+ * {@link sap.ui.model.BindingMode.TwoWay} is forbidden. Note: This makes all bindings
156
+ * read-only, so it may be especially useful for value list models. Supported since 1.80.0
157
+ * @param {boolean} [mParameters.supportReferences=true]
158
+ * Whether <code>&lt;edmx:Reference></code> and <code>&lt;edmx:Include></code> directives
159
+ * are supported in order to load schemas on demand from other $metadata documents and
160
+ * include them into the current service ("cross-service references").
161
+ * @param {string} mParameters.synchronizationMode
162
+ * Controls synchronization between different bindings which refer to the same data for
163
+ * the case data changes in one binding. Must be set to 'None' which means bindings are
164
+ * not synchronized at all; all other values are not supported and lead to an error.
165
+ * @param {string} [mParameters.updateGroupId]
166
+ * The group ID that is used for update requests. If no update group ID is specified,
167
+ * <code>mParameters.groupId</code> is used. Valid update group IDs are
168
+ * <code>undefined</code>, '$auto', '$direct' or an application group ID.
169
+ * @throws {Error} If an unsupported synchronization mode is given, if the given service
170
+ * root URL does not end with a forward slash, if an unsupported parameter is given, if
171
+ * OData system query options or parameter aliases are specified as parameters, if an
172
+ * invalid group ID or update group ID is given, if the given operation mode is not
173
+ * supported, if an annotation file cannot be merged into the service metadata, if an
174
+ * unsupported value for <code>odataVersion</code> is given.
175
+ *
176
+ * @alias sap.ui.model.odata.v4.ODataModel
177
+ * @author SAP SE
178
+ * @class Model implementation for OData V4.
179
+ *
180
+ * This model is not prepared to be inherited from.
181
+ *
182
+ * Every resource path (relative to the service root URL, no query options) according to
183
+ * "4 Resource Path" in specification "OData Version 4.0 Part 2: URL Conventions" is
184
+ * a valid data binding path within this model if a leading slash is added; for example
185
+ * "/" + "SalesOrderList('A%2FB%26C')" to access an entity instance with key "A/B&C". Note
186
+ * that appropriate URI encoding is necessary, see the example of
187
+ * {@link sap.ui.model.odata.v4.ODataUtils.formatLiteral}. "4.5.1 Addressing Actions"
188
+ * needs an operation binding, see {@link sap.ui.model.odata.v4.ODataContextBinding}.
189
+ *
190
+ * Note that the OData V4 model has its own {@link sap.ui.model.odata.v4.Context} class.
191
+ * Bindings which are relative to such a V4 context depend on their corresponding parent
192
+ * binding and do not access data with their own service requests unless parameters are
193
+ * provided.
194
+ *
195
+ * <b>Group IDs</b> control the model's use of batch requests. Valid group IDs are:
196
+ * <ul>
197
+ * <li> <b>$auto</b> and <b>$auto.*</b>: Bundles requests from the model in a batch
198
+ * request which is sent automatically before rendering. You can use different
199
+ * '$auto.*' group IDs to use different batch requests. The suffix may be any
200
+ * non-empty string consisting of alphanumeric characters from the basic Latin
201
+ * alphabet, including the underscore. The submit mode for these group IDs is always
202
+ * {@link sap.ui.model.odata.v4.SubmitMode#Auto}.
203
+ * <li> <b>$direct</b>: Sends requests directly without batch. The submit mode for this
204
+ * group ID is always {@link sap.ui.model.odata.v4.SubmitMode#Direct}.
205
+ * <li> An application group ID, which is a non-empty string consisting of alphanumeric
206
+ * characters from the basic Latin alphabet, including the underscore. By default, an
207
+ * application group has the submit mode {@link sap.ui.model.odata.v4.SubmitMode#API}.
208
+ * It is possible to use a different submit mode; for details see
209
+ * <code>mParameters.groupProperties</code>.
210
+ * </ul>
211
+ *
212
+ * @extends sap.ui.model.Model
213
+ * @public
214
+ * @since 1.37.0
215
+ * @version 1.100.0
216
+ */
217
+ ODataModel = Model.extend("sap.ui.model.odata.v4.ODataModel",
218
+ /** @lends sap.ui.model.odata.v4.ODataModel.prototype */{
219
+ constructor : constructor
220
+ });
221
+
222
+ //*********************************************************************************************
223
+ // ODataModel
224
+ //*********************************************************************************************
89
225
 
90
226
  /**
91
227
  * Constructor for a new ODataModel.
92
228
  *
93
229
  * @param {object} mParameters
94
230
  * The parameters
95
- * @param {string|string[]} [mParameters.annotationURI]
96
- * The URL (or an array of URLs) from which the annotation metadata are loaded.
97
- * The annotation files are merged into the service metadata in the given order (last one
98
- * wins). The same annotations are overwritten; if an annotation file contains other elements
99
- * (like a type definition) that are already merged, an error is thrown.
100
- * Supported since 1.41.0
101
- * @param {boolean} [mParameters.autoExpandSelect]
102
- * Whether the OData model's bindings automatically generate $select and $expand system query
103
- * options from the binding hierarchy. Note: Dynamic changes to the binding hierarchy are not
104
- * supported. This parameter is supported since 1.47.0, and since 1.75.0 it also enables
105
- * property paths containing navigation properties in <code>$select</code>.
106
- * @param {boolean} [mParameters.earlyRequests]
107
- * Whether the following is requested at the earliest convenience:
108
- * <ul>
109
- * <li> root $metadata document and annotation files;
110
- * <li> the security token.
111
- * </ul>
112
- * Note: The root $metadata document and annotation files are just requested but not yet
113
- * converted from XML to JSON unless really needed.
114
- * Supported since 1.53.0.
115
- * <b>BEWARE:</b> The default value may change to <code>true</code> in later releases.
116
- * You may also set {@link topic:26ba6a5c1e5c417f8b21cce1411dba2c Manifest Model Preload} in
117
- * order to further speed up the start of a UI5 component.
118
- * @param {string} [mParameters.groupId="$auto"]
119
- * Controls the model's use of batch requests: '$auto' bundles requests from the model in a
120
- * batch request which is sent automatically before rendering; '$direct' sends requests
121
- * directly without batch; other values result in an error
122
- * @param {object} [mParameters.groupProperties]
123
- * Controls the use of batch requests for application groups. A map of application
124
- * group IDs having an object with exactly one property <code>submit</code>. Valid values are
125
- * 'API', 'Auto', 'Direct' see {@link sap.ui.model.odata.v4.SubmitMode}.
126
- * Supported since 1.51.0
127
- * @param {object} [mParameters.httpHeaders]
128
- * Map of HTTP header names to their values, see {@link #changeHttpHeaders}
129
- * @param {object} [mParameters.metadataUrlParams]
130
- * Additional map of URL parameters used specifically for $metadata requests. Note that
131
- * "sap-context-token" applies only to the service's root $metadata, but not to
132
- * "cross-service references". Supported since 1.81.0
133
- * @param {string} [mParameters.odataVersion="4.0"]
134
- * The version of the OData service. Supported values are "2.0" and "4.0".
135
- * @param {sap.ui.model.odata.OperationMode} [mParameters.operationMode]
136
- * The operation mode for filtering and sorting. Since 1.39.0, the operation mode
137
- * {@link sap.ui.model.odata.OperationMode.Server} is supported. All other operation modes
138
- * including <code>undefined</code> lead to an error if 'vFilters' or 'vSorters' are given or
139
- * if {@link sap.ui.model.odata.v4.ODataListBinding#filter} or
140
- * {@link sap.ui.model.odata.v4.ODataListBinding#sort} is called.
141
- * @param {string} mParameters.serviceUrl
142
- * Root URL of the service to request data from. The path part of the URL must end with a
143
- * forward slash according to OData V4 specification ABNF, rule "serviceRoot". You may append
144
- * OData custom query options to the service root URL separated with a "?", for example
145
- * "/MyService/?custom=foo".
146
- * See specification "OData Version 4.0 Part 2: URL Conventions", "5.2 Custom Query Options".
147
- * OData system query options and OData parameter aliases lead to an error.
148
- * @param {boolean} [mParameters.sharedRequests]
149
- * Whether all list bindings for the same resource path share their data, so that it is
150
- * requested only once; only the value <code>true</code> is allowed; see parameter
151
- * "$$sharedRequest" of {@link #bindList}. Additionally,
152
- * {@link sap.ui.model.BindingMode.OneWay} becomes the default binding mode and
153
- * {@link sap.ui.model.BindingMode.TwoWay} is forbidden. Note: This makes all bindings
154
- * read-only, so it may be especially useful for value list models. Supported since 1.80.0
155
- * @param {boolean} [mParameters.supportReferences=true]
156
- * Whether <code>&lt;edmx:Reference></code> and <code>&lt;edmx:Include></code> directives are
157
- * supported in order to load schemas on demand from other $metadata documents and include
158
- * them into the current service ("cross-service references").
159
- * @param {string} mParameters.synchronizationMode
160
- * Controls synchronization between different bindings which refer to the same data for the
161
- * case data changes in one binding. Must be set to 'None' which means bindings are not
162
- * synchronized at all; all other values are not supported and lead to an error.
163
- * @param {string} [mParameters.updateGroupId]
164
- * The group ID that is used for update requests. If no update group ID is specified, <code>
165
- * mParameters.groupId</code> is used. Valid update group IDs are <code>undefined</code>,
166
- * '$auto', '$direct' or an application group ID.
167
231
  * @throws {Error} If an unsupported synchronization mode is given, if the given service root
168
232
  * URL does not end with a forward slash, if an unsupported parameter is given, if OData
169
233
  * system query options or parameter aliases are specified as parameters, if an invalid group
170
234
  * ID or update group ID is given, if the given operation mode is not supported, if an
171
235
  * annotation file cannot be merged into the service metadata, if an unsupported value for
172
236
  * <code>odataVersion</code> is given.
173
- *
174
- * @alias sap.ui.model.odata.v4.ODataModel
175
- * @author SAP SE
176
- * @class Model implementation for OData V4.
177
- *
178
- * This model is not prepared to be inherited from.
179
- *
180
- * Every resource path (relative to the service root URL, no query options) according to
181
- * "4 Resource Path" in specification "OData Version 4.0 Part 2: URL Conventions" is
182
- * a valid data binding path within this model if a leading slash is added; for example
183
- * "/" + "SalesOrderList('A%2FB%26C')" to access an entity instance with key "A/B&C". Note
184
- * that appropriate URI encoding is necessary, see the example of
185
- * {@link sap.ui.model.odata.v4.ODataUtils.formatLiteral}. "4.5.1 Addressing Actions" needs an
186
- * operation binding, see {@link sap.ui.model.odata.v4.ODataContextBinding}.
187
- *
188
- * Note that the OData V4 model has its own {@link sap.ui.model.odata.v4.Context} class.
189
- * Bindings which are relative to such a V4 context depend on their corresponding parent
190
- * binding and do not access data with their own service requests unless parameters are
191
- * provided.
192
- *
193
- * <b>Group IDs</b> control the model's use of batch requests. Valid group IDs are:
194
- * <ul>
195
- * <li> <b>$auto</b> and <b>$auto.*</b>: Bundles requests from the model in a batch request
196
- * which is sent automatically before rendering. You can use different '$auto.*' group IDs
197
- * to use different batch requests. The suffix may be any non-empty string consisting of
198
- * alphanumeric characters from the basic Latin alphabet, including the underscore. The
199
- * submit mode for these group IDs is always
200
- * {@link sap.ui.model.odata.v4.SubmitMode#Auto}.
201
- * <li> <b>$direct</b>: Sends requests directly without batch. The submit mode for this
202
- * group ID is always {@link sap.ui.model.odata.v4.SubmitMode#Direct}.
203
- * <li> An application group ID, which is a non-empty string consisting of alphanumeric
204
- * characters from the basic Latin alphabet, including the underscore. By default, an
205
- * application group has the submit mode {@link sap.ui.model.odata.v4.SubmitMode#API}. It
206
- * is possible to use a different submit mode; for details see
207
- * <code>mParameters.groupProperties</code>.
208
- * </ul>
209
- *
210
- * @extends sap.ui.model.Model
211
- * @public
212
- * @since 1.37.0
213
- * @version 1.97.1
214
- */
215
- var ODataModel = Model.extend("sap.ui.model.odata.v4.ODataModel",
216
- /** @lends sap.ui.model.odata.v4.ODataModel.prototype */
217
- {
218
- constructor : function (mParameters) {
219
- var sGroupId,
220
- oGroupProperties,
221
- sLanguageTag = sap.ui.getCore().getConfiguration().getLanguageTag(),
222
- sODataVersion,
223
- sParameter,
224
- sServiceUrl,
225
- oUri,
226
- mUriParameters,
227
- that = this;
228
-
229
- // do not pass any parameters to Model
230
- Model.call(this);
231
-
232
- if (!mParameters || mParameters.synchronizationMode !== "None") {
233
- throw new Error("Synchronization mode must be 'None'");
234
- }
235
- sODataVersion = mParameters.odataVersion || "4.0";
236
- this.sODataVersion = sODataVersion;
237
- if (sODataVersion !== "4.0" && sODataVersion !== "2.0") {
238
- throw new Error("Unsupported value for parameter odataVersion: "
239
- + sODataVersion);
240
- }
241
- for (sParameter in mParameters) {
242
- if (!(sParameter in mSupportedParameters)) {
243
- throw new Error("Unsupported parameter: " + sParameter);
244
- }
245
- }
246
- sServiceUrl = mParameters.serviceUrl;
247
- if (!sServiceUrl) {
248
- throw new Error("Missing service root URL");
249
- }
250
- oUri = new URI(sServiceUrl);
251
- if (oUri.path()[oUri.path().length - 1] !== "/") {
252
- throw new Error("Service root URL must end with '/'");
253
- }
254
- if (mParameters.operationMode
255
- && mParameters.operationMode !== OperationMode.Server) {
256
- throw new Error("Unsupported operation mode: "
257
- + mParameters.operationMode);
258
- }
259
- this.sOperationMode = mParameters.operationMode;
260
- // Note: strict checking for model's URI parameters, but "sap-*" is allowed
261
- mUriParameters = this.buildQueryOptions(oUri.query(true), false, true);
262
- // BEWARE: these are shared across all bindings!
263
- this.mUriParameters = mUriParameters;
264
- if (sap.ui.getCore().getConfiguration().getStatistics()) {
265
- // Note: this way, "sap-statistics" is not sent within $batch
266
- mUriParameters = Object.assign({"sap-statistics" : true}, mUriParameters);
267
- }
268
- this.sServiceUrl = oUri.query("").toString();
269
- this.sGroupId = mParameters.groupId;
270
- if (this.sGroupId === undefined) {
271
- this.sGroupId = "$auto";
272
- }
273
- if (this.sGroupId !== "$auto" && this.sGroupId !== "$direct") {
274
- throw new Error("Group ID must be '$auto' or '$direct'");
275
- }
276
- this.checkGroupId(mParameters.updateGroupId, false,
277
- "Invalid update group ID: ");
278
- this.sUpdateGroupId = mParameters.updateGroupId || this.getGroupId();
279
- this.mGroupProperties = {};
280
- for (sGroupId in mParameters.groupProperties) {
281
- that.checkGroupId(sGroupId, true);
282
- oGroupProperties = mParameters.groupProperties[sGroupId];
283
- if (typeof oGroupProperties !== "object"
284
- || Object.keys(oGroupProperties).length !== 1
285
- || !(oGroupProperties.submit in SubmitMode)) {
286
- throw new Error("Group '" + sGroupId + "' has invalid properties: '"
287
- + oGroupProperties + "'");
288
- }
289
- }
290
- this.mGroupProperties = _Helper.clone(mParameters.groupProperties) || {};
291
- this.mGroupProperties.$auto = {submit : SubmitMode.Auto};
292
- this.mGroupProperties.$direct = {submit : SubmitMode.Direct};
293
- if (mParameters.autoExpandSelect !== undefined
294
- && typeof mParameters.autoExpandSelect !== "boolean") {
295
- throw new Error("Value for autoExpandSelect must be true or false");
296
- }
297
- this.bAutoExpandSelect = mParameters.autoExpandSelect === true;
298
- if ("sharedRequests" in mParameters && mParameters.sharedRequests !== true) {
299
- throw new Error("Value for sharedRequests must be true");
300
- }
301
- this.bSharedRequests = mParameters.sharedRequests === true;
302
-
303
- this.mHeaders = {"Accept-Language" : sLanguageTag};
304
- this.mMetadataHeaders = {"Accept-Language" : sLanguageTag};
305
-
306
- // BEWARE: do not share mHeaders between _MetadataRequestor and _Requestor!
307
- this.oMetaModel = new ODataMetaModel(
308
- _MetadataRequestor.create(this.mMetadataHeaders, sODataVersion,
309
- Object.assign({}, mUriParameters, mParameters.metadataUrlParams)),
310
- this.sServiceUrl + "$metadata", mParameters.annotationURI, this,
311
- mParameters.supportReferences);
312
- this.oInterface = {
313
- fetchEntityContainer :
314
- this.oMetaModel.fetchEntityContainer.bind(this.oMetaModel),
315
- fetchMetadata : this.oMetaModel.fetchObject.bind(this.oMetaModel),
316
- fireSessionTimeout : function () {
317
- that.fireEvent("sessionTimeout");
318
- },
319
- getGroupProperty : this.getGroupProperty.bind(this),
320
- onCreateGroup : function (sGroupId) {
321
- if (that.isAutoGroup(sGroupId)) {
322
- that.addPrerenderingTask(
323
- that._submitBatch.bind(that, sGroupId, true));
324
- }
325
- },
326
- reportStateMessages : this.reportStateMessages.bind(this),
327
- reportTransitionMessages : this.reportTransitionMessages.bind(this)
328
- };
329
- this.oRequestor = _Requestor.create(this.sServiceUrl, this.oInterface,
330
- this.mHeaders, mUriParameters, sODataVersion);
331
- this.changeHttpHeaders(mParameters.httpHeaders);
332
- if (mParameters.earlyRequests) {
333
- this.oMetaModel.fetchEntityContainer(true);
334
- this.initializeSecurityToken();
335
- }
237
+ */
238
+ function constructor(mParameters) {
239
+ var sGroupId,
240
+ oGroupProperties,
241
+ sLanguageTag = sap.ui.getCore().getConfiguration().getLanguageTag(),
242
+ sODataVersion,
243
+ sParameter,
244
+ sServiceUrl,
245
+ oUri,
246
+ mUriParameters,
247
+ that = this;
336
248
 
337
- this.aAllBindings = [];
338
- this.mSupportedBindingModes = {
339
- OneTime : true,
340
- OneWay : true
341
- };
342
- if (mParameters.sharedRequests) {
343
- this.sDefaultBindingMode = BindingMode.OneWay;
344
- } else {
345
- this.sDefaultBindingMode = BindingMode.TwoWay;
346
- this.mSupportedBindingModes.TwoWay = true;
347
- }
348
- this.aPrerenderingTasks = null; // @see #addPrerenderingTask
249
+ // do not pass any parameters to Model
250
+ Model.call(this);
251
+
252
+ if (!mParameters || mParameters.synchronizationMode !== "None") {
253
+ throw new Error("Synchronization mode must be 'None'");
254
+ }
255
+ sODataVersion = mParameters.odataVersion || "4.0";
256
+ this.sODataVersion = sODataVersion;
257
+ if (sODataVersion !== "4.0" && sODataVersion !== "2.0") {
258
+ throw new Error("Unsupported value for parameter odataVersion: " + sODataVersion);
259
+ }
260
+ for (sParameter in mParameters) {
261
+ if (!(sParameter in mSupportedParameters)) {
262
+ throw new Error("Unsupported parameter: " + sParameter);
263
+ }
264
+ }
265
+ sServiceUrl = mParameters.serviceUrl;
266
+ if (!sServiceUrl) {
267
+ throw new Error("Missing service root URL");
268
+ }
269
+ oUri = new URI(sServiceUrl);
270
+ if (oUri.path()[oUri.path().length - 1] !== "/") {
271
+ throw new Error("Service root URL must end with '/'");
272
+ }
273
+ if (mParameters.operationMode && mParameters.operationMode !== OperationMode.Server) {
274
+ throw new Error("Unsupported operation mode: "
275
+ + mParameters.operationMode);
276
+ }
277
+ this.sOperationMode = mParameters.operationMode;
278
+ // Note: strict checking for model's URI parameters, but "sap-*" is allowed
279
+ mUriParameters = this.buildQueryOptions(oUri.query(true), false, true);
280
+ // BEWARE: these are shared across all bindings!
281
+ this.mUriParameters = mUriParameters;
282
+ if (sap.ui.getCore().getConfiguration().getStatistics()) {
283
+ // Note: this way, "sap-statistics" is not sent within $batch
284
+ mUriParameters = Object.assign({"sap-statistics" : true}, mUriParameters);
285
+ }
286
+ this.sServiceUrl = oUri.query("").toString();
287
+ this.sGroupId = mParameters.groupId;
288
+ if (this.sGroupId === undefined) {
289
+ this.sGroupId = "$auto";
290
+ }
291
+ if (this.sGroupId !== "$auto" && this.sGroupId !== "$direct") {
292
+ throw new Error("Group ID must be '$auto' or '$direct'");
293
+ }
294
+ this.checkGroupId(mParameters.updateGroupId, false, "Invalid update group ID: ");
295
+ this.sUpdateGroupId = mParameters.updateGroupId || this.getGroupId();
296
+ this.mGroupProperties = {};
297
+ for (sGroupId in mParameters.groupProperties) {
298
+ that.checkGroupId(sGroupId, true);
299
+ oGroupProperties = mParameters.groupProperties[sGroupId];
300
+ if (typeof oGroupProperties !== "object"
301
+ || Object.keys(oGroupProperties).length !== 1
302
+ || !(oGroupProperties.submit in SubmitMode)) {
303
+ throw new Error("Group '" + sGroupId + "' has invalid properties: '"
304
+ + oGroupProperties + "'");
305
+ }
306
+ }
307
+ this.mGroupProperties = _Helper.clone(mParameters.groupProperties) || {};
308
+ this.mGroupProperties.$auto = {submit : SubmitMode.Auto};
309
+ this.mGroupProperties.$direct = {submit : SubmitMode.Direct};
310
+ if (mParameters.autoExpandSelect !== undefined
311
+ && typeof mParameters.autoExpandSelect !== "boolean") {
312
+ throw new Error("Value for autoExpandSelect must be true or false");
313
+ }
314
+ this.bAutoExpandSelect = mParameters.autoExpandSelect === true;
315
+ if ("sharedRequests" in mParameters && mParameters.sharedRequests !== true) {
316
+ throw new Error("Value for sharedRequests must be true");
317
+ }
318
+ this.bSharedRequests = mParameters.sharedRequests === true;
319
+
320
+ this.mHeaders = {"Accept-Language" : sLanguageTag};
321
+ this.mMetadataHeaders = {"Accept-Language" : sLanguageTag};
322
+
323
+ // BEWARE: do not share mHeaders between _MetadataRequestor and _Requestor!
324
+ this.oMetaModel = new ODataMetaModel(
325
+ _MetadataRequestor.create(this.mMetadataHeaders, sODataVersion,
326
+ Object.assign({}, mUriParameters, mParameters.metadataUrlParams)),
327
+ this.sServiceUrl + "$metadata", mParameters.annotationURI, this,
328
+ mParameters.supportReferences);
329
+ this.oInterface = {
330
+ fetchEntityContainer : this.oMetaModel.fetchEntityContainer.bind(this.oMetaModel),
331
+ fetchMetadata : this.oMetaModel.fetchObject.bind(this.oMetaModel),
332
+ fireSessionTimeout : function () {
333
+ that.fireEvent("sessionTimeout");
334
+ },
335
+ getGroupProperty : this.getGroupProperty.bind(this),
336
+ getOptimisticBatchEnabler : this.getOptimisticBatchEnabler.bind(this),
337
+ getReporter : this.getReporter.bind(this),
338
+ onCreateGroup : function (sGroupId) {
339
+ if (that.isAutoGroup(sGroupId)) {
340
+ that.addPrerenderingTask(that._submitBatch.bind(that, sGroupId, true));
349
341
  }
350
- });
342
+ },
343
+ reportStateMessages : this.reportStateMessages.bind(this),
344
+ reportTransitionMessages : this.reportTransitionMessages.bind(this)
345
+ };
346
+ this.oRequestor = _Requestor.create(this.sServiceUrl, this.oInterface, this.mHeaders,
347
+ mUriParameters, sODataVersion);
348
+ this.changeHttpHeaders(mParameters.httpHeaders);
349
+ this.bEarlyRequests = mParameters.earlyRequests;
350
+ if (this.bEarlyRequests) {
351
+ this.oMetaModel.fetchEntityContainer(true);
352
+ this.initializeSecurityToken();
353
+ this.oRequestor.sendOptimisticBatch();
354
+ }
355
+
356
+ this.aAllBindings = [];
357
+ // The bindings holding keep-alive contexts without a $$getKeepAlive binding
358
+ this.mKeepAliveBindingsByPath = {};
359
+ this.mSupportedBindingModes = {
360
+ OneTime : true,
361
+ OneWay : true
362
+ };
363
+ if (mParameters.sharedRequests) {
364
+ this.sDefaultBindingMode = BindingMode.OneWay;
365
+ } else {
366
+ this.sDefaultBindingMode = BindingMode.TwoWay;
367
+ this.mSupportedBindingModes.TwoWay = true;
368
+ }
369
+ this.aPrerenderingTasks = null; // @see #addPrerenderingTask
370
+ this.fnOptimisticBatchEnabler = null;
371
+ }
351
372
 
352
373
  /**
353
374
  * Submits the requests associated with this group ID in one batch request.
@@ -435,7 +456,8 @@ sap.ui.define([
435
456
  * @private
436
457
  */
437
458
  ODataModel.prototype.addPrerenderingTask = function (fnPrerenderingTask, bFirst) {
438
- var fnRunTasks, iTimeoutId, that = this;
459
+ var fnRunTasks, iTimeoutId,
460
+ that = this;
439
461
 
440
462
  function runTasks(aTasks) {
441
463
  clearTimeout(iTimeoutId);
@@ -645,6 +667,12 @@ sap.ui.define([
645
667
  * Whether a binding relative to a {@link sap.ui.model.odata.v4.Context} uses the canonical
646
668
  * path computed from its context's path for data service requests; only the value
647
669
  * <code>true</code> is allowed.
670
+ * @param {boolean} [mParameters.$$getKeepAliveContext]
671
+ * Whether this binding is considered for a match when {@link #getKeepAliveContext} is called;
672
+ * only the value <code>true</code> is allowed. Must not be combined with <code>$apply</code>,
673
+ * <code>$$aggregation</code>, <code>$$canonicalPath</code>, or <code>$$sharedRequest</code>.
674
+ * If the binding is relative, <code>$$ownRequest</code> must be set as well.
675
+ * Supported since 1.99.0
648
676
  * @param {string} [mParameters.$$groupId]
649
677
  * The group ID to be used for <b>read</b> requests triggered by this binding; if not
650
678
  * specified, either the parent binding's group ID (if the binding is relative) or the
@@ -852,7 +880,7 @@ sap.ui.define([
852
880
  * @param {string[]} aAllowed The allowed system query options
853
881
  * @throws {error} If the given query option name is not allowed
854
882
  */
855
- function parseAndValidateSystemQueryOption (mOptions, sOptionName, aAllowed) {
883
+ function parseAndValidateSystemQueryOption(mOptions, sOptionName, aAllowed) {
856
884
  var sExpandOptionName,
857
885
  mExpandOptions,
858
886
  sExpandPath,
@@ -879,7 +907,7 @@ sap.ui.define([
879
907
  }
880
908
  }
881
909
  } else if (sOptionName === "$count") {
882
- if (typeof vValue === "boolean") {
910
+ if (typeof vValue === "boolean") {
883
911
  if (!vValue) {
884
912
  delete mOptions.$count;
885
913
  }
@@ -1125,7 +1153,7 @@ sap.ui.define([
1125
1153
  + "' without context");
1126
1154
  }
1127
1155
 
1128
- iSeparator = sResolvedPath.indexOf('#');
1156
+ iSeparator = sResolvedPath.indexOf("#");
1129
1157
  if (iSeparator >= 0) {
1130
1158
  sDataPath = sResolvedPath.slice(0, iSeparator);
1131
1159
  sMetaPath = sResolvedPath.slice(iSeparator + 1);
@@ -1480,6 +1508,115 @@ sap.ui.define([
1480
1508
  throw new Error("Unsupported operation: v4.ODataModel#getProperty");
1481
1509
  };
1482
1510
 
1511
+ /**
1512
+ * Returns a context with the given path belonging to a matching list binding that has been
1513
+ * marked with <code>$$getKeepAliveContext</code> (see {@link #bindList}). If such a matching
1514
+ * binding can be found, a context is returned and kept alive (see
1515
+ * {@link sap.ui.model.odata.v4.ODataListBinding#getKeepAliveContext}). Since 1.100.0 a
1516
+ * temporary binding is used if no such binding could be found. If such a binding is created or
1517
+ * resolved later, the context and its data are transferred to it, and the temporary binding is
1518
+ * destroyed again.
1519
+ *
1520
+ * A <code>$$getKeepAliveContext</code> binding matches if its resolved binding path is the
1521
+ * collection path of the context. If the context is created using a temporary binding and the
1522
+ * parameters of the <code>$$getKeepAliveContext</code> binding differ from the given
1523
+ * <code>mParameters</code> (except <code>$$groupId</code> which is especially used for the
1524
+ * context), that binding later runs into an error when trying to read data.
1525
+ *
1526
+ * <b>Note</b>: The context received by this function may change its
1527
+ * {@link sap.ui.model.odata.v4.Context#getBinding binding} during its lifetime.
1528
+ *
1529
+ * @param {string} sPath
1530
+ * A list context path to an entity
1531
+ * @param {boolean} [bRequestMessages]
1532
+ * Whether to request messages for the context's entity
1533
+ * @param {object} [mParameters]
1534
+ * Parameters for the context or the temporary binding; supported since 1.100.0. All custom
1535
+ * query options and the following binding-specific parameters for a list binding may be given
1536
+ * (see {@link #bindList} for details).
1537
+ * @param {string} [mParameters.$$groupId]
1538
+ * The group ID used for read requests for the context's entity or its properties. If not
1539
+ * given, the model's {@link #getGroupId group ID} is used
1540
+ * @param {boolean} [mParameters.$$patchWithoutSideEffects]
1541
+ * Whether implicit loading of side effects via PATCH requests is switched off
1542
+ * @param {string} [mParameters.$$updateGroupId]
1543
+ * The group ID to be used for <b>update</b> requests triggered by the context's binding
1544
+ * @returns {sap.ui.model.odata.v4.Context|undefined}
1545
+ * The context, or <code>undefined</code> if a binding with a suspended root binding matches
1546
+ * and has no context with that path.
1547
+ * @throws {Error} If
1548
+ * <ul>
1549
+ * <li> the model does not use the <code>autoExpandSelect</code> parameter,
1550
+ * <li> an invalid parameter was supplied,
1551
+ * <li> the path is not a list context path to an entity,
1552
+ * <li> multiple list bindings with <code>$$getKeepAliveContext</code> match, or
1553
+ * <li> {@link sap.ui.model.odata.v4.Context#setKeepAlive} fails
1554
+ * </ul>
1555
+ *
1556
+ * @public
1557
+ * @since 1.99.0
1558
+ */
1559
+ ODataModel.prototype.getKeepAliveContext = function (sPath, bRequestMessages, mParameters) {
1560
+ var oListBinding,
1561
+ aListBindings,
1562
+ sListPath;
1563
+
1564
+ if (!this.bAutoExpandSelect) {
1565
+ throw new Error("Missing parameter autoExpandSelect");
1566
+ }
1567
+ if (sPath[0] !== "/") {
1568
+ throw new Error("Not a list context path to an entity: " + sPath);
1569
+ }
1570
+ mParameters = mParameters || {};
1571
+ // Only excess parameters are rejected here; the correctness is checked by ODLB
1572
+ Object.keys(mParameters).forEach(function (sParameter) {
1573
+ if (sParameter.startsWith("sap-") && !sParameter.startsWith("sap-valid-")
1574
+ || sParameter[0] === "$" && !aGetKeepAliveParameters.includes(sParameter)) {
1575
+ throw new Error("Invalid parameter: " + sParameter);
1576
+ }
1577
+ });
1578
+ sListPath = sPath.slice(0, this.getPredicateIndex(sPath));
1579
+ oListBinding = this.mKeepAliveBindingsByPath[sListPath];
1580
+ if (!oListBinding) {
1581
+ aListBindings = this.aAllBindings.filter(function (oBinding) {
1582
+ if (oBinding.mParameters && oBinding.mParameters.$$getKeepAliveContext) {
1583
+ oBinding.removeCachesAndMessages(sListPath.slice(1), true);
1584
+ }
1585
+ return oBinding.isKeepAliveBindingFor && oBinding.isKeepAliveBindingFor(sListPath);
1586
+ });
1587
+ if (aListBindings.length > 1) {
1588
+ throw new Error("Multiple bindings with $$getKeepAliveContext for: " + sPath);
1589
+ }
1590
+ oListBinding = aListBindings[0];
1591
+ if (!oListBinding) {
1592
+ oListBinding = this.bindList(sListPath, undefined, undefined, undefined,
1593
+ mParameters);
1594
+ this.mKeepAliveBindingsByPath[sListPath] = oListBinding;
1595
+ }
1596
+ }
1597
+
1598
+ return oListBinding.getKeepAliveContext(sPath, bRequestMessages, mParameters.$$groupId);
1599
+ };
1600
+
1601
+ /**
1602
+ * Returns the index of the key predicate in the last segment of the given path.
1603
+ *
1604
+ * @param {string} sPath - The path
1605
+ * @returns {number} The index of the key predicate
1606
+ * @throws {Error} If the last segment contains no key predicate
1607
+ *
1608
+ * @private
1609
+ */
1610
+ ODataModel.prototype.getPredicateIndex = function (sPath) {
1611
+ var iPredicateIndex = sPath.indexOf("(", sPath.lastIndexOf("/"));
1612
+
1613
+ if (iPredicateIndex < 0 || !sPath.endsWith(")")) {
1614
+ throw new Error("Not a list context path to an entity: " + sPath);
1615
+ }
1616
+
1617
+ return iPredicateIndex;
1618
+ };
1619
+
1483
1620
  /**
1484
1621
  * Returns the model's update group ID.
1485
1622
  *
@@ -1517,7 +1654,8 @@ sap.ui.define([
1517
1654
  /**
1518
1655
  * Returns <code>true</code> if there are pending changes, meaning updates or created entities
1519
1656
  * (see {@link sap.ui.model.odata.v4.ODataListBinding#create}) that have not yet been
1520
- * successfully sent to the server.
1657
+ * successfully sent to the server. Since 1.98.0,
1658
+ * {@link sap.ui.model.odata.v4.Context#isInactive inactive} contexts are ignored.
1521
1659
  *
1522
1660
  * @param {string} [sGroupId]
1523
1661
  * A group ID as specified in {@link sap.ui.model.odata.v4.ODataModel}, except group IDs
@@ -1553,12 +1691,25 @@ sap.ui.define([
1553
1691
  this.oRequestor.refreshSecurityToken().catch(function () {});
1554
1692
  };
1555
1693
 
1694
+ /**
1695
+ * Determines whether the given group ID uses mode {@link sap.ui.model.odata.v4.SubmitMode.API}
1696
+ *
1697
+ * @param {string} sGroupId
1698
+ * The group ID
1699
+ * @returns {boolean|undefined} Whether it is an API group
1700
+ *
1701
+ * @private
1702
+ */
1703
+ ODataModel.prototype.isApiGroup = function (sGroupId) {
1704
+ return this.getGroupProperty(sGroupId, "submit") === SubmitMode.API;
1705
+ };
1706
+
1556
1707
  /**
1557
1708
  * Determines whether the given group ID uses mode {@link sap.ui.model.odata.v4.SubmitMode.Auto}
1558
1709
  *
1559
1710
  * @param {string} sGroupId
1560
1711
  * The group ID
1561
- * @returns {boolean|undefined} Whether it is an auto group
1712
+ * @returns {boolean} Whether it is an auto group
1562
1713
  *
1563
1714
  * @private
1564
1715
  */
@@ -1572,7 +1723,7 @@ sap.ui.define([
1572
1723
  *
1573
1724
  * @param {string} sGroupId
1574
1725
  * The group ID
1575
- * @returns {boolean|undefined} Whether it is a direct group
1726
+ * @returns {boolean} Whether it is a direct group
1576
1727
  *
1577
1728
  * @private
1578
1729
  */
@@ -1663,7 +1814,8 @@ sap.ui.define([
1663
1814
  }
1664
1815
  this.checkGroupId(sGroupId);
1665
1816
 
1666
- // Note: getBindings() returns an array that contains all bindings with change listeners (owned by Model)
1817
+ // Note: getBindings() returns an array that contains all bindings with change listeners
1818
+ // (owned by Model)
1667
1819
  this.getBindings().forEach(function (oBinding) {
1668
1820
  if (oBinding.isRoot()) {
1669
1821
  // ignore the group ID for suspended bindings to avoid mismatches and errors; they
@@ -1673,6 +1825,24 @@ sap.ui.define([
1673
1825
  });
1674
1826
  };
1675
1827
 
1828
+ /**
1829
+ * Returns and releases the temporary keep-alive binding for the given path.
1830
+ *
1831
+ * @param {string} sPath - The path
1832
+ * @returns {sap.ui.model.odata.v4.ODataListBinding|undefined}
1833
+ * The binding or <code>undefined</code> if there is none
1834
+ *
1835
+ * @private
1836
+ */
1837
+ ODataModel.prototype.releaseKeepAliveBinding = function (sPath) {
1838
+ var oBinding = this.mKeepAliveBindingsByPath[sPath];
1839
+
1840
+ if (oBinding) {
1841
+ delete this.mKeepAliveBindingsByPath[sPath];
1842
+ return oBinding;
1843
+ }
1844
+ };
1845
+
1676
1846
  /**
1677
1847
  * Reports a technical error by firing a <code>messageChange</code> event with a new message and
1678
1848
  * logging the error to the console. Takes care that the error is only reported once via the
@@ -1748,7 +1918,7 @@ sap.ui.define([
1748
1918
  *
1749
1919
  * @private
1750
1920
  */
1751
- ODataModel.prototype.reportStateMessages = function (sResourcePath, mPathToODataMessages,
1921
+ ODataModel.prototype.reportStateMessages = function (sResourcePath, mPathToODataMessages,
1752
1922
  aCachePaths) {
1753
1923
  var sDataBindingPath = "/" + sResourcePath,
1754
1924
  aNewMessages = [],
@@ -1836,7 +2006,7 @@ sap.ui.define([
1836
2006
  * @param {string[]} aAbsolutePaths
1837
2007
  * The absolute paths to request side effects for; each path must not start with the fully
1838
2008
  * qualified container name.
1839
- * @returns {sap.ui.base.SyncPromise}
2009
+ * @returns {sap.ui.base.SyncPromise|undefined}
1840
2010
  * A promise resolving without a defined result, or rejecting with an error if loading of side
1841
2011
  * effects fails, or <code>undefined</code> if there is nothing to do
1842
2012
  *
@@ -1906,7 +2076,7 @@ sap.ui.define([
1906
2076
  * A relative or absolute path within the data model
1907
2077
  * @param {sap.ui.model.Context} [oContext]
1908
2078
  * The context to be used as a starting point in case of a relative path
1909
- * @returns {string}
2079
+ * @returns {string|undefined}
1910
2080
  * Resolved path or <code>undefined</code>
1911
2081
  *
1912
2082
  * @private
@@ -1950,6 +2120,79 @@ sap.ui.define([
1950
2120
  throw new Error("Unsupported operation: v4.ODataModel#setLegacySyntax");
1951
2121
  };
1952
2122
 
2123
+ /**
2124
+ * Getter for the optimistic batch enabler callback function; see
2125
+ * {@link sap.ui.model.odata.v4.ODataModel#setOptimisticBatchEnabler}.
2126
+ *
2127
+ *
2128
+ * @returns {function(string)}
2129
+ * The optimistic batch enabler callback function
2130
+ *
2131
+ * @experimental As of version 1.100.0
2132
+ * @private
2133
+ * @ui5-restricted sap.fe
2134
+ */
2135
+ ODataModel.prototype.getOptimisticBatchEnabler = function () {
2136
+ return this.fnOptimisticBatchEnabler;
2137
+ };
2138
+
2139
+ /**
2140
+ * Setter for the optimistic batch enabler callback function. Setting this callback activates
2141
+ * the optimistic batch feature. Via the callback the optimistic batch behavior can be enabled
2142
+ * or disabled by returning either a boolean or a promise resolving with a boolean.
2143
+ * As its first argument the callback gets the <code>window.location.href</code> at the point in
2144
+ * time when the OData model is instantiated.
2145
+ *
2146
+ * If the callback returns or resolves with <code>true</code>, the OData model remembers the
2147
+ * first sent $batch request. With the next model instantiation for the same key, this
2148
+ * remembered $batch request will be sent at the earliest point in time in order to have the
2149
+ * response already available when the first $batch request is triggered from the UI or the
2150
+ * binding. If the returned promise is rejected, this error will be reported and the optimistic
2151
+ * batch will be disabled.
2152
+ *
2153
+ * There are several preconditions on the usage of this API:
2154
+ * <ul>
2155
+ * <li> Optimistic batch handling requires the "earlyRequests" model parameter; see
2156
+ * {@link sap.ui.model.odata.v4.ODataModel#constructor},
2157
+ * <li> the setter has to be called before the first $batch request is sent,
2158
+ * <li> the setter may only be called once for an OData model,
2159
+ * <li> the callback has to return a boolean, or a <code>Promise</code> resolving with a
2160
+ * boolean
2161
+ * <li> the callback is not called if the first $batch request is modifying, means that it
2162
+ * contains not only GET requests.
2163
+ * </ul>
2164
+ *
2165
+ * @param {function(string):Promise<boolean>|boolean} fnOptimisticBatchEnabler
2166
+ * The optimistic batch enabler callback controlling whether optimistic batch should be used
2167
+ * @throws {Error} If
2168
+ * <ul>
2169
+ * <li> the earlyRequests model parameter is not set,
2170
+ * <li> the setter is called after the first $batch request is sent,
2171
+ * <li> the given <code>fnOptimisticBatchEnabler</code> parameter is not a function
2172
+ * <li> the setter is called more than once
2173
+ * </ul>
2174
+ *
2175
+ * @experimental As of version 1.100.0
2176
+ * @private
2177
+ * @ui5-restricted sap.fe
2178
+ */
2179
+ ODataModel.prototype.setOptimisticBatchEnabler = function (fnOptimisticBatchEnabler) {
2180
+ if (!this.bEarlyRequests) {
2181
+ throw new Error("The earlyRequests model parameter is not set");
2182
+ }
2183
+ if (this.oRequestor.isFirstBatchSent()) {
2184
+ throw new Error("The setter is called after the first $batch request is sent");
2185
+ }
2186
+ if (typeof fnOptimisticBatchEnabler !== "function") {
2187
+ throw new Error("The given fnOptimisticBatchEnabler parameter is not a function");
2188
+ }
2189
+ if (this.fnOptimisticBatchEnabler) {
2190
+ throw new Error("The setter is called more than once");
2191
+ }
2192
+
2193
+ this.fnOptimisticBatchEnabler = fnOptimisticBatchEnabler;
2194
+ };
2195
+
1953
2196
  /**
1954
2197
  * Submits the requests associated with the given group ID in one batch request. Requests from
1955
2198
  * subsequent calls to this method for the same group ID may be combined in one batch request