Class sap.ui.model.odata.ODataMetadataModule: sap/ui/model/odata/ODataMetadata


Implementation to access oData metadata

Constructor Summary
new sap.ui.model.odata.ODataMetadata(sMetadataURI, mParams?)Constructor for a new ODataMetadata.
Method Summary
sap.ui.model.odata.ODataMetadata.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.odata.ODataMetadata with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.model.odata.ODataMetadata.getMetadata()Returns a metadata object for class sap.ui.model.odata.ODataMetadata.
attachFailed(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'failed' event of this sap.ui.model.odata.ODataMetadata.
attachLoaded(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'loaded' event of this sap.ui.model.odata.ODataMetadata.
detachFailed(fnFunction, oListener)Detach event-handler fnFunction from the 'failed' event of this sap.ui.model.odata.ODataMetadata.
detachLoaded(fnFunction, oListener)Detach event-handler fnFunction from the 'loaded' event of this sap.ui.model.odata.ODataMetadata.
fireFailed(mArguments?)Fire event failed to attached listeners.
fireLoaded()Fire event loaded to attached listeners.
getServiceMetadata()Return the metadata object
getUseBatch()Get the the use-batch extension value if any
isFailed()Checks whether metadata loading has already failed
isLoaded()Checks whether metadata is available
loaded()Returns a promise for the loaded state of the metadata
refresh()Refreshes the metadata creating a new request to the server.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.odata.ODataMetadata(sMetadataURI, mParams?)
Constructor for a new ODataMetadata.
Parameters:
{string}sMetadataURI needs the correct metadata uri including $metadata
{object}mParams? optional map of parameters.
{boolean}mParams.async?, Default: true request is per default async
{string}mParams.user? user for the service,
{string}mParams.password? password for service
{object}mParams.headers? (optional) map of custom headers which should be set with the request.
Method Detail
sap.ui.model.odata.ODataMetadata.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.odata.ODataMetadata with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.EventProvider.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.model.odata.ODataMetadata.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.odata.ODataMetadata.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachFailed(oData?, fnFunction, oListener?): sap.ui.model.odata.ODataMetadata
Attach event-handler fnFunction to the 'failed' event of this sap.ui.model.odata.ODataMetadata.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event.
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, the global context (window) is used.
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
attachLoaded(oData?, fnFunction, oListener?): sap.ui.model.odata.ODataMetadata
Attach event-handler fnFunction to the 'loaded' event of this sap.ui.model.odata.ODataMetadata.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event.
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, the global context (window) is used.
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
detachFailed(fnFunction, oListener): sap.ui.model.odata.ODataMetadata
Detach event-handler fnFunction from the 'failed' event of this sap.ui.model.odata.ODataMetadata.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
detachLoaded(fnFunction, oListener): sap.ui.model.odata.ODataMetadata
Detach event-handler fnFunction from the 'loaded' event of this sap.ui.model.odata.ODataMetadata.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
fireFailed(mArguments?): sap.ui.model.odata.ODataMetadata
Fire event failed to attached listeners.
Parameters:
{object}mArguments? the arguments to pass along with the event.
{string}mArguments.message? A text that describes the failure.
{string}mArguments.statusCode? HTTP status code returned by the request (if available)
{string}mArguments.statusText? The status as a text, details not specified, intended only for diagnosis output
{string}mArguments.responseText? Response that has been received for the request ,as a text string
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
Fire event loaded to attached listeners.
Returns:
{sap.ui.model.odata.ODataMetadata}this to allow method chaining
getServiceMetadata(): Object
Return the metadata object
Returns:
{Object} metdata object
getUseBatch(): boolean
Get the the use-batch extension value if any
Returns:
{boolean} true/false
isFailed(): boolean
Checks whether metadata loading has already failed
Returns:
{boolean} returns whether metadata request has failed
isLoaded(): boolean
Checks whether metadata is available
Returns:
{boolean} returns whether metadata is already loaded
loaded(): Promise
Returns a promise for the loaded state of the metadata
Returns:
{Promise} returns a promise on metadata loaded state
refresh(): Promise
Refreshes the metadata creating a new request to the server. Returns a new promise which can be resolved or rejected depending on the metadata loading state.
Returns:
{Promise} returns a promise on metadata loaded state