class sap.ui.generic.app.transaction.DraftContext

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/generic/app/transaction/DraftContext
Application Component: CA-UI5-ST

The class provides access to information on draft handling that is available in the OData service's metadata as it interprets draft-specific annotations.


Constructor

Constructor for meta-model access class.

new sap.ui.generic.app.transaction.DraftContext(oModel)
Param Type Default Value Description
oModel sap.ui.model.odata.ODataModel

The OData model currently used


Methods Overview

Method Description
checkUpdateOnChange

Checks whether an OData property is annotated with UpdateOnChange. The method is used in context of a validation success event.

destroy

Frees all resources claimed during the life-time of this instance.

sap.ui.generic.app.transaction.DraftContext.extend

Creates a new subclass of class sap.ui.generic.app.transaction.DraftContext 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.Object.extend.

sap.ui.generic.app.transaction.DraftContext.getMetadata

Returns a metadata object for class sap.ui.generic.app.transaction.DraftContext.

getODataDraftFunctionImportName

Returns the name of the function import to be used.

getSemanticKey

Returns the semantic keys for a given entity set.

hasDraft

Checks whether an entity set is draft-enabled. The entity set name is derived from the given binding context

hasDraftAdministrativeData

Checks whether administrative data for a given draft is available.

hasDraftPreparationAction

Checks whether an entity set has a draft preparation action. The entity set name is derived from the given binding context.

hasDraftRoot

Checks whether an entity set is draft root. The entity set name is derived from the given binding context.

hasDraftValidationFunction

Checks whether an entity set has a draft validation function. The entity set name is derived from the given binding context.

hasPreserveChanges

Checks if the parameter "PreserveChanges" is supported by the edit function. If the edit action is triggered with the parameter set to true the ABAP application infrastructure will respond with HTTP response code 409 if unsaved changes (from another user) exist.

hasSiblingEntity

Checks whether a sibling entity for a given entity set is available.

isDraftEnabled

Checks whether a given entity set is draft-enabled.

isDraftRoot

Checks whether a given entity set is a draft root.

isSemanticKey

Checks whether a given key is a semantic key.

isTechnicalKey

Checks whether a given key is a technical key.

checkUpdateOnChange

Checks whether an OData property is annotated with UpdateOnChange. The method is used in context of a validation success event.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

sProperty string

The name of the property

destroy

Frees all resources claimed during the life-time of this instance.

sap.ui.generic.app.transaction.DraftContext.extend

Creates a new subclass of class sap.ui.generic.app.transaction.DraftContext 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.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

sap.ui.generic.app.transaction.DraftContext.getMetadata

Returns a metadata object for class sap.ui.generic.app.transaction.DraftContext.

getODataDraftFunctionImportName

Returns the name of the function import to be used.

Param Type DefaultValue Description
oContext sap.ui.model.Context

The given binding context

sDraftFunctionImport string

The draft function import

getSemanticKey

Returns the semantic keys for a given entity set.

Param Type DefaultValue Description
sEntitySet string

The given entity set

hasDraft

Checks whether an entity set is draft-enabled. The entity set name is derived from the given binding context

Param Type DefaultValue Description
oContext sap.ui.model.Context

The given binding context

hasDraftAdministrativeData

Checks whether administrative data for a given draft is available.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

hasDraftPreparationAction

Checks whether an entity set has a draft preparation action. The entity set name is derived from the given binding context.

Param Type DefaultValue Description
oContext sap.ui.model.Context

The given binding context

hasDraftRoot

Checks whether an entity set is draft root. The entity set name is derived from the given binding context.

Param Type DefaultValue Description
oContext sap.ui.model.Context

The given binding context

hasDraftValidationFunction

Checks whether an entity set has a draft validation function. The entity set name is derived from the given binding context.

Param Type DefaultValue Description
oContext sap.ui.model.Context

The given binding context

hasPreserveChanges

Checks if the parameter "PreserveChanges" is supported by the edit function. If the edit action is triggered with the parameter set to true the ABAP application infrastructure will respond with HTTP response code 409 if unsaved changes (from another user) exist.

hasSiblingEntity

Checks whether a sibling entity for a given entity set is available.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

isDraftEnabled

Checks whether a given entity set is draft-enabled.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

isDraftRoot

Checks whether a given entity set is a draft root.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

isSemanticKey

Checks whether a given key is a semantic key.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

oKeys object

The given key

isTechnicalKey

Checks whether a given key is a technical key.

Param Type DefaultValue Description
sEntitySet string

The name of the entity set

oKeys object

The given key