Class sap.apf.ApiModule: sap/apf/api


Official API for Analysis Path Framework (APF)

The APF API provides a consuming application access to the functionality of the APF. It is assumed that the consuming application extends type sap.apf.base.Component. The API reference is returned by method sap.apf.base.Component#getApi.
Objects and types returned by methods of APF API or passed in parameters of APF API method also belong to the API. These objects and types are documented in their respective sections of this documentation. All methods, objects or types that are not explicitly documented as public are strictly internal and may be changed without prior notice. This also includes all methods, objects or types being classified as experimental.
Furthermore there is no need to instantiate required entities directly by applying the JavaScript 'new'-operator on their respective constructors. Instead they should be created by consumers using a create method available on API-level, such as e.g. sap.apf.Api#createMessageObject for sap.apf.core.MessageObject or sap.apf.Api#createFilter for sap.apf.utils.Filter.

Constructor Summary
new sap.apf.Api(oComponent, inject?, manifests?)
Field Summary
typeContains 'api'
Method Summary
activateOnErrorHandling(bHandling)The handling of the window.onerror by the message handler is either switched on or off.
addPathFilter(filter)Adds a filter to the path.
createFilter()Creates an empty filter object.
createMessageObject(oConfig)Creates a message object, which is the mandatory parameter for API method putMessage.
createReadRequest(requestConfiguration)Creates an object for performing an Odata Request get operation.
getPathFilter(id)Gets a path filter fragment for the given identifier by fully replacing the existing one.
getTextHtmlEncoded(oLabel, aParameters)Retrieves a text and applies HTML encoding
getTextNotHtmlEncoded(oLabel, aParameters)Retrieves a text without application of HTML encoding
putMessage(oMessage)A message is passed to the APF message handler for further processing.
selectionChanged(bRefreshAllSteps)Calls the sap.apf.core.instance#updatePath (also see sap.apf.core.Path#update) with proper callback for UI.
setCallbackAfterApfStartup(fnCallback)Register the function callback to be executed after APF start-up and content has been created.
setCallbackBeforeApfStartup(fnCallback)Register the function callback to be executed before APF start-up.
setEventCallback(sEventType, fnCallback)Register the function callback to be executed on the given event type.
startupSucceeded()true, when no fatal error occurred during startup phase.
updatePathFilter(id, filter)Updates a filter of the path.
addMasterFooterContent(oControl)Adds an element to the footer area.
loadApplicationConfig(sFilePath)Loads a new application configuration in JSON format.
Constructor Detail
new sap.apf.Api(oComponent, inject?, manifests?)
Parameters:
{sap.apf.Component|sap.apf.base.Component}oComponent A reference to the calling Component.js. The reference provides access to parameters and context.
{Object}inject? injected constructors and functions for testing only.
{Object}manifests? manifests of the component and the base component itself
Field Detail
type
Contains 'api'
Method Detail
activateOnErrorHandling(bHandling)
The handling of the window.onerror by the message handler is either switched on or off. Per default the handling is deactivated.

Experimental API:Revision planned by moving the method into apf.Component.js.

