src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js
function _getODataPropertiesOfModel(oElement, sAggregationName) {
		var oModel = oElement.getModel();
		var mData = {
			property: [],
			navigationProperty: [],
			navigationEntityNames: []
		};

		if (oModel) {
			var sModelName = oModel.getMetadata().getName();
			if (sModelName === "sap.ui.model.odata.ODataModel" || sModelName === "sap.ui.model.odata.v2.ODataModel") {
				var oMetaModel = oModel.getMetaModel();
				return oMetaModel.loaded().then(function(){
					var sBindingContextPath = _getBindingPath(oElement, sAggregationName);
					if (sBindingContextPath) {
						var oMetaModelContext = oMetaModel.getMetaContext(sBindingContextPath);
						var mODataEntity = oMetaModelContext.getObject();

						var oDefaultAggregation = oElement.getMetadata().getAggregation();
						if (oDefaultAggregation) {
							var oBinding = oElement.getBindingInfo(oDefaultAggregation.name);
							var oTemplate = oBinding && oBinding.template;

							if (oTemplate) {
								var sPath = oElement.getBindingPath(oDefaultAggregation.name);
								var oODataAssociationEnd = oMetaModel.getODataAssociationEnd(mODataEntity, sPath);
								var sFullyQualifiedEntityName = oODataAssociationEnd && oODataAssociationEnd.type;
								if (sFullyQualifiedEntityName) {
									var oEntityType = oMetaModel.getODataEntityType(sFullyQualifiedEntityName);
									mODataEntity = oEntityType;
								}
							}
						}

						mData.property = mODataEntity.property || [];
						mData.property = _expandComplexProperties(mData.property, oMetaModel, mODataEntity);
						mData.property = _filterInvisibleProperties(mData.property, oElement, sAggregationName);

						if (mODataEntity.navigationProperty){
							mData.navigationProperty = mODataEntity.navigationProperty;
							mODataEntity.navigationProperty.forEach(function(oNavProp){
								var sFullyQualifiedEntityName = (
									oMetaModel.getODataAssociationEnd(mODataEntity, oNavProp.name)
									&& oMetaModel.getODataAssociationEnd(mODataEntity, oNavProp.name).type
								);
								var oEntityType = oMetaModel.getODataEntityType(sFullyQualifiedEntityName);
								if (oEntityType && oEntityType.name){
									if (mData.navigationEntityNames.indexOf(oEntityType.name) === -1){
										mData.navigationEntityNames.push(oEntityType.name);
									}
								}
							});
						}
					}
					return mData;
				});
			}
		}

		return Promise.resolve(mData);
	}
function _getODataPropertiesOfModel(oElement, sAggregationName) {
		var oModel = oElement.getModel();
		var mData = {
			property: [],
			navigationProperty: [],
			navigationEntityNames: []
		};

		if (oModel) {
			var sModelName = oModel.getMetadata().getName();
			if (sModelName === "sap.ui.model.odata.ODataModel" || sModelName === "sap.ui.model.odata.v2.ODataModel") {
				var oMetaModel = oModel.getMetaModel();
				return oMetaModel.loaded().then(function(){
					var sBindingContextPath = _getBindingPath(oElement, sAggregationName);
					if (sBindingContextPath) {
						var oMetaModelContext = oMetaModel.getMetaContext(sBindingContextPath);
						var mODataEntity = oMetaModelContext.getObject();

						var oDefaultAggregation = oElement.getMetadata().getAggregation();
						if (oDefaultAggregation) {
							var oBinding = oElement.getBindingInfo(oDefaultAggregation.name);
							var oTemplate = oBinding && oBinding.template;

							if (oTemplate) {
								var sPath = oElement.getBindingPath(oDefaultAggregation.name);
								var oODataAssociationEnd = oMetaModel.getODataAssociationEnd(mODataEntity, sPath);
								var sFullyQualifiedEntityName = oODataAssociationEnd && oODataAssociationEnd.type;
								if (sFullyQualifiedEntityName) {
									var oEntityType = oMetaModel.getODataEntityType(sFullyQualifiedEntityName);
									mODataEntity = oEntityType;
								}
							}
						}

						mData.property = mODataEntity.property || [];
						mData.property = _expandComplexProperties(mData.property, oMetaModel, mODataEntity);
						mData.property = _filterInvisibleProperties(mData.property, oElement, sAggregationName);

						if (mODataEntity.navigationProperty){
							mData.navigationProperty = mODataEntity.navigationProperty;
							mODataEntity.navigationProperty.forEach(function(oNavProp){
								var sFullyQualifiedEntityName = (
									oMetaModel.getODataAssociationEnd(mODataEntity, oNavProp.name)
									&& oMetaModel.getODataAssociationEnd(mODataEntity, oNavProp.name).type
								);
								var oEntityType = oMetaModel.getODataEntityType(sFullyQualifiedEntityName);
								if (oEntityType && oEntityType.name){
									if (mData.navigationEntityNames.indexOf(oEntityType.name) === -1){
										mData.navigationEntityNames.push(oEntityType.name);
									}
								}
							});
						}
					}
					return mData;
				});
			}
		}

		return Promise.resolve(mData);
	}
