@openui5/sap.ui.core 1.96.2 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -2
- package/.reuse/dep5 +1 -1
- package/THIRDPARTY.txt +2 -1
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +2 -2
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- 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/ui/Device.js +4 -4
- package/src/sap/ui/Global.js +11 -16
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +3 -3
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -3
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +1 -27
- package/src/sap/ui/core/AppCacheBuster.js +4 -4
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +31 -9
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Control.js +2 -2
- package/src/sap/ui/core/Core.js +2 -2
- 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 +2 -6
- 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/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +3 -3
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +3 -3
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/RenderManager.js +3 -3
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +4 -3
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/ThemeCheck.js +2 -2
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +3 -3
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +19 -5
- package/src/sap/ui/core/cache/LRUPersistentCache.js +4 -2
- package/src/sap/ui/core/date/UniversalDateUtils.js +33 -0
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +5 -5
- package/src/sap/ui/core/message/ControlMessageProcessor.js +5 -5
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +22 -12
- package/src/sap/ui/core/messagebundle_fr.properties +7 -7
- package/src/sap/ui/core/messagebundle_ru.properties +21 -21
- package/src/sap/ui/core/mvc/Controller.js +4 -4
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- 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/rules/Misc.support.js +51 -1
- package/src/sap/ui/core/rules/Rendering.support.js +1 -4
- package/src/sap/ui/core/rules/View.support.js +14 -46
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- 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/Plugin.js +2 -2
- package/src/sap/ui/core/support/RuleEngineOpaExtension.js +0 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/controls/TreeViewer.js +1 -1
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- 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 -2
- 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 +1 -1
- package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +1 -1
- package/src/sap/ui/core/support/trace/E2eTraceLib.js +3 -3
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- 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 +2 -2
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +4 -4
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ChangeReason.js +1 -1
- package/src/sap/ui/model/ClientListBinding.js +7 -0
- package/src/sap/ui/model/ClientModel.js +6 -5
- package/src/sap/ui/model/ClientTreeBindingAdapter.js +1 -1
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/ListBinding.js +24 -5
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +5 -10
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/TreeBindingAdapter.js +0 -2
- package/src/sap/ui/model/TreeBindingUtils.js +2 -0
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +12 -6
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +16 -18
- package/src/sap/ui/model/json/JSONModel.js +7 -7
- package/src/sap/ui/model/json/JSONPropertyBinding.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +3 -3
- package/src/sap/ui/model/message/MessagePropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/AnnotationHelper.js +2 -2
- package/src/sap/ui/model/odata/AnnotationParser.js +4 -2
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataListBinding.js +61 -38
- package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
- package/src/sap/ui/model/odata/ODataMetaModel.js +3 -3
- package/src/sap/ui/model/odata/ODataMetadata.js +136 -85
- package/src/sap/ui/model/odata/ODataModel.js +442 -215
- package/src/sap/ui/model/odata/ODataPropertyBinding.js +7 -5
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +27 -17
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +440 -260
- package/src/sap/ui/model/odata/ODataUtils.js +24 -9
- package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +2 -1
- package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +10 -8
- package/src/sap/ui/model/odata/_ODataMetaModelUtils.js +6 -4
- 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/Decimal.js +5 -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/type/UnitMixin.js +0 -1
- package/src/sap/ui/model/odata/v2/Context.js +42 -11
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +205 -88
- package/src/sap/ui/model/odata/v2/ODataModel.js +154 -89
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +162 -89
- package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +52 -2
- package/src/sap/ui/model/odata/v4/Context.js +48 -7
- package/src/sap/ui/model/odata/v4/ODataBinding.js +55 -24
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +67 -19
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +211 -78
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataModel.js +2 -1
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +36 -23
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +106 -11
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +33 -3
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +11 -2
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +5 -5
- package/src/sap/ui/model/xml/XMLPropertyBinding.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/actions/Action.js +9 -2
- package/src/sap/ui/test/actions/Press.js +28 -1
- package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +111 -0
- package/src/sap/ui/util/Mobile.js +28 -39
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader.js +6 -6
- package/ui5.yaml +244 -1
- package/src/sap/ui/core/CustomizingConfiguration.js +0 -47
- package/src/sap/ui/thirdparty/baseuri.js +0 -1
- package/src/sap/ui/thirdparty/es6-object-assign.js +0 -1
- package/src/sap/ui/thirdparty/es6-promise.js +0 -1
- package/src/sap/ui/thirdparty/es6-shim-nopromise.js +0 -1
- package/src/sap/ui/thirdparty/es6-string-methods.js +0 -1
- package/src/sap/ui/thirdparty/flexie.js +0 -1
- package/src/sap/ui/thirdparty/unorm.js +0 -1
- package/src/sap/ui/thirdparty/unormdata.js +0 -1
|
@@ -92,7 +92,7 @@ sap.ui.define([
|
|
|
92
92
|
* @extends sap.ui.model.TreeBinding
|
|
93
93
|
* @hideconstructor
|
|
94
94
|
* @public
|
|
95
|
-
* @version 1.
|
|
95
|
+
* @version 1.97.0
|
|
96
96
|
*/
|
|
97
97
|
var ODataTreeBinding = TreeBinding.extend("sap.ui.model.odata.v2.ODataTreeBinding", /** @lends sap.ui.model.odata.v2.ODataTreeBinding.prototype */ {
|
|
98
98
|
|
|
@@ -102,8 +102,8 @@ sap.ui.define([
|
|
|
102
102
|
//make sure we have at least an empty parameter object
|
|
103
103
|
this.mParameters = this.mParameters || mParameters || {};
|
|
104
104
|
|
|
105
|
-
this.sGroupId;
|
|
106
|
-
this.sRefreshGroupId;
|
|
105
|
+
this.sGroupId = undefined;
|
|
106
|
+
this.sRefreshGroupId = undefined;
|
|
107
107
|
this.oFinalLengths = {};
|
|
108
108
|
this.oLengths = {};
|
|
109
109
|
this.oKeys = {};
|
|
@@ -158,14 +158,9 @@ sap.ui.define([
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
// internal operation mode switch, default is the same as "OperationMode.Server"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
switch (this.sOperationMode) {
|
|
165
|
-
case OperationMode.Server: this.bClientOperation = false; break;
|
|
166
|
-
case OperationMode.Client: this.bClientOperation = true; break;
|
|
167
|
-
case OperationMode.Auto: this.bClientOperation = false; break; //initially start the same as the server mode
|
|
168
|
-
}
|
|
161
|
+
// the internal operation mode might change, the external operation mode
|
|
162
|
+
// (this.sOperationMode) will always be the original value
|
|
163
|
+
this.bClientOperation = this.sOperationMode === OperationMode.Client;
|
|
169
164
|
|
|
170
165
|
// the threshold for the OperationMode.Auto
|
|
171
166
|
this.iThreshold = (mParameters && mParameters.threshold) || 0;
|
|
@@ -206,19 +201,30 @@ sap.ui.define([
|
|
|
206
201
|
/**
|
|
207
202
|
* Builds a node filter string.
|
|
208
203
|
* mParams.id holds the ID value for filtering on the hierarchy node.
|
|
204
|
+
*
|
|
205
|
+
* @param {object} mParams The filter params
|
|
206
|
+
* @returns {string} The filter to use with <code>$filter</code>
|
|
209
207
|
*/
|
|
210
208
|
ODataTreeBinding.prototype._getNodeFilterParams = function (mParams) {
|
|
211
|
-
var sPropName = mParams.isRoot ? this.oTreeProperties["hierarchy-node-for"]
|
|
209
|
+
var sPropName = mParams.isRoot ? this.oTreeProperties["hierarchy-node-for"]
|
|
210
|
+
: this.oTreeProperties["hierarchy-parent-node-for"];
|
|
212
211
|
var oEntityType = this._getEntityType();
|
|
213
|
-
return ODataUtils._createFilterParams(new Filter(sPropName, "EQ", mParams.id),
|
|
212
|
+
return ODataUtils._createFilterParams(new Filter(sPropName, "EQ", mParams.id),
|
|
213
|
+
this.oModel.oMetadata, oEntityType);
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* Builds the Level-Filter string
|
|
218
|
+
*
|
|
219
|
+
* @param {string} sOperator The filter operator
|
|
220
|
+
* @param {number} iLevel The filter level
|
|
221
|
+
* @returns {string} The filter to use with <code>$filter</code>
|
|
218
222
|
*/
|
|
219
223
|
ODataTreeBinding.prototype._getLevelFilterParams = function (sOperator, iLevel) {
|
|
220
224
|
var oEntityType = this._getEntityType();
|
|
221
|
-
return ODataUtils._createFilterParams(
|
|
225
|
+
return ODataUtils._createFilterParams(
|
|
226
|
+
new Filter(this.oTreeProperties["hierarchy-level-for"], sOperator, iLevel),
|
|
227
|
+
this.oModel.oMetadata, oEntityType);
|
|
222
228
|
};
|
|
223
229
|
|
|
224
230
|
/**
|
|
@@ -411,19 +417,22 @@ sap.ui.define([
|
|
|
411
417
|
* @public
|
|
412
418
|
*/
|
|
413
419
|
ODataTreeBinding.prototype.hasChildren = function(oContext) {
|
|
420
|
+
var iLength;
|
|
421
|
+
|
|
414
422
|
if (this.bHasTreeAnnotations) {
|
|
415
423
|
if (!oContext) {
|
|
416
424
|
return false;
|
|
417
425
|
}
|
|
418
|
-
var sDrilldownState = oContext.getProperty(
|
|
426
|
+
var sDrilldownState = oContext.getProperty(
|
|
427
|
+
this.oTreeProperties["hierarchy-drill-state-for"]);
|
|
419
428
|
|
|
420
429
|
var sNodeKey = this.oModel.getKey(oContext);
|
|
421
|
-
//var sHierarchyNode = oContext.getProperty(this.oTreeProperties["hierarchy-node-for"]);
|
|
422
430
|
|
|
423
|
-
|
|
431
|
+
iLength = this.oLengths[sNodeKey];
|
|
424
432
|
|
|
425
|
-
// if the server returned no children for a node (even though it has a DrilldownState of
|
|
426
|
-
// the length for this node is set to 0 and finalized
|
|
433
|
+
// if the server returned no children for a node (even though it has a DrilldownState of
|
|
434
|
+
// "expanded"), the length for this node is set to 0 and finalized
|
|
435
|
+
// -> no children available
|
|
427
436
|
if (iLength === 0 && this.oFinalLengths[sNodeKey]) {
|
|
428
437
|
return false;
|
|
429
438
|
}
|
|
@@ -435,8 +444,10 @@ sap.ui.define([
|
|
|
435
444
|
} else if (sDrilldownState === "leaf"){
|
|
436
445
|
return false;
|
|
437
446
|
} else {
|
|
438
|
-
Log.warning("The entity '" + oContext.getPath() +
|
|
439
|
-
|
|
447
|
+
Log.warning("The entity '" + oContext.getPath() +
|
|
448
|
+
"' has not specified Drilldown State property value.");
|
|
449
|
+
//fault tolerance for empty property values (we optimistically say that those nodes
|
|
450
|
+
// can be expanded/collapsed)
|
|
440
451
|
if (sDrilldownState === undefined || sDrilldownState === "") {
|
|
441
452
|
return true;
|
|
442
453
|
}
|
|
@@ -446,9 +457,10 @@ sap.ui.define([
|
|
|
446
457
|
if (!oContext) {
|
|
447
458
|
return this.oLengths[this.getPath()] > 0;
|
|
448
459
|
}
|
|
449
|
-
|
|
460
|
+
iLength = this.oLengths[oContext.getPath() + "/" + this._getNavPath(oContext.getPath())];
|
|
450
461
|
|
|
451
|
-
//only return false if we definitely know that the length is 0, otherwise, we have
|
|
462
|
+
//only return false if we definitely know that the length is 0, otherwise, we have
|
|
463
|
+
// either a known length or none at all (undefined)
|
|
452
464
|
return iLength !== 0;
|
|
453
465
|
}
|
|
454
466
|
};
|
|
@@ -558,6 +570,7 @@ sap.ui.define([
|
|
|
558
570
|
}
|
|
559
571
|
}
|
|
560
572
|
|
|
573
|
+
return false;
|
|
561
574
|
// check requested sections where we still wait for an answer
|
|
562
575
|
};
|
|
563
576
|
|
|
@@ -603,7 +616,7 @@ sap.ui.define([
|
|
|
603
616
|
i = Math.max((aMissingSections[0].startIndex - iThreshold - this._iPageSize), 0);
|
|
604
617
|
var iFirstStartIndex = aMissingSections[0].startIndex;
|
|
605
618
|
for (i; i < iFirstStartIndex; i++) {
|
|
606
|
-
|
|
619
|
+
sKey = this.oKeys[sNodeId][i];
|
|
607
620
|
if (!sKey) {
|
|
608
621
|
if (!fnFindInLoadedSections(i)) {
|
|
609
622
|
aMissingSections = TreeBindingUtils.mergeSections(aMissingSections, {startIndex: i, length: 1});
|
|
@@ -620,7 +633,7 @@ sap.ui.define([
|
|
|
620
633
|
}
|
|
621
634
|
|
|
622
635
|
for (i; i < iEndIndex; i++) {
|
|
623
|
-
|
|
636
|
+
sKey = this.oKeys[sNodeId][i];
|
|
624
637
|
if (!sKey) {
|
|
625
638
|
if (!fnFindInLoadedSections(i)) {
|
|
626
639
|
aMissingSections = TreeBindingUtils.mergeSections(aMissingSections, {startIndex: i, length: 1});
|
|
@@ -628,14 +641,13 @@ sap.ui.define([
|
|
|
628
641
|
}
|
|
629
642
|
}
|
|
630
643
|
}
|
|
631
|
-
} else {
|
|
632
644
|
// for initial loading of a node use this shortcut.
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
645
|
+
} else if (!fnFindInLoadedSections(iStartIndex)) {
|
|
646
|
+
// "i" is our shifted forward startIndex for the "negative" thresholding
|
|
647
|
+
// in this case i is always smaller than iStartIndex, but minimum is 0
|
|
648
|
+
var iLengthShift = iStartIndex - i;
|
|
649
|
+
aMissingSections = TreeBindingUtils.mergeSections(aMissingSections,
|
|
650
|
+
{startIndex: i, length: iLength + iLengthShift + iThreshold});
|
|
639
651
|
}
|
|
640
652
|
|
|
641
653
|
// check if metadata are already available
|
|
@@ -701,17 +713,23 @@ sap.ui.define([
|
|
|
701
713
|
// request the missing sections and manage the loaded sections map
|
|
702
714
|
for (i = 0; i < aMissingSections.length; i++) {
|
|
703
715
|
var oRequestedSection = aMissingSections[i];
|
|
704
|
-
this._mLoadedSections[sNodeId] = TreeBindingUtils.mergeSections(
|
|
705
|
-
|
|
716
|
+
this._mLoadedSections[sNodeId] = TreeBindingUtils.mergeSections(
|
|
717
|
+
this._mLoadedSections[sNodeId],
|
|
718
|
+
{
|
|
719
|
+
startIndex: oRequestedSection.startIndex,
|
|
720
|
+
length: oRequestedSection.length
|
|
721
|
+
});
|
|
722
|
+
this._loadSubNodes(sNodeId, oRequestedSection.startIndex,
|
|
723
|
+
oRequestedSection.length, 0, aParams, mRequestParameters,
|
|
724
|
+
oRequestedSection);
|
|
706
725
|
}
|
|
707
|
-
} else
|
|
708
|
-
|
|
726
|
+
} else if (!this.oAllKeys
|
|
727
|
+
&& !this.mRequestHandles[ODataTreeBinding.REQUEST_KEY_CLIENT]) {
|
|
728
|
+
// OperationMode is set to "Client" AND we have something missing (should only
|
|
729
|
+
// happen once, at the very first loading request)
|
|
709
730
|
// of course also make sure no request is running already
|
|
710
|
-
|
|
711
|
-
this._loadCompleteTreeWithAnnotations(aParams);
|
|
712
|
-
}
|
|
731
|
+
this._loadCompleteTreeWithAnnotations(aParams);
|
|
713
732
|
}
|
|
714
|
-
|
|
715
733
|
}
|
|
716
734
|
}
|
|
717
735
|
|
|
@@ -775,7 +793,7 @@ sap.ui.define([
|
|
|
775
793
|
// if necessary we add all other filters to the count request
|
|
776
794
|
var sFilterParams = "";
|
|
777
795
|
if (this.bUseServersideApplicationFilters) {
|
|
778
|
-
|
|
796
|
+
sFilterParams = this.getFilterParams();
|
|
779
797
|
}
|
|
780
798
|
|
|
781
799
|
//only build filter statement if necessary
|
|
@@ -809,10 +827,13 @@ sap.ui.define([
|
|
|
809
827
|
|
|
810
828
|
/**
|
|
811
829
|
* Issues a $count request for the given node-id/odata-key.
|
|
812
|
-
* Only used when running in CountMode.Request
|
|
830
|
+
* Only used when running in <code>CountMode.Request</code>. Inlinecounts are appended directly
|
|
831
|
+
* when issuing a loading request.
|
|
832
|
+
*
|
|
833
|
+
* @param {string} sNodeId The node's ID
|
|
813
834
|
* @private
|
|
814
835
|
*/
|
|
815
|
-
ODataTreeBinding.prototype._getCountForNodeId = function(sNodeId
|
|
836
|
+
ODataTreeBinding.prototype._getCountForNodeId = function(sNodeId) {
|
|
816
837
|
var that = this,
|
|
817
838
|
sGroupId;
|
|
818
839
|
|
|
@@ -908,8 +929,12 @@ sap.ui.define([
|
|
|
908
929
|
/**
|
|
909
930
|
* Creates key map for given data
|
|
910
931
|
*
|
|
911
|
-
* @param {Array} aData
|
|
912
|
-
*
|
|
932
|
+
* @param {Array} aData
|
|
933
|
+
* Data which should be preprocessed
|
|
934
|
+
* @param {boolean} bSkipFirstNode
|
|
935
|
+
* Whether to skip the first node
|
|
936
|
+
* @returns {Object<string,string[]>|undefined}
|
|
937
|
+
* Map of parent and child keys or <code>undefined</code> when <code>aData</code> is empty
|
|
913
938
|
*
|
|
914
939
|
* @private
|
|
915
940
|
*/
|
|
@@ -935,6 +960,8 @@ sap.ui.define([
|
|
|
935
960
|
|
|
936
961
|
return mKeys;
|
|
937
962
|
}
|
|
963
|
+
|
|
964
|
+
return undefined;
|
|
938
965
|
};
|
|
939
966
|
|
|
940
967
|
/**
|
|
@@ -961,8 +988,8 @@ sap.ui.define([
|
|
|
961
988
|
/**
|
|
962
989
|
* Update node key in case if it changes
|
|
963
990
|
*
|
|
964
|
-
* @param {object} oNode
|
|
965
|
-
* @param {string} sNewKey
|
|
991
|
+
* @param {object} oNode The node
|
|
992
|
+
* @param {string} sNewKey The new key
|
|
966
993
|
*
|
|
967
994
|
* @private
|
|
968
995
|
*/
|
|
@@ -1066,17 +1093,27 @@ sap.ui.define([
|
|
|
1066
1093
|
/**
|
|
1067
1094
|
* Triggers backend requests to load the child nodes of the node with the given sNodeId.
|
|
1068
1095
|
*
|
|
1069
|
-
* @param {string} sNodeId
|
|
1070
|
-
*
|
|
1071
|
-
* @param {int}
|
|
1072
|
-
*
|
|
1073
|
-
* @param {
|
|
1074
|
-
*
|
|
1075
|
-
* @param {
|
|
1096
|
+
* @param {string} sNodeId
|
|
1097
|
+
* The value of the hierarchy node property on which a parent node filter will be performed
|
|
1098
|
+
* @param {int} iStartIndex
|
|
1099
|
+
* Start index of the page
|
|
1100
|
+
* @param {int} iLength
|
|
1101
|
+
* Length of the page
|
|
1102
|
+
* @param {int} iThreshold
|
|
1103
|
+
* Additionally loaded entities
|
|
1104
|
+
* @param {array} aParams
|
|
1105
|
+
* OData URL parameters, already concatenated with "="
|
|
1106
|
+
* @param {object} mParameters
|
|
1107
|
+
* Additional request parameters
|
|
1108
|
+
* @param {object} mParameters.navPath
|
|
1109
|
+
* The navigation path
|
|
1110
|
+
* @param {object} oRequestedSection
|
|
1111
|
+
* The requested section
|
|
1076
1112
|
*
|
|
1077
1113
|
* @private
|
|
1078
1114
|
*/
|
|
1079
|
-
ODataTreeBinding.prototype._loadSubNodes = function(sNodeId, iStartIndex, iLength, iThreshold,
|
|
1115
|
+
ODataTreeBinding.prototype._loadSubNodes = function(sNodeId, iStartIndex, iLength, iThreshold,
|
|
1116
|
+
aParams, mParameters, oRequestedSection) {
|
|
1080
1117
|
var that = this,
|
|
1081
1118
|
sGroupId,
|
|
1082
1119
|
bInlineCountRequested = false;
|
|
@@ -1102,6 +1139,7 @@ sap.ui.define([
|
|
|
1102
1139
|
var sRequestKey = "" + sNodeId + "-" + iStartIndex + "-" + this._iPageSize + "-" + iThreshold;
|
|
1103
1140
|
|
|
1104
1141
|
function fnSuccess(oData) {
|
|
1142
|
+
var oEntry, i;
|
|
1105
1143
|
|
|
1106
1144
|
if (oData) {
|
|
1107
1145
|
// make sure we have a keys array
|
|
@@ -1123,8 +1161,8 @@ sap.ui.define([
|
|
|
1123
1161
|
if (that.bHasTreeAnnotations) {
|
|
1124
1162
|
var mLastNodeIdIndices = {};
|
|
1125
1163
|
|
|
1126
|
-
for (
|
|
1127
|
-
|
|
1164
|
+
for (i = 0; i < oData.results.length; i++) {
|
|
1165
|
+
oEntry = oData.results[i];
|
|
1128
1166
|
|
|
1129
1167
|
if (i == 0) {
|
|
1130
1168
|
mLastNodeIdIndices[sNodeId] = iStartIndex;
|
|
@@ -1137,8 +1175,8 @@ sap.ui.define([
|
|
|
1137
1175
|
}
|
|
1138
1176
|
} else {
|
|
1139
1177
|
// Case 1b: Navigation Properties
|
|
1140
|
-
for (
|
|
1141
|
-
|
|
1178
|
+
for (i = 0; i < oData.results.length; i++) {
|
|
1179
|
+
oEntry = oData.results[i];
|
|
1142
1180
|
var sKey = that.oModel._getKey(oEntry);
|
|
1143
1181
|
that._processODataObject(oEntry, "/" + sKey, mParameters.navPath);
|
|
1144
1182
|
that.oKeys[sNodeId][i + iStartIndex] = sKey;
|
|
@@ -1225,9 +1263,11 @@ sap.ui.define([
|
|
|
1225
1263
|
ODataTreeBinding.REQUEST_KEY_CLIENT = "_OPERATIONMODE_CLIENT_TREE_LOADING";
|
|
1226
1264
|
|
|
1227
1265
|
/**
|
|
1228
|
-
* Loads the complete collection from the given binding path.
|
|
1229
|
-
*
|
|
1266
|
+
* Loads the complete collection from the given binding path. The tree is then reconstructed
|
|
1267
|
+
* from the response entries based on the properties with hierarchy annotations.
|
|
1230
1268
|
* Adds additional URL parameters.
|
|
1269
|
+
*
|
|
1270
|
+
* @param {string[]} aURLParams Additional URL parameters
|
|
1231
1271
|
*/
|
|
1232
1272
|
ODataTreeBinding.prototype._loadCompleteTreeWithAnnotations = function (aURLParams) {
|
|
1233
1273
|
var that = this;
|
|
@@ -1375,16 +1415,11 @@ sap.ui.define([
|
|
|
1375
1415
|
} else {
|
|
1376
1416
|
this.oKeys = {};
|
|
1377
1417
|
|
|
1378
|
-
// the internal operation mode might change, the external operation mode
|
|
1418
|
+
// the internal operation mode might change, the external operation mode
|
|
1419
|
+
// (this.sOperationMode) will always be the original value
|
|
1379
1420
|
// internal operation mode switch, default is the same as "OperationMode.Server"
|
|
1380
|
-
this.bClientOperation =
|
|
1421
|
+
this.bClientOperation = this.sOperationMode === OperationMode.Client;
|
|
1381
1422
|
|
|
1382
|
-
// the internal operation mode might change, the external operation mode (this.sOperationMode) will always be the original value
|
|
1383
|
-
switch (this.sOperationMode) {
|
|
1384
|
-
case OperationMode.Server: this.bClientOperation = false; break;
|
|
1385
|
-
case OperationMode.Client: this.bClientOperation = true; break;
|
|
1386
|
-
case OperationMode.Auto: this.bClientOperation = false; break; //initially start the same as the server mode
|
|
1387
|
-
}
|
|
1388
1423
|
// if no data is available after the reset we can't be sure the threshold is met or rejected
|
|
1389
1424
|
this.bThresholdRejected = false;
|
|
1390
1425
|
|
|
@@ -1439,8 +1474,8 @@ sap.ui.define([
|
|
|
1439
1474
|
* validation, use the parameter <code>bForceUpdate</code>.
|
|
1440
1475
|
*
|
|
1441
1476
|
* @param {boolean} [bForceUpdate] Update the bound control even if no data has been changed
|
|
1442
|
-
* @param {object} [mChangedEntities]
|
|
1443
|
-
* @param {string} [mEntityTypes]
|
|
1477
|
+
* @param {object} [mChangedEntities] A map of changed entities
|
|
1478
|
+
* @param {string} [mEntityTypes] A map of entity types
|
|
1444
1479
|
*
|
|
1445
1480
|
* @private
|
|
1446
1481
|
*/
|
|
@@ -1527,7 +1562,12 @@ sap.ui.define([
|
|
|
1527
1562
|
* @param {sap.ui.model.FilterType} sFilterType
|
|
1528
1563
|
* Type of the filter which should be adjusted. If it is not given,
|
|
1529
1564
|
* the type <code>FilterType.Control</code> is assumed
|
|
1530
|
-
* @
|
|
1565
|
+
* @param {boolean} [bReturnSuccess]
|
|
1566
|
+
* Whether to return <code>true</code> or <code>false</code>, instead of <code>this</code>,
|
|
1567
|
+
* depending on whether the filtering has been done
|
|
1568
|
+
* @return {this}
|
|
1569
|
+
* Returns <code>this</code> to facilitate method chaining
|
|
1570
|
+
*
|
|
1531
1571
|
* @see sap.ui.model.TreeBinding.prototype.filter
|
|
1532
1572
|
* @public
|
|
1533
1573
|
*/
|
|
@@ -1542,7 +1582,8 @@ sap.ui.define([
|
|
|
1542
1582
|
if (sFilterType == FilterType.Control && (!this.bClientOperation || this.sOperationMode == OperationMode.Server)) {
|
|
1543
1583
|
Log.warning("Filtering with ControlFilters is ONLY possible if the ODataTreeBinding is running in OperationMode.Client or " +
|
|
1544
1584
|
"OperationMode.Auto, in case the given threshold is lower than the total number of tree nodes.");
|
|
1545
|
-
|
|
1585
|
+
|
|
1586
|
+
return this;
|
|
1546
1587
|
}
|
|
1547
1588
|
|
|
1548
1589
|
// empty filters
|
|
@@ -1678,11 +1719,17 @@ sap.ui.define([
|
|
|
1678
1719
|
};
|
|
1679
1720
|
|
|
1680
1721
|
/**
|
|
1681
|
-
* Sorts the Tree according to the given Sorter(s).
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1684
|
-
*
|
|
1722
|
+
* Sorts the Tree according to the given Sorter(s). In <code>OperationMode.Client</code> or
|
|
1723
|
+
* <code>OperationMode.Auto</code> (if the given threshold is satisfied), the sorters are
|
|
1724
|
+
* applied locally on the client.
|
|
1725
|
+
*
|
|
1726
|
+
* @param {sap.ui.model.Sorter[]|sap.ui.model.Sorter} aSorters
|
|
1727
|
+
* The Sorter or an Array of sap.ui.model.Sorter instances
|
|
1728
|
+
* @param {boolean} [bReturnSuccess]
|
|
1729
|
+
* Whether to return <code>true</code> or <code>false</code>, instead of <code>this</code>,
|
|
1730
|
+
* depending on whether the sorting has been done
|
|
1685
1731
|
* @return {this} returns <code>this</code> to facilitate method chaining
|
|
1732
|
+
*
|
|
1686
1733
|
* @public
|
|
1687
1734
|
*/
|
|
1688
1735
|
ODataTreeBinding.prototype.sort = function(aSorters, bReturnSuccess) {
|
|
@@ -1726,6 +1773,10 @@ sap.ui.define([
|
|
|
1726
1773
|
/**
|
|
1727
1774
|
* Sets the comparator for each sorter in the sorters array according to the
|
|
1728
1775
|
* Edm type of the sort property
|
|
1776
|
+
*
|
|
1777
|
+
* @param {sap.ui.model.Sorter[]} aSorters The sorters
|
|
1778
|
+
* @param {object} oEntityType The entity type of the collection
|
|
1779
|
+
*
|
|
1729
1780
|
* @private
|
|
1730
1781
|
*/
|
|
1731
1782
|
ODataTreeBinding.prototype.addSortComparators = function(aSorters, oEntityType) {
|
|
@@ -1767,10 +1818,13 @@ sap.ui.define([
|
|
|
1767
1818
|
};
|
|
1768
1819
|
|
|
1769
1820
|
/**
|
|
1770
|
-
* Check whether this Binding would provide new values and in case it changed,
|
|
1771
|
-
*
|
|
1821
|
+
* Check whether this Binding would provide new values and in case it changed,fire a change
|
|
1822
|
+
* event.
|
|
1772
1823
|
*
|
|
1773
1824
|
* @param {boolean} bForceUpdate
|
|
1825
|
+
* Whether to fire the event regardless of the bindings state
|
|
1826
|
+
* @param {object} mChangedEntities
|
|
1827
|
+
* A map of changed entities
|
|
1774
1828
|
*
|
|
1775
1829
|
* @private
|
|
1776
1830
|
*/
|
|
@@ -1788,10 +1842,14 @@ sap.ui.define([
|
|
|
1788
1842
|
bChangeDetected = true;
|
|
1789
1843
|
return false;
|
|
1790
1844
|
}
|
|
1845
|
+
|
|
1846
|
+
return true;
|
|
1791
1847
|
});
|
|
1792
1848
|
if (bChangeDetected) {
|
|
1793
1849
|
return false;
|
|
1794
1850
|
}
|
|
1851
|
+
|
|
1852
|
+
return true;
|
|
1795
1853
|
});
|
|
1796
1854
|
}
|
|
1797
1855
|
}
|
|
@@ -1807,7 +1865,9 @@ sap.ui.define([
|
|
|
1807
1865
|
* Splits the given path along the navigation properties.
|
|
1808
1866
|
* Only used when bound against a service, which describes the tree via navigation properties.
|
|
1809
1867
|
*
|
|
1810
|
-
* @param {string} sPath
|
|
1868
|
+
* @param {string} sPath The path
|
|
1869
|
+
* @returns {string} The split path
|
|
1870
|
+
*
|
|
1811
1871
|
* @private
|
|
1812
1872
|
*/
|
|
1813
1873
|
ODataTreeBinding.prototype._getNavPath = function(sPath) {
|
|
@@ -1815,7 +1875,7 @@ sap.ui.define([
|
|
|
1815
1875
|
var sAbsolutePath = this.oModel.resolve(sPath, this.getContext());
|
|
1816
1876
|
|
|
1817
1877
|
if (!sAbsolutePath) {
|
|
1818
|
-
return;
|
|
1878
|
+
return undefined;
|
|
1819
1879
|
}
|
|
1820
1880
|
|
|
1821
1881
|
var aPathParts = sAbsolutePath.split("/"),
|
|
@@ -1828,6 +1888,7 @@ sap.ui.define([
|
|
|
1828
1888
|
//Replace context with subitems context
|
|
1829
1889
|
sNavPath = this.oNavigationPaths[sCurrent];
|
|
1830
1890
|
}
|
|
1891
|
+
|
|
1831
1892
|
return sNavPath;
|
|
1832
1893
|
};
|
|
1833
1894
|
|
|
@@ -1879,6 +1940,8 @@ sap.ui.define([
|
|
|
1879
1940
|
*
|
|
1880
1941
|
* The extracted hierarchy information will be stored in "this.oTreeProperties" (if any)
|
|
1881
1942
|
*
|
|
1943
|
+
* @returns {boolean} Whether the metadata has tree annotations
|
|
1944
|
+
*
|
|
1882
1945
|
* @private
|
|
1883
1946
|
*/
|
|
1884
1947
|
ODataTreeBinding.prototype._hasTreeAnnotations = function() {
|
|
@@ -1955,6 +2018,8 @@ sap.ui.define([
|
|
|
1955
2018
|
that.oTreeProperties[sName] = oProperty.name;
|
|
1956
2019
|
}
|
|
1957
2020
|
});
|
|
2021
|
+
|
|
2022
|
+
return true;
|
|
1958
2023
|
});
|
|
1959
2024
|
|
|
1960
2025
|
return fnSanityCheckTreeAnnotations();
|
|
@@ -2038,10 +2103,12 @@ sap.ui.define([
|
|
|
2038
2103
|
/**
|
|
2039
2104
|
* Initially only apply the Adapter interface.
|
|
2040
2105
|
* The real adapter will be applied after the initialize.
|
|
2106
|
+
*
|
|
2107
|
+
* @returns {this} A reference to itself
|
|
2041
2108
|
* @private
|
|
2042
2109
|
*/
|
|
2043
2110
|
ODataTreeBinding.prototype.applyAdapterInterface = function () {
|
|
2044
|
-
|
|
2111
|
+
/*
|
|
2045
2112
|
* Data Interface.
|
|
2046
2113
|
* Documentation, see the corresponding Adapter classes.
|
|
2047
2114
|
*/
|
|
@@ -2060,7 +2127,7 @@ sap.ui.define([
|
|
|
2060
2127
|
this.getContextByIndex = this.getContextByIndex || function () {
|
|
2061
2128
|
return;
|
|
2062
2129
|
};
|
|
2063
|
-
|
|
2130
|
+
/*
|
|
2064
2131
|
* Event Interface.
|
|
2065
2132
|
* Documentation, see the corresponding Adapter classes.
|
|
2066
2133
|
*/
|
|
@@ -2121,6 +2188,8 @@ sap.ui.define([
|
|
|
2121
2188
|
that.oTreeProperties[sName] = oProperty.name;
|
|
2122
2189
|
}
|
|
2123
2190
|
});
|
|
2191
|
+
|
|
2192
|
+
return true;
|
|
2124
2193
|
});
|
|
2125
2194
|
//perform magnitude annotation check
|
|
2126
2195
|
this.oTreeProperties[sMagnitudeAnnotation] = this.oTreeProperties[sMagnitudeAnnotation]
|
|
@@ -2285,9 +2354,7 @@ sap.ui.define([
|
|
|
2285
2354
|
|
|
2286
2355
|
sPath = this.getResolvedPath();
|
|
2287
2356
|
|
|
2288
|
-
|
|
2289
|
-
return this.oModel._createRequestUrl(sPath, null, aParams);
|
|
2290
|
-
}
|
|
2357
|
+
return sPath && this.oModel._createRequestUrl(sPath, null, aParams);
|
|
2291
2358
|
};
|
|
2292
2359
|
|
|
2293
2360
|
/**
|
|
@@ -2330,7 +2397,8 @@ sap.ui.define([
|
|
|
2330
2397
|
* annotation specification,
|
|
2331
2398
|
* or when providing the annotation information locally as a binding parameter.
|
|
2332
2399
|
* For more information, see {@link sap.ui.model.odata.v2.ODataModel#bindTree}.
|
|
2333
|
-
*
|
|
2400
|
+
*
|
|
2401
|
+
* @param {int} iRootLevel The new <code>rootLevel</code>
|
|
2334
2402
|
*
|
|
2335
2403
|
* @public
|
|
2336
2404
|
*/
|
|
@@ -2347,7 +2415,8 @@ sap.ui.define([
|
|
|
2347
2415
|
|
|
2348
2416
|
/**
|
|
2349
2417
|
* Returns the rootLevel
|
|
2350
|
-
*
|
|
2418
|
+
*
|
|
2419
|
+
* @returns {int} The root level
|
|
2351
2420
|
*
|
|
2352
2421
|
* @public
|
|
2353
2422
|
*/
|
|
@@ -2357,9 +2426,13 @@ sap.ui.define([
|
|
|
2357
2426
|
|
|
2358
2427
|
/**
|
|
2359
2428
|
* Retrieves the EntityType of the bindings path, resolved with the current context.
|
|
2429
|
+
*
|
|
2430
|
+
* @returns {object|undefined}
|
|
2431
|
+
* The entity type or <code>undefined</code>, if the bindings path can't be resolved
|
|
2432
|
+
*
|
|
2360
2433
|
* @private
|
|
2361
2434
|
*/
|
|
2362
|
-
ODataTreeBinding.prototype._getEntityType = function(){
|
|
2435
|
+
ODataTreeBinding.prototype._getEntityType = function() {
|
|
2363
2436
|
var sResolvedPath = this.getResolvedPath();
|
|
2364
2437
|
|
|
2365
2438
|
if (sResolvedPath) {
|
|
@@ -60,7 +60,27 @@ sap.ui.define([
|
|
|
60
60
|
* @private
|
|
61
61
|
*/
|
|
62
62
|
_CreatedContextsCache.prototype.findAndRemoveContext = function (oCreatedContext) {
|
|
63
|
-
var
|
|
63
|
+
var oResult = this.getCacheInfo(oCreatedContext);
|
|
64
|
+
|
|
65
|
+
if (oResult) {
|
|
66
|
+
this.removeContext(oCreatedContext, oResult.cachePath, oResult.listID);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Checks whether a given context is contained in the the list of contexts for created entities
|
|
72
|
+
* and returns the path and list ID.
|
|
73
|
+
*
|
|
74
|
+
* @param {sap.ui.model.odata.v2.Context} oCreatedContext
|
|
75
|
+
* The context to be searched in the cache
|
|
76
|
+
* @returns {{cachePath : string, listID : string}|undefined}
|
|
77
|
+
* An object containing the cache path and the list ID if the given context is contained in
|
|
78
|
+
* the cache, <code>undefined</code> otherwise
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
_CreatedContextsCache.prototype.getCacheInfo = function (oCreatedContext) {
|
|
83
|
+
var oResult, that = this;
|
|
64
84
|
|
|
65
85
|
Object.keys(this.mCache).some(function (sCachePath) {
|
|
66
86
|
var mListIDToContexts = that.mCache[sCachePath];
|
|
@@ -69,7 +89,7 @@ sap.ui.define([
|
|
|
69
89
|
var aContexts = that.mCache[sCachePath][sListID];
|
|
70
90
|
|
|
71
91
|
if (aContexts.includes(oCreatedContext)) {
|
|
72
|
-
|
|
92
|
+
oResult = {cachePath : sCachePath, listID : sListID};
|
|
73
93
|
|
|
74
94
|
return true;
|
|
75
95
|
}
|
|
@@ -77,6 +97,8 @@ sap.ui.define([
|
|
|
77
97
|
return false;
|
|
78
98
|
});
|
|
79
99
|
});
|
|
100
|
+
|
|
101
|
+
return oResult;
|
|
80
102
|
};
|
|
81
103
|
|
|
82
104
|
/**
|
|
@@ -125,5 +147,33 @@ sap.ui.define([
|
|
|
125
147
|
}
|
|
126
148
|
};
|
|
127
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Removes all persisted contexts from the list of contexts for created entities for the given
|
|
152
|
+
* path and list ID.
|
|
153
|
+
*
|
|
154
|
+
* @param {sPath} sPath
|
|
155
|
+
* The resolved binding path
|
|
156
|
+
* @param {string} sListID
|
|
157
|
+
* The identifier for the list showing the data
|
|
158
|
+
* @returns {sap.ui.model.odata.v2.Context[]}
|
|
159
|
+
* An array of persisted contexts that have been removed from the cache
|
|
160
|
+
*
|
|
161
|
+
* @private
|
|
162
|
+
*/
|
|
163
|
+
_CreatedContextsCache.prototype.removePersistedContexts = function (sPath, sListID) {
|
|
164
|
+
var aCreatedPersistedContexts = this.getContexts(sPath, sListID)
|
|
165
|
+
.filter(function (oContext) {
|
|
166
|
+
return oContext.isTransient() === false;
|
|
167
|
+
}),
|
|
168
|
+
that = this;
|
|
169
|
+
|
|
170
|
+
aCreatedPersistedContexts.forEach(function (oContext) {
|
|
171
|
+
oContext.resetCreatedPromise();
|
|
172
|
+
that.removeContext(oContext, sPath, sListID);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
return aCreatedPersistedContexts;
|
|
176
|
+
};
|
|
177
|
+
|
|
128
178
|
return _CreatedContextsCache;
|
|
129
179
|
}, /* bExport= */ false);
|