Parameters:
{boolean}bHandling Boolean true switches the winow.onerror handling on
Experimental:
Revision planned by moving the method into apf.Component.js.
addPathFilter(filter): number
Adds a filter to the path. Subsequent changes need to be done by the update method providing the identifier. Limitation: Only a single filter term or a disjunction/conjunction of single terms over a single property is supported. Limitation: Only the operators EQ, LE (less equal than) and GE (greater equal than) are supported.
Parameters:
{sap.apf.utils.Filter}filter
Returns:
{number} ID to be provided for later updates of the same filter via method updatePathFilter.
createFilter(): sap.apf.utils.Filter
Creates an empty filter object. Its methods can be used to create a logical filter expression.
Returns:
{sap.apf.utils.Filter}
createMessageObject(oConfig): sap.apf.core.MessageObject
Creates a message object, which is the mandatory parameter for API method putMessage. So first create the message object and afterwards call putMessage with the message object as argument.
Parameters:
{object}oConfig Configuration object for the message object.
{string}oConfig.code The message is classified by its code. The code identifies an entry in the message configuration.
{array}oConfig.aParameters? Additional parameters for the message. The parameters are filled into the message text, when the message will be processed by the text resource handler.
{object}oConfig.oCallingObject? Reference of the calling object. This can be used later to visualize on the user interface, where the message occurred.
{string}oConfig.rawText? Raw text for non translated messages.
Returns:
{sap.apf.core.MessageObject}
createReadRequest(requestConfiguration): sap.apf.core.ReadRequest
Creates an object for performing an Odata Request get operation.
Parameters:
{String|Object}requestConfiguration identifies a request configuration, which is contained in the analytical configuration. or the request configuration is directly passed as an object oRequestConfiguration.
Returns:
{sap.apf.core.ReadRequest}
See:
sap.apf#createReadRequest
getPathFilter(id): sap.apf.utils.Filter
Gets a path filter fragment for the given identifier by fully replacing the existing one.
Parameters:
{number|string}id Identifier of the path filter fragment as it was returned by addPathFilter method.
Returns:
{sap.apf.utils.Filter} filter for id
getTextHtmlEncoded(oLabel, aParameters): string
Retrieves a text and applies HTML encoding
Parameters:
{object}oLabel || {string} Label object or text key
{string[]}aParameters Array with parameters to replace place holders in text.
Returns:
{string}
getTextNotHtmlEncoded(oLabel, aParameters): string
Retrieves a text without application of HTML encoding
Parameters:
{object}oLabel || {string} Label object or text key
{string[]}aParameters Array with parameters to replace place holders in text.
Returns:
{string}
putMessage(oMessage)
A message is passed to the APF message handler for further processing. All message specific settings (e.g. message code or severity) need to be passed within an APF message object instance.
Parameters:
{sap.apf.core.MessageObject}oMessage The message object shall be created by method sap.apf.Api#createMessageObject.
selectionChanged(bRefreshAllSteps)
Calls the sap.apf.core.instance#updatePath (also see sap.apf.core.Path#update) with proper callback for UI. It also refreshes the steps either from the active step or all the steps depending on the boolean value passed.

Experimental API:Method name tentative.

Parameters:
{boolean}bRefreshAllSteps
Experimental:
Method name tentative.
setCallbackAfterApfStartup(fnCallback)
Register the function callback to be executed after APF start-up and content has been created. Callback is called with APF API instance as parameter and 'this' set to the Component instance.
Parameters:
{function}fnCallback that will be executed after APF start-up and content has been created.
setCallbackBeforeApfStartup(fnCallback)
Register the function callback to be executed before APF start-up. Callback is called with APF API instance as parameter and 'this' set to the Component instance.
Parameters:
{function}fnCallback that will be executed before APF start-up.
setEventCallback(sEventType, fnCallback): boolean
Register the function callback to be executed on the given event type. fnCallback will be executed under a context and will be passed with arguments depending on the event type.

Experimental API:Revision planned for all parameter objects of callback function.

Parameters:
{sap.apf.core.constants.eventTypes}sEventType is the type of event for registering the fnCallback for that particular event type printTriggered - Registers a callback for initial page print, this callback returns 2d array contextChanged : Registers a callback for context change, which will set the context of the application
{function}fnCallback that will be executed depending on the event type.
Experimental:
Revision planned for all parameter objects of callback function.
Returns:
{boolean} true or false based on success or failure of registering the listener.
startupSucceeded(): boolean
true, when no fatal error occurred during startup phase. Startup phase includes the initialization + startupApf
Returns:
{boolean} success of startup
updatePathFilter(id, filter)
Updates a filter of the path. Limitation: Only a single filter term or a disjunction/conjunction of single terms over a single property is supported. Limitation: Only the operators EQ, LE (less equal than) and GE (greater equal than) are supported.
Parameters:
{number|string}id Identifier of the path filter as it was returned by addPathFilter method. When using an ID of type string the caller must ensure that it is unique.
{sap.apf.utils.Filter}filter
addMasterFooterContent(oControl)
Adds an element to the footer area.

Experimental API:Revision planned for method name.

Parameters:
{object}oControl any valid UI5 control.
Deprecated:
since Version 1.23.1. Remains in api in order to maintain downward compatibility to 3 Wave 5 apps.
Experimental:
Revision planned for method name.
loadApplicationConfig(sFilePath)
Loads a new application configuration in JSON format. When called many times, the file is loaded only the first time.

Experimental API:Revision planned by moving the method into apf.Component.js.

Parameters:
{string}sFilePath The absolute path of an application configuration file. Host and port will be added in front of this path.
Deprecated:
since Version 1.23.1.
Experimental:
Revision planned by moving the method into apf.Component.js.