function _getODataPropertiesOfModel ( oElement , sAggregationName ) { var oModel = oElement . getModel ( ) ; var mData = { property : [ ] , navigationProperty : [ ] , navigationEntityNames : [ ] } ; if ( oModel ) { var sModelName = oModel . getMetadata ( ) . getName ( ) ; if ( sModelName === "sap.ui.model.odata.ODataModel" || sModelName === "sap.ui.model.odata.v2.ODataModel" ) { var oMetaModel = oModel . getMetaModel ( ) ; return oMetaModel . loaded ( ) . then ( function ( ) { var sBindingContextPath = _getBindingPath ( oElement , sAggregationName ) ; if ( sBindingContextPath ) { var oMetaModelContext = oMetaModel . getMetaContext ( sBindingContextPath ) ; var mODataEntity = oMetaModelContext . getObject ( ) ; var oDefaultAggregation = oElement . getMetadata ( ) . getAggregation ( ) ; if ( oDefaultAggregation ) { var oBinding = oElement . getBindingInfo ( oDefaultAggregation . name ) ; var oTemplate = oBinding && oBinding . template ; if ( oTemplate ) { var sPath = oElement . getBindingPath ( oDefaultAggregation . name ) ; var oODataAssociationEnd = oMetaModel . getODataAssociationEnd ( mODataEntity , sPath ) ; var sFullyQualifiedEntityName = oODataAssociationEnd && oODataAssociationEnd . type ; if ( sFullyQualifiedEntityName ) { var oEntityType = oMetaModel . getODataEntityType ( sFullyQualifiedEntityName ) ; mODataEntity = oEntityType ; } } } mData . property = mODataEntity . property || [ ] ; mData . property = _expandComplexProperties ( mData . property , oMetaModel , mODataEntity ) ; mData . property = _filterInvisibleProperties ( mData . property , oElement , sAggregationName ) ; if ( mODataEntity . navigationProperty ) { mData . navigationProperty = mODataEntity . navigationProperty ; mODataEntity . navigationProperty . forEach ( function ( oNavProp ) { var sFullyQualifiedEntityName = ( oMetaModel . getODataAssociationEnd ( mODataEntity , oNavProp . name ) && oMetaModel . getODataAssociationEnd ( mODataEntity , oNavProp . name ) . type ) ; var oEntityType = oMetaModel . getODataEntityType ( sFullyQualifiedEntityName ) ; if ( oEntityType && oEntityType . name ) { if ( mData . navigationEntityNames . indexOf ( oEntityType . name ) === - 1 ) { mData . navigationEntityNames . push ( oEntityType . name ) ; } } } ) ; } } return mData ; } ) ; } } return Promise . resolve ( mData ) ; }
Fetching all available properties of the Element's Model
@param {sap.ui.core.Control} oElement - Control instance
@param {string} sAggregationName - aggregation name of the action
@return {Promise} - Returns Promise with results
@private
Fetching all available properties of the Element s Model