@openui5/sap.ui.core 1.105.1 → 1.107.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.
- package/.reuse/dep5 +20 -17
- package/THIRDPARTY.txt +31 -21
- package/package.json +1 -1
- package/src/jquery.sap.dom.js +10 -10
- package/src/jquery.sap.global.js +24 -216
- package/src/jquery.sap.history.js +1 -1
- package/src/jquery.sap.properties.js +2 -2
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +4 -4
- package/src/jquery.sap.ui.js +5 -7
- package/src/sap/base/i18n/ResourceBundle.js +7 -11
- package/src/sap/base/util/LoaderExtensions.js +6 -6
- package/src/sap/base/util/ObjectPath.js +1 -1
- package/src/sap/base/util/Properties.js +1 -1
- package/src/sap/base/util/fetch.js +8 -10
- package/src/sap/base/util/mixedFetch.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/base/util/syncFetch.js +9 -16
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +7 -14
- package/src/sap/ui/VersionInfo.js +57 -54
- package/src/sap/ui/base/BindingInfo.js +198 -0
- package/src/sap/ui/base/DataType.js +5 -5
- package/src/sap/ui/base/Event.js +2 -2
- package/src/sap/ui/base/EventProvider.js +2 -2
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +209 -979
- package/src/sap/ui/base/ManagedObjectMetadata.js +6 -6
- package/src/sap/ui/base/ManagedObjectRegistry.js +4 -3
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +13 -9
- package/src/sap/ui/core/AppCacheBuster.js +3 -4
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/BusyIndicatorUtils.js +5 -6
- package/src/sap/ui/core/CalendarType.js +0 -1
- package/src/sap/ui/core/Component.js +16 -14
- package/src/sap/ui/core/ComponentContainer.js +6 -5
- package/src/sap/ui/core/ComponentMetadata.js +5 -12
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +525 -336
- package/src/sap/ui/core/Control.js +7 -7
- package/src/sap/ui/core/Core.js +102 -422
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +65 -9
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/FocusHandler.js +79 -9
- package/src/sap/ui/core/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +1 -2
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -2
- package/src/sap/ui/core/IconPool.js +8 -8
- package/src/sap/ui/core/IndicationColorSupport.js +2 -2
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -2
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +5 -5
- package/src/sap/ui/core/Item.js +1 -2
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -2
- package/src/sap/ui/core/ListItem.js +1 -2
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -2
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +15 -13
- package/src/sap/ui/core/Manifest.js +8 -6
- package/src/sap/ui/core/Message.js +4 -6
- package/src/sap/ui/core/Popup.js +63 -6
- package/src/sap/ui/core/RenderManager.js +13 -5
- package/src/sap/ui/core/Renderer.js +5 -4
- package/src/sap/ui/core/Rendering.js +251 -0
- package/src/sap/ui/core/ResizeHandler.js +7 -7
- package/src/sap/ui/core/ScrollBar.js +6 -9
- package/src/sap/ui/core/ScrollBarRenderer.js +3 -3
- package/src/sap/ui/core/SeparatorItem.js +1 -2
- package/src/sap/ui/core/Title.js +1 -2
- package/src/sap/ui/core/TooltipBase.js +12 -14
- package/src/sap/ui/core/UIArea.js +396 -129
- package/src/sap/ui/core/UIComponent.js +3 -4
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +2 -2
- package/src/sap/ui/core/VariantLayoutData.js +1 -2
- package/src/sap/ui/core/XMLComposite.js +2 -2
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +12 -10
- package/src/sap/ui/core/_ConfigurationProvider.js +187 -0
- package/src/sap/ui/core/cache/CacheManager.js +9 -8
- package/src/sap/ui/core/cache/LRUPersistentCache.js +4 -4
- package/src/sap/ui/core/cldr/es_BO.json +3 -3
- package/src/sap/ui/core/cldr/es_CL.json +3 -3
- package/src/sap/ui/core/cldr/es_MX.json +3 -3
- package/src/sap/ui/core/cldr/es_PE.json +3 -3
- package/src/sap/ui/core/cldr/es_UY.json +3 -3
- package/src/sap/ui/core/cldr/es_VE.json +2 -2
- package/src/sap/ui/core/date/Islamic.js +4 -4
- package/src/sap/ui/core/date/UniversalDate.js +8 -8
- package/src/sap/ui/core/date/UniversalDateUtils.js +3 -3
- package/src/sap/ui/core/delegate/ItemNavigation.js +5 -5
- package/src/sap/ui/core/delegate/ScrollEnablement.js +7 -6
- package/src/sap/ui/core/dnd/DragAndDrop.js +14 -9
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -2
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -2
- package/src/sap/ui/core/dnd/DragInfo.js +1 -2
- package/src/sap/ui/core/dnd/DropInfo.js +1 -2
- package/src/sap/ui/core/format/DateFormat.js +14 -7
- package/src/sap/ui/core/format/DateFormatTimezoneDisplay.js +0 -1
- package/src/sap/ui/core/format/FileSizeFormat.js +4 -3
- package/src/sap/ui/core/format/ListFormat.js +4 -3
- package/src/sap/ui/core/format/NumberFormat.js +7 -6
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +7 -6
- package/src/sap/ui/core/library.js +3 -55
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +13 -23
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/mvc/Controller.js +8 -3
- package/src/sap/ui/core/mvc/EventHandlerResolver.js +5 -3
- package/src/sap/ui/core/mvc/HTMLView.js +1 -2
- package/src/sap/ui/core/mvc/JSONView.js +1 -2
- package/src/sap/ui/core/mvc/JSView.js +2 -3
- package/src/sap/ui/core/mvc/TemplateView.js +1 -2
- package/src/sap/ui/core/mvc/View.js +21 -20
- package/src/sap/ui/core/mvc/ViewType.js +0 -1
- package/src/sap/ui/core/mvc/XMLView.js +18 -18
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/Router.js +1 -1
- package/src/sap/ui/core/routing/async/Target.js +4 -3
- package/src/sap/ui/core/rules/App.support.js +11 -13
- package/src/sap/ui/core/rules/Config.support.js +19 -17
- package/src/sap/ui/core/rules/CoreHelper.support.js +4 -4
- package/src/sap/ui/core/rules/Model.support.js +8 -8
- package/src/sap/ui/core/rules/Rendering.support.js +1 -1
- package/src/sap/ui/core/rules/Theming.support.js +8 -8
- package/src/sap/ui/core/rules/View.support.js +9 -9
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -2
- package/src/sap/ui/core/search/SearchProvider.js +1 -3
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Hotkeys.js +2 -3
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/ToolsAPI.js +11 -13
- package/src/sap/ui/core/support/plugins/ControlTree.js +4 -4
- package/src/sap/ui/core/support/plugins/Debugging.js +3 -3
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +2 -2
- package/src/sap/ui/core/support/support.html +1 -1
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +10 -8
- package/src/sap/ui/core/theming/Parameters.js +8 -15
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -2
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -4
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +6 -5
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -2
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +48 -72
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/ResponsivePaddingsEnablement.js +4 -3
- package/src/sap/ui/core/util/XMLPreprocessor.js +2 -2
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +1 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +4 -4
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +3 -3
- package/src/sap/ui/debug/DebugEnv.js +4 -4
- package/src/sap/ui/debug/PropertyList.css +1 -31
- package/src/sap/ui/debug/PropertyList.js +6 -250
- package/src/sap/ui/dom/getScrollbarSize.js +1 -1
- package/src/sap/ui/dom/jquery/control.js +1 -0
- package/src/sap/ui/events/jquery/EventSimulation.js +4 -4
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/ClientTreeBinding.js +3 -1
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/Context.js +3 -0
- package/src/sap/ui/model/ContextBinding.js +1 -1
- package/src/sap/ui/model/DataState.js +2 -2
- package/src/sap/ui/model/ListBinding.js +2 -2
- package/src/sap/ui/model/ManagedObjectBindingSupport.js +871 -0
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +16 -5
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +2 -2
- package/src/sap/ui/model/Sorter.js +24 -19
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/TreeBindingAdapter.js +3 -7
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -0
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +5 -7
- package/src/sap/ui/model/json/JSONModel.js +9 -7
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/AnnotationHelper.js +4 -4
- package/src/sap/ui/model/odata/ODataAnnotations.js +5 -3
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +10 -10
- package/src/sap/ui/model/odata/ODataMetadata.js +5 -4
- package/src/sap/ui/model/odata/ODataModel.js +6 -5
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +0 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +5 -5
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +4 -3
- package/src/sap/ui/model/odata/v2/ODataContextBinding.js +25 -16
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +46 -28
- package/src/sap/ui/model/odata/v2/ODataModel.js +97 -39
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +5 -5
- package/src/sap/ui/model/odata/v4/AnnotationHelper.js +3 -3
- package/src/sap/ui/model/odata/v4/Context.js +109 -71
- package/src/sap/ui/model/odata/v4/ODataBinding.js +50 -7
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +88 -68
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +116 -81
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +23 -20
- package/src/sap/ui/model/odata/v4/ODataModel.js +350 -88
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +35 -9
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +15 -9
- package/src/sap/ui/model/odata/v4/ODataUtils.js +8 -5
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +45 -33
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +40 -6
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +135 -81
- package/src/sap/ui/model/odata/v4/lib/_ConcatHelper.js +2 -3
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +179 -36
- package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +2 -3
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +26 -7
- package/src/sap/ui/model/resource/ResourceModel.js +8 -7
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +2 -2
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +2 -2
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +5 -4
- package/src/sap/ui/model/xml/XMLModel.js +8 -6
- package/src/sap/ui/performance/trace/Interaction.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa.js +7 -5
- package/src/sap/ui/test/Opa5.js +9 -15
- package/src/sap/ui/test/OpaBuilder.js +1 -1
- package/src/sap/ui/test/RecorderHotkeyListener.js +1 -1
- package/src/sap/ui/test/TestUtils.js +83 -1
- package/src/sap/ui/test/autowaiter/_autoWaiter.js +9 -0
- package/src/sap/ui/test/autowaiter/_cssAnimationWaiter.js +114 -0
- package/src/sap/ui/test/autowaiter/_cssTransitionWaiter.js +99 -0
- package/src/sap/ui/test/autowaiter/_jsAnimationWaiter.js +70 -0
- package/src/sap/ui/test/autowaiter/_resourceWaiter.js +3 -12
- package/src/sap/ui/test/autowaiter/_utils.js +13 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/matchers/Ancestor.js +1 -0
- package/src/sap/ui/test/matchers/Descendant.js +1 -0
- package/src/sap/ui/test/matchers/Sibling.js +1 -0
- package/src/sap/ui/util/Storage.js +1 -1
|
@@ -36,6 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
"sap/base/Log",
|
|
37
37
|
"sap/ui/base/SyncPromise",
|
|
38
38
|
"sap/ui/core/cache/CacheManager",
|
|
39
|
+
"sap/ui/core/Configuration",
|
|
39
40
|
"sap/ui/core/library",
|
|
40
41
|
"sap/ui/core/message/Message",
|
|
41
42
|
"sap/ui/model/BindingMode",
|
|
@@ -45,18 +46,16 @@ sap.ui.define([
|
|
|
45
46
|
"sap/ui/thirdparty/URI"
|
|
46
47
|
], function (ODataContextBinding, ODataListBinding, ODataMetaModel, ODataPropertyBinding,
|
|
47
48
|
SubmitMode, _GroupLock, _Helper, _MetadataRequestor, _Parser, _Requestor, assert, Log,
|
|
48
|
-
SyncPromise, CacheManager, coreLibrary, Message, BindingMode, BaseContext,
|
|
49
|
-
OperationMode, URI) {
|
|
49
|
+
SyncPromise, CacheManager, Configuration, coreLibrary, Message, BindingMode, BaseContext,
|
|
50
|
+
Model, OperationMode, URI) {
|
|
50
51
|
"use strict";
|
|
51
52
|
|
|
52
|
-
var
|
|
53
|
-
sClassName = "sap.ui.model.odata.v4.ODataModel",
|
|
53
|
+
var sClassName = "sap.ui.model.odata.v4.ODataModel",
|
|
54
54
|
// system query options allowed within a $expand query option
|
|
55
55
|
aExpandQueryOptions = ["$count", "$expand", "$filter", "$levels", "$orderby", "$search",
|
|
56
56
|
"$select"],
|
|
57
57
|
// binding-specific parameters allowed in getKeepAliveContext
|
|
58
58
|
aGetKeepAliveParameters = ["$$groupId", "$$patchWithoutSideEffects", "$$updateGroupId"],
|
|
59
|
-
rGroupID = /^(\$auto(\.\w+)?|\$direct|\w+)$/,
|
|
60
59
|
MessageType = coreLibrary.MessageType,
|
|
61
60
|
aMessageTypes = [
|
|
62
61
|
undefined,
|
|
@@ -66,6 +65,8 @@ sap.ui.define([
|
|
|
66
65
|
MessageType.Error
|
|
67
66
|
],
|
|
68
67
|
mSupportedEvents = {
|
|
68
|
+
dataReceived : true,
|
|
69
|
+
dataRequested : true,
|
|
69
70
|
messageChange : true,
|
|
70
71
|
sessionTimeout : true
|
|
71
72
|
},
|
|
@@ -146,9 +147,10 @@ sap.ui.define([
|
|
|
146
147
|
* Root URL of the service to request data from. The path part of the URL must end with a
|
|
147
148
|
* forward slash according to OData V4 specification ABNF, rule "serviceRoot". You may
|
|
148
149
|
* append OData custom query options to the service root URL separated with a "?", for
|
|
149
|
-
* example "/MyService/?custom=foo". See specification
|
|
150
|
-
*
|
|
151
|
-
*
|
|
150
|
+
* example "/MyService/?custom=foo". See specification <a href=
|
|
151
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html#_Custom_Query_Options"
|
|
152
|
+
* >"OData Version 4.0 Part 2: URL Conventions", "5.2 Custom Query Options"</a>. OData
|
|
153
|
+
* system query options and OData parameter aliases lead to an error.
|
|
152
154
|
* @param {boolean} [mParameters.sharedRequests]
|
|
153
155
|
* Whether all list bindings for the same resource path share their data, so that it is
|
|
154
156
|
* requested only once; only the value <code>true</code> is allowed; see parameter
|
|
@@ -182,7 +184,9 @@ sap.ui.define([
|
|
|
182
184
|
* This model is not prepared to be inherited from.
|
|
183
185
|
*
|
|
184
186
|
* Every resource path (relative to the service root URL, no query options) according to
|
|
185
|
-
*
|
|
187
|
+
* <a href=
|
|
188
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html#resource-pathurl4"
|
|
189
|
+
* >"4 Resource Path"</a> in specification "OData Version 4.0 Part 2: URL Conventions" is
|
|
186
190
|
* a valid data binding path within this model if a leading slash is added; for example
|
|
187
191
|
* "/" + "SalesOrderList('A%2FB%26C')" to access an entity instance with key "A/B&C". Note
|
|
188
192
|
* that appropriate URI encoding is necessary, see the example of
|
|
@@ -214,7 +218,7 @@ sap.ui.define([
|
|
|
214
218
|
* @extends sap.ui.model.Model
|
|
215
219
|
* @public
|
|
216
220
|
* @since 1.37.0
|
|
217
|
-
* @version 1.
|
|
221
|
+
* @version 1.107.0
|
|
218
222
|
*/
|
|
219
223
|
ODataModel = Model.extend("sap.ui.model.odata.v4.ODataModel",
|
|
220
224
|
/** @lends sap.ui.model.odata.v4.ODataModel.prototype */{
|
|
@@ -240,9 +244,10 @@ sap.ui.define([
|
|
|
240
244
|
function constructor(mParameters) {
|
|
241
245
|
var sGroupId,
|
|
242
246
|
oGroupProperties,
|
|
243
|
-
sLanguageTag =
|
|
247
|
+
sLanguageTag = Configuration.getLanguageTag(),
|
|
244
248
|
sODataVersion,
|
|
245
249
|
sParameter,
|
|
250
|
+
mQueryParams,
|
|
246
251
|
sServiceUrl,
|
|
247
252
|
oUri,
|
|
248
253
|
mUriParameters,
|
|
@@ -281,7 +286,7 @@ sap.ui.define([
|
|
|
281
286
|
mUriParameters = this.buildQueryOptions(oUri.query(true), false, true);
|
|
282
287
|
// BEWARE: these are shared across all bindings!
|
|
283
288
|
this.mUriParameters = mUriParameters;
|
|
284
|
-
if (
|
|
289
|
+
if (Configuration.getStatisticsEnabled()) {
|
|
285
290
|
// Note: this way, "sap-statistics" is not sent within $batch
|
|
286
291
|
mUriParameters = Object.assign({"sap-statistics" : true}, mUriParameters);
|
|
287
292
|
}
|
|
@@ -293,11 +298,11 @@ sap.ui.define([
|
|
|
293
298
|
if (this.sGroupId !== "$auto" && this.sGroupId !== "$direct") {
|
|
294
299
|
throw new Error("Group ID must be '$auto' or '$direct'");
|
|
295
300
|
}
|
|
296
|
-
|
|
301
|
+
_Helper.checkGroupId(mParameters.updateGroupId, false, "Invalid update group ID: ");
|
|
297
302
|
this.sUpdateGroupId = mParameters.updateGroupId || this.getGroupId();
|
|
298
303
|
this.mGroupProperties = {};
|
|
299
304
|
for (sGroupId in mParameters.groupProperties) {
|
|
300
|
-
|
|
305
|
+
_Helper.checkGroupId(sGroupId, true);
|
|
301
306
|
oGroupProperties = mParameters.groupProperties[sGroupId];
|
|
302
307
|
if (typeof oGroupProperties !== "object"
|
|
303
308
|
|| Object.keys(oGroupProperties).length !== 1
|
|
@@ -319,22 +324,26 @@ sap.ui.define([
|
|
|
319
324
|
}
|
|
320
325
|
this.bSharedRequests = mParameters.sharedRequests === true;
|
|
321
326
|
|
|
327
|
+
// BEWARE: do not share mHeaders between _MetadataRequestor and _Requestor!
|
|
322
328
|
this.mHeaders = {"Accept-Language" : sLanguageTag};
|
|
323
329
|
this.mMetadataHeaders = {"Accept-Language" : sLanguageTag};
|
|
324
330
|
|
|
325
|
-
|
|
331
|
+
mQueryParams = Object.assign({}, mUriParameters, mParameters.metadataUrlParams);
|
|
326
332
|
this.oMetaModel = new ODataMetaModel(
|
|
327
|
-
_MetadataRequestor.create(this.mMetadataHeaders, sODataVersion,
|
|
328
|
-
Object.assign({}, mUriParameters, mParameters.metadataUrlParams)),
|
|
333
|
+
_MetadataRequestor.create(this.mMetadataHeaders, sODataVersion, mQueryParams),
|
|
329
334
|
this.sServiceUrl + "$metadata", mParameters.annotationURI, this,
|
|
330
|
-
mParameters.supportReferences);
|
|
335
|
+
mParameters.supportReferences, mQueryParams["sap-language"]);
|
|
331
336
|
this.oInterface = {
|
|
332
337
|
fetchEntityContainer : this.oMetaModel.fetchEntityContainer.bind(this.oMetaModel),
|
|
333
338
|
fetchMetadata : this.oMetaModel.fetchObject.bind(this.oMetaModel),
|
|
339
|
+
fireMessageChange : this.fireMessageChange.bind(this),
|
|
340
|
+
fireDataReceived : this.fireDataReceived.bind(this),
|
|
341
|
+
fireDataRequested : this.fireDataRequested.bind(this),
|
|
334
342
|
fireSessionTimeout : function () {
|
|
335
343
|
that.fireEvent("sessionTimeout");
|
|
336
344
|
},
|
|
337
345
|
getGroupProperty : this.getGroupProperty.bind(this),
|
|
346
|
+
getMessagesByPath : this.getMessagesByPath.bind(this),
|
|
338
347
|
getOptimisticBatchEnabler : this.getOptimisticBatchEnabler.bind(this),
|
|
339
348
|
getReporter : this.getReporter.bind(this),
|
|
340
349
|
onCreateGroup : function (sGroupId) {
|
|
@@ -370,6 +379,9 @@ sap.ui.define([
|
|
|
370
379
|
}
|
|
371
380
|
this.aPrerenderingTasks = null; // @see #addPrerenderingTask
|
|
372
381
|
this.fnOptimisticBatchEnabler = null;
|
|
382
|
+
this.oDataReceivedError = undefined; // the error for the next dataReceived event
|
|
383
|
+
// counts the fireDataRequested calls for which one event was fired
|
|
384
|
+
this.iDataRequestedCount = 0;
|
|
373
385
|
}
|
|
374
386
|
|
|
375
387
|
/**
|
|
@@ -397,6 +409,62 @@ sap.ui.define([
|
|
|
397
409
|
});
|
|
398
410
|
};
|
|
399
411
|
|
|
412
|
+
/**
|
|
413
|
+
* The 'dataReceived' event is fired when the back-end data has been received on the client. It
|
|
414
|
+
* is only fired for GET requests and is to be used by applications to process an error.
|
|
415
|
+
*
|
|
416
|
+
* If back-end requests are successful, the event has almost no parameters. For compatibility
|
|
417
|
+
* with {@link sap.ui.model.Binding#event:dataReceived}, an event parameter
|
|
418
|
+
* <code>data : {}</code> is provided: "In error cases it will be undefined", but otherwise it
|
|
419
|
+
* is not.
|
|
420
|
+
*
|
|
421
|
+
* If a back-end request fails, the 'dataReceived' event provides an <code>Error</code> in the
|
|
422
|
+
* 'error' event parameter. If multiple requests are processed within a single $batch
|
|
423
|
+
* (or even a single change set), the order of 'dataReceived' events is not guaranteed. For
|
|
424
|
+
* requests which are not processed because a previous request failed, <code>error.cause</code>
|
|
425
|
+
* points to the root cause error - you should either ignore those events, or unwrap the error
|
|
426
|
+
* to access the root cause immediately.
|
|
427
|
+
*
|
|
428
|
+
* @param {sap.ui.base.Event} oEvent
|
|
429
|
+
* @param {object} oEvent.getParameters()
|
|
430
|
+
* @param {object} [oEvent.getParameters().data]
|
|
431
|
+
* An empty data object if a back-end request succeeds
|
|
432
|
+
* @param {Error} [oEvent.getParameters().error]
|
|
433
|
+
* The error object if a back-end request failed. If there are multiple failed back-end
|
|
434
|
+
* requests, the error of the first one is provided.
|
|
435
|
+
*
|
|
436
|
+
* @event sap.ui.model.odata.v4.ODataModel#dataReceived
|
|
437
|
+
* @public
|
|
438
|
+
* @see sap.ui.model.odata.v4.ODataContextBinding#event:dataReceived
|
|
439
|
+
* @see sap.ui.model.odata.v4.ODataListBinding#event:dataReceived
|
|
440
|
+
* @see sap.ui.model.odata.v4.ODataModel#event:dataRequested
|
|
441
|
+
* @since 1.106.0
|
|
442
|
+
*/
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* The 'dataRequested' event is fired directly after data has been requested from a back end.
|
|
446
|
+
* It is only fired for GET requests. Registered event handlers are called without parameters.
|
|
447
|
+
*
|
|
448
|
+
* There are two kinds of requests leading to such an event:
|
|
449
|
+
* <ul>
|
|
450
|
+
* <li> When a binding requests initial data, or a list binding requests data for additional
|
|
451
|
+
* rows, the event is fired at the binding and may be bubbled up to the model. This includes
|
|
452
|
+
* refreshes except those triggered by
|
|
453
|
+
* {@link sap.ui.model.odata.v4.Context#requestSideEffects}.
|
|
454
|
+
* <li> For additional property requests for an entity that already has been requested, the
|
|
455
|
+
* event is only fired at the model.
|
|
456
|
+
* </ul>
|
|
457
|
+
*
|
|
458
|
+
* @param {sap.ui.base.Event} oEvent
|
|
459
|
+
*
|
|
460
|
+
* @event sap.ui.model.odata.v4.ODataModel#dataRequested
|
|
461
|
+
* @public
|
|
462
|
+
* @see sap.ui.model.odata.v4.ODataContextBinding#event:dataRequested
|
|
463
|
+
* @see sap.ui.model.odata.v4.ODataListBinding#event:dataRequested
|
|
464
|
+
* @see sap.ui.model.odata.v4.ODataModel#event:dataReceived
|
|
465
|
+
* @since 1.106.0
|
|
466
|
+
*/
|
|
467
|
+
|
|
400
468
|
/**
|
|
401
469
|
* The 'parseError' event is not supported by this model.
|
|
402
470
|
*
|
|
@@ -490,6 +558,34 @@ sap.ui.define([
|
|
|
490
558
|
}
|
|
491
559
|
};
|
|
492
560
|
|
|
561
|
+
/**
|
|
562
|
+
* Attach event handler <code>fnFunction</code> to the 'dataReceived' event of this binding.
|
|
563
|
+
*
|
|
564
|
+
* @param {function} fnFunction The function to call when the event occurs
|
|
565
|
+
* @param {object} [oListener] Object on which to call the given function
|
|
566
|
+
* @returns {this} <code>this</code> to allow method chaining
|
|
567
|
+
*
|
|
568
|
+
* @public
|
|
569
|
+
* @since 1.106.0
|
|
570
|
+
*/
|
|
571
|
+
ODataModel.prototype.attachDataReceived = function (fnFunction, oListener) {
|
|
572
|
+
return this.attachEvent("dataReceived", fnFunction, oListener);
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Attach event handler <code>fnFunction</code> to the 'dataRequested' event of this binding.
|
|
577
|
+
*
|
|
578
|
+
* @param {function} fnFunction The function to call when the event occurs
|
|
579
|
+
* @param {object} [oListener] Object on which to call the given function
|
|
580
|
+
* @returns {this} <code>this</code> to allow method chaining
|
|
581
|
+
*
|
|
582
|
+
* @public
|
|
583
|
+
* @since 1.106.0
|
|
584
|
+
*/
|
|
585
|
+
ODataModel.prototype.attachDataRequested = function (fnFunction, oListener) {
|
|
586
|
+
return this.attachEvent("dataRequested", fnFunction, oListener);
|
|
587
|
+
};
|
|
588
|
+
|
|
493
589
|
/**
|
|
494
590
|
* See {@link sap.ui.base.EventProvider#attachEvent}
|
|
495
591
|
*
|
|
@@ -506,8 +602,7 @@ sap.ui.define([
|
|
|
506
602
|
// @override sap.ui.base.EventProvider#attachEvent
|
|
507
603
|
ODataModel.prototype.attachEvent = function (sEventId, _oData, _fnFunction, _oListener) {
|
|
508
604
|
if (!(sEventId in mSupportedEvents)) {
|
|
509
|
-
throw new Error("Unsupported event '" + sEventId
|
|
510
|
-
+ "': v4.ODataModel#attachEvent");
|
|
605
|
+
throw new Error("Unsupported event '" + sEventId + "': v4.ODataModel#attachEvent");
|
|
511
606
|
}
|
|
512
607
|
return Model.prototype.attachEvent.apply(this, arguments);
|
|
513
608
|
};
|
|
@@ -534,9 +629,10 @@ sap.ui.define([
|
|
|
534
629
|
* @param {sap.ui.model.odata.v4.Context} [oContext]
|
|
535
630
|
* The context which is required as base for a relative path
|
|
536
631
|
* @param {object} [mParameters]
|
|
537
|
-
* Map of binding parameters which can be OData query options as specified in
|
|
538
|
-
* "
|
|
539
|
-
*
|
|
632
|
+
* Map of binding parameters which can be OData query options as specified in <a href=
|
|
633
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html"
|
|
634
|
+
* >"OData Version 4.0 Part 2: URL Conventions"</a> or the binding-specific parameters as
|
|
635
|
+
* specified below.
|
|
540
636
|
* Note: The binding creates its own data service request if it is absolute or if it has any
|
|
541
637
|
* parameters or if it is relative and has a context created via
|
|
542
638
|
* {@link #createBindingContext}.
|
|
@@ -551,6 +647,19 @@ sap.ui.define([
|
|
|
551
647
|
* </ul>
|
|
552
648
|
* All other query options lead to an error.
|
|
553
649
|
* Query options specified for the binding overwrite model query options.
|
|
650
|
+
* @param {string|object} [mParameters.$expand]
|
|
651
|
+
* The value for the "5.1.2 System Query Option $expand" or an object which determines that
|
|
652
|
+
* value. The object is a map from expand path to expand options, where the options are again
|
|
653
|
+
* maps of system query options, typically with string values. $count can also be given as a
|
|
654
|
+
* <code>boolean</code> value, $expand can recursively be given as a map, $levels can also be
|
|
655
|
+
* given as a <code>number</code> value, and $select can also be given as an array (but
|
|
656
|
+
* without navigation paths). An empty map can also be given as <code>null</code> or
|
|
657
|
+
* <code>true</code>. See also {@link topic:1ab4f62de6ab467096a2a98b363a1373 Parameters}.
|
|
658
|
+
* @param {string|string[]} [mParameters.$select]
|
|
659
|
+
* A comma separated list or an array of items which determine the value for the
|
|
660
|
+
* "5.1.3 System Query Option $select". Since 1.75.0, when using the "autoExpandSelect" model
|
|
661
|
+
* parameter (see {@link sap.ui.model.odata.v4.ODataModel#constructor}), paths with navigation
|
|
662
|
+
* properties can be included and will contribute to the "5.1.2 System Query Option $expand".
|
|
554
663
|
* @param {boolean} [mParameters.$$canonicalPath]
|
|
555
664
|
* Whether a binding relative to a {@link sap.ui.model.odata.v4.Context} uses the canonical
|
|
556
665
|
* path computed from its context's path for data service requests; only the value
|
|
@@ -647,9 +756,10 @@ sap.ui.define([
|
|
|
647
756
|
* using a logical <code>AND</code>.
|
|
648
757
|
* Supported since 1.39.0.
|
|
649
758
|
* @param {object} [mParameters]
|
|
650
|
-
* Map of binding parameters which can be OData query options as specified in
|
|
651
|
-
* "
|
|
652
|
-
*
|
|
759
|
+
* Map of binding parameters which can be OData query options as specified in <a href=
|
|
760
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html"
|
|
761
|
+
* >"OData Version 4.0 Part 2: URL Conventions"</a> or binding-specific parameters as
|
|
762
|
+
* specified below.
|
|
653
763
|
* Note: The binding creates its own data service request if it is absolute or if it has any
|
|
654
764
|
* parameters or if it is relative and has a context created via {@link #createBindingContext}
|
|
655
765
|
* or if it has sorters or filters.
|
|
@@ -658,10 +768,41 @@ sap.ui.define([
|
|
|
658
768
|
* <li> All "5.2 Custom Query Options" except for those with a name starting with "sap-"
|
|
659
769
|
* (unless starting with "sap-valid-")
|
|
660
770
|
* <li> The $apply, $count, $expand, $filter, $levels, $orderby, $search, and $select
|
|
661
|
-
* "5.1 System Query Options"
|
|
771
|
+
* "5.1 System Query Options"; OData V4 only allows $levels inside $expand.
|
|
662
772
|
* </ul>
|
|
663
773
|
* All other query options lead to an error.
|
|
664
774
|
* Query options specified for the binding overwrite model query options.
|
|
775
|
+
* @param {string} [mParameters.$apply]
|
|
776
|
+
* The value for the "3 System Query Option $apply" (see also
|
|
777
|
+
* <a href="https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/">OData
|
|
778
|
+
* Extension for Data Aggregation Version 4.0</a>) as an alternative to
|
|
779
|
+
* <code>$$aggregation</code>
|
|
780
|
+
* @param {string|boolean} [mParameters.$count]
|
|
781
|
+
* The value for the "5.1.6 System Query Option $count", useful for creation at the end and
|
|
782
|
+
* {@link sap.ui.model.odata.v4.ODataListBinding#getCount}
|
|
783
|
+
* @param {string|object} [mParameters.$expand]
|
|
784
|
+
* The value for the "5.1.2 System Query Option $expand" or an object which determines that
|
|
785
|
+
* value. The object is a map from expand path to expand options, where the options are again
|
|
786
|
+
* maps of system query options, typically with string values. $count can also be given as a
|
|
787
|
+
* <code>boolean</code> value, $expand can recursively be given as a map, $levels can also be
|
|
788
|
+
* given as a <code>number</code> value, and $select can also be given as an array (but
|
|
789
|
+
* without navigation paths). An empty map can also be given as <code>null</code> or
|
|
790
|
+
* <code>true</code>. See also {@link topic:1ab4f62de6ab467096a2a98b363a1373 Parameters}.
|
|
791
|
+
* @param {string} [mParameters.$filter]
|
|
792
|
+
* The value for the "5.1.1 System Query Option $filter" used in addition to
|
|
793
|
+
* <code>vFilters</code>
|
|
794
|
+
* @param {string|number} [mParameters.$orderby]
|
|
795
|
+
* The value for the "5.1.4 System Query Option $orderby" used in addition to
|
|
796
|
+
* <code>vSorters</code>
|
|
797
|
+
* @param {string} [mParameters.$search]
|
|
798
|
+
* The value for the "5.1.7 System Query Option $search"; see also
|
|
799
|
+
* <code>oAggregation.search</code> at
|
|
800
|
+
* {@link sap.ui.model.odata.v4.ODataListBinding#setAggregation} and the note there!
|
|
801
|
+
* @param {string|string[]} [mParameters.$select]
|
|
802
|
+
* A comma separated list or an array of items which determine the value for the
|
|
803
|
+
* "5.1.3 System Query Option $select". Since 1.75.0, when using the "autoExpandSelect" model
|
|
804
|
+
* parameter (see {@link sap.ui.model.odata.v4.ODataModel#constructor}), paths with navigation
|
|
805
|
+
* properties can be included and will contribute to the "5.1.2 System Query Option $expand".
|
|
665
806
|
* @param {object} [mParameters.$$aggregation]
|
|
666
807
|
* An object holding the information needed for data aggregation, see
|
|
667
808
|
* {@link sap.ui.model.odata.v4.ODataListBinding#setAggregation} for details.
|
|
@@ -768,9 +909,10 @@ sap.ui.define([
|
|
|
768
909
|
* @param {sap.ui.model.Context} [oContext]
|
|
769
910
|
* The context which is required as base for a relative path
|
|
770
911
|
* @param {object} [mParameters]
|
|
771
|
-
* Map of binding parameters which can be OData query options as specified in
|
|
772
|
-
* "
|
|
773
|
-
*
|
|
912
|
+
* Map of binding parameters which can be OData query options as specified in <a href=
|
|
913
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html"
|
|
914
|
+
* >"OData Version 4.0 Part 2: URL Conventions"</a> or the binding-specific parameters as
|
|
915
|
+
* specified below. The following OData query options are allowed:
|
|
774
916
|
* <ul>
|
|
775
917
|
* <li> All "5.2 Custom Query Options" except for those with a name starting with "sap-"
|
|
776
918
|
* (unless starting with "sap-valid-")
|
|
@@ -783,6 +925,16 @@ sap.ui.define([
|
|
|
783
925
|
* relative to a context created via {@link #createBindingContext}. The binding parameters are
|
|
784
926
|
* ignored in case the binding creates no own data service request or in case the binding
|
|
785
927
|
* points to metadata.
|
|
928
|
+
* @param {string} [mParameters.$apply]
|
|
929
|
+
* The value for the "3 System Query Option $apply" (see also
|
|
930
|
+
* <a href="https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/">OData
|
|
931
|
+
* Extension for Data Aggregation Version 4.0</a>), if the path ends with a "$count" segment
|
|
932
|
+
* @param {string} [mParameters.$filter]
|
|
933
|
+
* The value for the "5.1.1 System Query Option $filter", if the path ends with a "$count"
|
|
934
|
+
* segment
|
|
935
|
+
* @param {string} [mParameters.$search]
|
|
936
|
+
* The value for the "5.1.7 System Query Option $search", if the path ends with a "$count"
|
|
937
|
+
* segment
|
|
786
938
|
* @param {string} [mParameters.$$groupId]
|
|
787
939
|
* The group ID to be used for <b>read</b> requests triggered by this binding; if not
|
|
788
940
|
* specified, either the parent binding's group ID (if the binding is relative) or the
|
|
@@ -956,8 +1108,10 @@ sap.ui.define([
|
|
|
956
1108
|
* headers: Headers with an <code>undefined</code> value are removed, the other headers are set,
|
|
957
1109
|
* and missing headers remain unchanged. The following headers must not be used:
|
|
958
1110
|
* <ul>
|
|
959
|
-
* <li> OData V4 requests headers as specified in
|
|
960
|
-
* "
|
|
1111
|
+
* <li> OData V4 requests headers as specified in <a href=
|
|
1112
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/os/part1-protocol/odata-v4.0-os-part1-protocol.html#_Common_Headers"
|
|
1113
|
+
* >"8.1 Common Headers"</a> and "8.2 Request Headers" of the specification "OData Version
|
|
1114
|
+
* 4.0 Part 1: Protocol"
|
|
961
1115
|
* <li> OData V2 request headers as specified in "2.2.5 HTTP Header Fields" of the
|
|
962
1116
|
* specification "OData Version 2 v10.1"
|
|
963
1117
|
* <li> The headers "Content-Id" and "Content-Transfer-Encoding"
|
|
@@ -1044,37 +1198,12 @@ sap.ui.define([
|
|
|
1044
1198
|
* @private
|
|
1045
1199
|
*/
|
|
1046
1200
|
ODataModel.prototype.checkBatchGroupId = function (sGroupId) {
|
|
1047
|
-
|
|
1201
|
+
_Helper.checkGroupId(sGroupId);
|
|
1048
1202
|
if (this.isDirectGroup(sGroupId)) {
|
|
1049
1203
|
throw new Error("Group ID does not use batch requests: " + sGroupId);
|
|
1050
1204
|
}
|
|
1051
1205
|
};
|
|
1052
1206
|
|
|
1053
|
-
/**
|
|
1054
|
-
* Checks whether the given group ID is valid, which means it is either undefined, '$auto',
|
|
1055
|
-
* '$auto.*', '$direct' or an application group ID as specified in
|
|
1056
|
-
* {@link sap.ui.model.odata.v4.ODataModel}.
|
|
1057
|
-
*
|
|
1058
|
-
* @param {string} sGroupId
|
|
1059
|
-
* The group ID
|
|
1060
|
-
* @param {boolean} [bApplicationGroup]
|
|
1061
|
-
* Whether only an application group ID is considered valid
|
|
1062
|
-
* @param {string} [sErrorMessage]
|
|
1063
|
-
* The error message to be used if group ID is not valid; the group ID will be appended
|
|
1064
|
-
* @throws {Error}
|
|
1065
|
-
* For invalid group IDs
|
|
1066
|
-
*
|
|
1067
|
-
* @private
|
|
1068
|
-
*/
|
|
1069
|
-
ODataModel.prototype.checkGroupId = function (sGroupId, bApplicationGroup, sErrorMessage) {
|
|
1070
|
-
if (!bApplicationGroup && sGroupId === undefined
|
|
1071
|
-
|| typeof sGroupId === "string"
|
|
1072
|
-
&& (bApplicationGroup ? rApplicationGroupID : rGroupID).test(sGroupId)) {
|
|
1073
|
-
return;
|
|
1074
|
-
}
|
|
1075
|
-
throw new Error((sErrorMessage || "Invalid group ID: ") + sGroupId);
|
|
1076
|
-
};
|
|
1077
|
-
|
|
1078
1207
|
/**
|
|
1079
1208
|
* Creates a binding context for the given path. A relative path can only be resolved if a
|
|
1080
1209
|
* context is provided.
|
|
@@ -1299,7 +1428,7 @@ sap.ui.define([
|
|
|
1299
1428
|
if (sCanonicalPath[0] !== "/") {
|
|
1300
1429
|
throw new Error("Invalid path: " + sCanonicalPath);
|
|
1301
1430
|
}
|
|
1302
|
-
|
|
1431
|
+
_Helper.checkGroupId(sGroupId);
|
|
1303
1432
|
sGroupId = sGroupId || this.getUpdateGroupId();
|
|
1304
1433
|
if (this.isApiGroup(sGroupId)) {
|
|
1305
1434
|
throw new Error("Illegal update group ID: " + sGroupId);
|
|
@@ -1348,6 +1477,34 @@ sap.ui.define([
|
|
|
1348
1477
|
throw new Error("Unsupported operation: v4.ODataModel#destroyBindingContext");
|
|
1349
1478
|
};
|
|
1350
1479
|
|
|
1480
|
+
/**
|
|
1481
|
+
* Detach event handler <code>fnFunction</code> from the 'dataReceived' event of this model.
|
|
1482
|
+
*
|
|
1483
|
+
* @param {function} fnFunction The function to call when the event occurs
|
|
1484
|
+
* @param {object} [oListener] Object on which to call the given function
|
|
1485
|
+
* @returns {this} <code>this</code> to allow method chaining
|
|
1486
|
+
*
|
|
1487
|
+
* @public
|
|
1488
|
+
* @since 1.106.0
|
|
1489
|
+
*/
|
|
1490
|
+
ODataModel.prototype.detachDataReceived = function (fnFunction, oListener) {
|
|
1491
|
+
return this.detachEvent("dataReceived", fnFunction, oListener);
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* Detach event handler <code>fnFunction</code> from the 'dataRequested' event of this model.
|
|
1496
|
+
*
|
|
1497
|
+
* @param {function} fnFunction The function to call when the event occurs
|
|
1498
|
+
* @param {object} [oListener] Object on which to call the given function
|
|
1499
|
+
* @returns {this} <code>this</code> to allow method chaining
|
|
1500
|
+
*
|
|
1501
|
+
* @public
|
|
1502
|
+
* @since 1.106.0
|
|
1503
|
+
*/
|
|
1504
|
+
ODataModel.prototype.detachDataRequested = function (fnFunction, oListener) {
|
|
1505
|
+
return this.detachEvent("dataRequested", fnFunction, oListener);
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1351
1508
|
/**
|
|
1352
1509
|
* Detach event handler <code>fnFunction</code> from the 'sessionTimeout' event of this model.
|
|
1353
1510
|
*
|
|
@@ -1362,6 +1519,31 @@ sap.ui.define([
|
|
|
1362
1519
|
return this.detachEvent("sessionTimeout", fnFunction, oListener);
|
|
1363
1520
|
};
|
|
1364
1521
|
|
|
1522
|
+
/**
|
|
1523
|
+
* Requests the metadata for the given meta path and calculates the key predicate by taking the
|
|
1524
|
+
* key properties from the given entity instance.
|
|
1525
|
+
*
|
|
1526
|
+
* @param {string} sMetaPath
|
|
1527
|
+
* An absolute metadata path to the entity set
|
|
1528
|
+
* @param {object} oEntity
|
|
1529
|
+
* The entity instance with the key property values
|
|
1530
|
+
* @returns {sap.ui.base.SyncPromise<string|undefined>}
|
|
1531
|
+
* A promise that gets resolved with the proper URI encoded key predicate, for example
|
|
1532
|
+
* "(Sector='A%2FB%26C',ID='42')" or "('42')", or <code>undefined</code>, if at least one key
|
|
1533
|
+
* property is undefined. It gets rejected if the metadata cannot be fetched or in case the
|
|
1534
|
+
* entity has no key properties according to metadata.
|
|
1535
|
+
*
|
|
1536
|
+
* @private
|
|
1537
|
+
* @see #requestKeyPredicate
|
|
1538
|
+
*/
|
|
1539
|
+
ODataModel.prototype.fetchKeyPredicate = function (sMetaPath, oEntity) {
|
|
1540
|
+
var mTypeForMetaPath = {};
|
|
1541
|
+
|
|
1542
|
+
return this.oRequestor.fetchType(mTypeForMetaPath, sMetaPath).then(function () {
|
|
1543
|
+
return _Helper.getKeyPredicate(oEntity, sMetaPath, mTypeForMetaPath);
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1365
1547
|
/**
|
|
1366
1548
|
* @override
|
|
1367
1549
|
* @see sap.ui.model.Model#filterMatchingMessages
|
|
@@ -1372,6 +1554,47 @@ sap.ui.define([
|
|
|
1372
1554
|
: [];
|
|
1373
1555
|
};
|
|
1374
1556
|
|
|
1557
|
+
/**
|
|
1558
|
+
* Fires the 'dataReceived' event. This function is only called from the property bindings for
|
|
1559
|
+
* late property requests. Bubbling up from the binding goes directly to fireEvent.
|
|
1560
|
+
*
|
|
1561
|
+
* Fire only one event, even when many late properties are requested (and each request calls
|
|
1562
|
+
* this function). Use the first response error.
|
|
1563
|
+
*
|
|
1564
|
+
* @param {Error} [oError]
|
|
1565
|
+
* The error if the request failed
|
|
1566
|
+
*
|
|
1567
|
+
* @private
|
|
1568
|
+
*/
|
|
1569
|
+
ODataModel.prototype.fireDataReceived = function (oError) {
|
|
1570
|
+
if (this.iDataRequestedCount === 0) {
|
|
1571
|
+
throw new Error("Received more data than requested");
|
|
1572
|
+
}
|
|
1573
|
+
this.iDataRequestedCount -= 1;
|
|
1574
|
+
this.oDataReceivedError = this.oDataReceivedError || oError; // first error wins
|
|
1575
|
+
if (this.iDataRequestedCount === 0) {
|
|
1576
|
+
this.fireEvent("dataReceived",
|
|
1577
|
+
this.oDataReceivedError ? {error : this.oDataReceivedError} : {data : {}});
|
|
1578
|
+
this.oDataReceivedError = undefined;
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Fires the 'dataRequested' event. This function is only called from the property bindings for
|
|
1584
|
+
* late property requests. Bubbling up from the binding goes directly to fireEvent.
|
|
1585
|
+
*
|
|
1586
|
+
* Fire only one event, even when many late properties are requested (and each request calls
|
|
1587
|
+
* this function).
|
|
1588
|
+
*
|
|
1589
|
+
* @private
|
|
1590
|
+
*/
|
|
1591
|
+
ODataModel.prototype.fireDataRequested = function () {
|
|
1592
|
+
this.iDataRequestedCount += 1;
|
|
1593
|
+
if (this.iDataRequestedCount === 1) {
|
|
1594
|
+
this.fireEvent("dataRequested");
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1375
1598
|
/**
|
|
1376
1599
|
* Returns the model's bindings.
|
|
1377
1600
|
*
|
|
@@ -1488,6 +1711,28 @@ sap.ui.define([
|
|
|
1488
1711
|
return mHeadersCopy;
|
|
1489
1712
|
};
|
|
1490
1713
|
|
|
1714
|
+
/**
|
|
1715
|
+
* Takes the metadata for the given meta path and calculates the key predicate by taking the key
|
|
1716
|
+
* properties from the given entity instance.
|
|
1717
|
+
*
|
|
1718
|
+
* @param {string} sMetaPath
|
|
1719
|
+
* An absolute metadata path to an entity set
|
|
1720
|
+
* @param {object} oEntity
|
|
1721
|
+
* The entity instance with the key property values
|
|
1722
|
+
* @returns {string|undefined}
|
|
1723
|
+
* The proper URI-encoded key predicate, for example "(Sector='A%2FB%26C',ID='42')" or
|
|
1724
|
+
* "('42')", or <code>undefined</code> if at least one key property is undefined.
|
|
1725
|
+
* @throws {Error}
|
|
1726
|
+
* If the key predicate cannot be determined synchronously
|
|
1727
|
+
* (due to a pending metadata request), or if the metadata could not be fetched.
|
|
1728
|
+
*
|
|
1729
|
+
* @function
|
|
1730
|
+
* @public
|
|
1731
|
+
* @see #requestKeyPredicate
|
|
1732
|
+
* @since 1.107.0
|
|
1733
|
+
*/
|
|
1734
|
+
ODataModel.prototype.getKeyPredicate = _Helper.createGetMethod("fetchKeyPredicate", true);
|
|
1735
|
+
|
|
1491
1736
|
/**
|
|
1492
1737
|
* Returns messages of this model associated with the given context, that is messages belonging
|
|
1493
1738
|
* to the object referred to by this context or a child object of that object. The messages are
|
|
@@ -1594,7 +1839,7 @@ sap.ui.define([
|
|
|
1594
1839
|
* {@link sap.ui.model.odata.v4.Context#getBinding binding} during its lifetime.
|
|
1595
1840
|
*
|
|
1596
1841
|
* @param {string} sPath
|
|
1597
|
-
* A list context path to an entity
|
|
1842
|
+
* A list context path to an entity, see also {@link #requestKeyPredicate}
|
|
1598
1843
|
* @param {boolean} [bRequestMessages]
|
|
1599
1844
|
* Whether to request messages for the context's entity
|
|
1600
1845
|
* @param {object} [mParameters]
|
|
@@ -1642,7 +1887,7 @@ sap.ui.define([
|
|
|
1642
1887
|
throw new Error("Invalid parameter: " + sParameter);
|
|
1643
1888
|
}
|
|
1644
1889
|
});
|
|
1645
|
-
sListPath = sPath.slice(0,
|
|
1890
|
+
sListPath = sPath.slice(0, _Helper.getPredicateIndex(sPath));
|
|
1646
1891
|
oListBinding = this.mKeepAliveBindingsByPath[sListPath];
|
|
1647
1892
|
if (!oListBinding) {
|
|
1648
1893
|
aListBindings = this.aAllBindings.filter(function (oBinding) {
|
|
@@ -1665,25 +1910,6 @@ sap.ui.define([
|
|
|
1665
1910
|
return oListBinding.getKeepAliveContext(sPath, bRequestMessages, mParameters.$$groupId);
|
|
1666
1911
|
};
|
|
1667
1912
|
|
|
1668
|
-
/**
|
|
1669
|
-
* Returns the index of the key predicate in the last segment of the given path.
|
|
1670
|
-
*
|
|
1671
|
-
* @param {string} sPath - The path
|
|
1672
|
-
* @returns {number} The index of the key predicate
|
|
1673
|
-
* @throws {Error} If the last segment contains no key predicate
|
|
1674
|
-
*
|
|
1675
|
-
* @private
|
|
1676
|
-
*/
|
|
1677
|
-
ODataModel.prototype.getPredicateIndex = function (sPath) {
|
|
1678
|
-
var iPredicateIndex = sPath.indexOf("(", sPath.lastIndexOf("/"));
|
|
1679
|
-
|
|
1680
|
-
if (iPredicateIndex < 0 || !sPath.endsWith(")")) {
|
|
1681
|
-
throw new Error("Not a list context path to an entity: " + sPath);
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
return iPredicateIndex;
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
1913
|
/**
|
|
1688
1914
|
* Returns the model's update group ID.
|
|
1689
1915
|
*
|
|
@@ -1718,6 +1944,20 @@ sap.ui.define([
|
|
|
1718
1944
|
};
|
|
1719
1945
|
};
|
|
1720
1946
|
|
|
1947
|
+
/**
|
|
1948
|
+
* Returns this model's root URL of the service to request data from (as defined by the
|
|
1949
|
+
* "serviceUrl" model parameter, see {@link sap.ui.model.odata.v4.ODataModel#constructor}),
|
|
1950
|
+
* without query options.
|
|
1951
|
+
*
|
|
1952
|
+
* @returns {string} The service URL
|
|
1953
|
+
*
|
|
1954
|
+
* @public
|
|
1955
|
+
* @since 1.107.0
|
|
1956
|
+
*/
|
|
1957
|
+
ODataModel.prototype.getServiceUrl = function () {
|
|
1958
|
+
return this.sServiceUrl;
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1721
1961
|
/**
|
|
1722
1962
|
* Returns <code>true</code> if there are pending changes, meaning updates or created entities
|
|
1723
1963
|
* (see {@link sap.ui.model.odata.v4.ODataListBinding#create}) that have not yet been
|
|
@@ -1879,7 +2119,7 @@ sap.ui.define([
|
|
|
1879
2119
|
if (typeof sGroupId === "boolean") {
|
|
1880
2120
|
throw new Error("Unsupported parameter bForceUpdate");
|
|
1881
2121
|
}
|
|
1882
|
-
|
|
2122
|
+
_Helper.checkGroupId(sGroupId);
|
|
1883
2123
|
|
|
1884
2124
|
// Note: getBindings() returns an array that contains all bindings with change listeners
|
|
1885
2125
|
// (owned by Model)
|
|
@@ -2120,11 +2360,12 @@ sap.ui.define([
|
|
|
2120
2360
|
|
|
2121
2361
|
/**
|
|
2122
2362
|
* Returns a promise for the "canonical path" of the entity for the given context.
|
|
2123
|
-
* According to
|
|
2124
|
-
*
|
|
2125
|
-
*
|
|
2126
|
-
*
|
|
2127
|
-
*
|
|
2363
|
+
* According to <a href=
|
|
2364
|
+
* "https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html#canonical-urlurl4.1.1"
|
|
2365
|
+
* >"4.3.1 Canonical URL"</a> of the specification "OData Version 4.0 Part 2: URL Conventions",
|
|
2366
|
+
* this is the "name of the entity set associated with the entity followed by the key predicate
|
|
2367
|
+
* identifying the entity within the collection". Use the canonical path in
|
|
2368
|
+
* {@link sap.ui.core.Element#bindElement} to create an element binding.
|
|
2128
2369
|
*
|
|
2129
2370
|
* @param {sap.ui.model.odata.v4.Context} oEntityContext
|
|
2130
2371
|
* A context in this model which must point to a non-contained OData entity
|
|
@@ -2143,6 +2384,27 @@ sap.ui.define([
|
|
|
2143
2384
|
return oEntityContext.requestCanonicalPath();
|
|
2144
2385
|
};
|
|
2145
2386
|
|
|
2387
|
+
/**
|
|
2388
|
+
* Requests the metadata for the given meta path and calculates the key predicate by taking the
|
|
2389
|
+
* key properties from the given entity instance.
|
|
2390
|
+
*
|
|
2391
|
+
* @param {string} sMetaPath
|
|
2392
|
+
* An absolute metadata path to the entity set
|
|
2393
|
+
* @param {object} oEntity
|
|
2394
|
+
* The entity instance with the key property values
|
|
2395
|
+
* @returns {Promise<string|undefined>}
|
|
2396
|
+
* A promise that gets resolved with the proper URI-encoded key predicate, for example
|
|
2397
|
+
* "(Sector='A%2FB%26C',ID='42')" or "('42')", or <code>undefined</code> if at least one key
|
|
2398
|
+
* property is undefined. It gets rejected if the metadata cannot be fetched, or in case the
|
|
2399
|
+
* entity has no key properties according to the metadata.
|
|
2400
|
+
*
|
|
2401
|
+
* @function
|
|
2402
|
+
* @public
|
|
2403
|
+
* @see #getKeyPredicates
|
|
2404
|
+
* @since 1.107.0
|
|
2405
|
+
*/
|
|
2406
|
+
ODataModel.prototype.requestKeyPredicate = _Helper.createRequestMethod("fetchKeyPredicate");
|
|
2407
|
+
|
|
2146
2408
|
/**
|
|
2147
2409
|
* Requests side effects for the given paths on all affected root bindings.
|
|
2148
2410
|
*
|
|
@@ -2349,7 +2611,7 @@ sap.ui.define([
|
|
|
2349
2611
|
*
|
|
2350
2612
|
* @param {string} sGroupId
|
|
2351
2613
|
* A valid group ID as specified in {@link sap.ui.model.odata.v4.ODataModel}.
|
|
2352
|
-
* @returns {Promise}
|
|
2614
|
+
* @returns {Promise<undefined>}
|
|
2353
2615
|
* A promise on the outcome of the HTTP request resolving with <code>undefined</code>; it is
|
|
2354
2616
|
* rejected with an error if the batch request itself fails
|
|
2355
2617
|
* @throws {Error}
|
|
@@ -2380,7 +2642,7 @@ sap.ui.define([
|
|
|
2380
2642
|
/**
|
|
2381
2643
|
* Returns a string representation of this object including the service URL.
|
|
2382
2644
|
*
|
|
2383
|
-
* @
|
|
2645
|
+
* @returns {string} A string description of this model
|
|
2384
2646
|
* @public
|
|
2385
2647
|
* @since 1.37.0
|
|
2386
2648
|
*/
|