Home Manual Reference Source
public interface | source

InsightProvider

Interface each ipro.js has to implement

Static Method Summary

Static Public Methods
public static

Creates an instance of an ipro

public static

Gets the metadata of an ipro

Method Summary

Public Methods
public

destroy(): void

Called by an application to enable an ipro to release any resources before being removed from the application.

public

getContext(contextQuery: ContextQuery): Context | Promise<Context>

getContext allows an application to query the context of an ipro.

public
this method was deprecated. since version 3.0.0 returns the current contextChangeHandler.
public
this method was deprecated. since version 3.0.0 Returns the current intentHandler.
public

<Optional Method> Gets the size of the ipro.

public

Gets the uiContainer DOM element.

public

setContext(context: Context): void | Promise<void>

This is called from the application to set a new context (e.g.

public

setContextChangeHandler(contextChangeHandler: ContextChangeHandler): void

this method was deprecated. since version 3.0.0 Sets callback function to notify an application whenever the context of a given EntityType has changed. insightProvider argument of the function is the ipro that has changed the context. The contextQuery argument specifies which context has been changed. In a typical immplementation of this function an application will evaluate which context has been changed, call the getContext method of insightProvider to retrieve the new context, and then call setContext of interested ipros to pass in the new context.
public

setIntentHandler(intentHandler: IntentHandler): void

this method was deprecated. since version 3.0.0 Sets callback function to notify an application whenever an ipro communicates an intent. An intent is an action that an ipro wants to trigger without knowing the exact details of that action. The one intent currently being defined is sap.pdms.ipro.api.StandardIntent.NAVIGATE_TO_CONTEXT. For instance, an ipro might expose a "Details" button to allow the user to navigate to the details page for a given EntityType. The ipro does not know what would be a suitable details page for this EntityType. So it communicates to the application the intent to navigate and then it is up to the application to implement the actual navigation. An intent can be thought of as an action whose implementation details are unknown to the ipro and thus represents an additional level of decoupling between actors expressing an intent and actors reacting to it. insightProvider argument is the ipro that has expressed the intent. intentType defines the type of intent. The only current intent type is sap.pdms.ipro.api.StandardIntent.NAVIGATE_TO_CONTEXT. intentParams provides additional information to the intent depending on the intentType.
public

setSize(size: Size)

<Optional Method> Sets the size of the ipro.

Static Public Methods

public static create(insightProviderOptions: InsightProviderOptions): InsightProvider | Promise<InsightProvider> source

Creates an instance of an ipro

Params:

NameTypeAttributeDescription
insightProviderOptions InsightProviderOptions

create options

Return:

InsightProvider | Promise<InsightProvider>

returns instance or Promise of an instance of InsightProvider

public static getMetadata(): InsightProviderMetadata source

Gets the metadata of an ipro

Return:

InsightProviderMetadata

The metadata of an InsightProvider

Public Methods

public destroy(): void source

Called by an application to enable an ipro to release any resources before being removed from the application.

Return:

void

public getContext(contextQuery: ContextQuery): Context | Promise<Context> source

getContext allows an application to query the context of an ipro.

Params:

NameTypeAttributeDescription
contextQuery ContextQuery

The context query object

Return:

Context | Promise<Context>

Context result or a promise resolving with a context result.

public getContextChangeHandler(): ContextChangeHandler source

this method was deprecated. since version 3.0.0 returns the current contextChangeHandler.

Return:

ContextChangeHandler

The context change handler function

public getIntentHandler(): IntentHandler source

this method was deprecated. since version 3.0.0 Returns the current intentHandler.

Return:

IntentHandler

The intent handler function

public getSize(): Size source

<Optional Method> Gets the size of the ipro.

Return:

Size

The size of an ipro

public getUiContainer(): Element source

Gets the uiContainer DOM element. This element has been previously passed into the 'create' factory function of the ipro class.

Return:

Element

The parent DOM element / container of the ipro

public setContext(context: Context): void | Promise<void> source

This is called from the application to set a new context (e.g. the assetIds / primaryObjects) that an ipro should analyze and display. For most ipros that means they will apply a filter, make a backend ajax request and display the data associated with the given context. The passed contextResult parameter can have contexts of different entity types. The ipro should only react to the entitytypes it supports and simply ignore the other given entity types.

Params:

NameTypeAttributeDescription
context Context

The new context for the ipro.

Return:

void | Promise<void>

Return void synchronously or return a Promise<void> that is rejected or resolved once all async operations (e.g. backend requests, onAfterRendering) are completed.

public setContextChangeHandler(contextChangeHandler: ContextChangeHandler): void source

this method was deprecated. since version 3.0.0 Sets callback function to notify an application whenever the context of a given EntityType has changed. insightProvider argument of the function is the ipro that has changed the context. The contextQuery argument specifies which context has been changed. In a typical immplementation of this function an application will evaluate which context has been changed, call the getContext method of insightProvider to retrieve the new context, and then call setContext of interested ipros to pass in the new context.

Params:

NameTypeAttributeDescription
contextChangeHandler ContextChangeHandler

The context change handler function.

Return:

void

public setIntentHandler(intentHandler: IntentHandler): void source

this method was deprecated. since version 3.0.0 Sets callback function to notify an application whenever an ipro communicates an intent. An intent is an action that an ipro wants to trigger without knowing the exact details of that action. The one intent currently being defined is sap.pdms.ipro.api.StandardIntent.NAVIGATE_TO_CONTEXT. For instance, an ipro might expose a "Details" button to allow the user to navigate to the details page for a given EntityType. The ipro does not know what would be a suitable details page for this EntityType. So it communicates to the application the intent to navigate and then it is up to the application to implement the actual navigation. An intent can be thought of as an action whose implementation details are unknown to the ipro and thus represents an additional level of decoupling between actors expressing an intent and actors reacting to it. insightProvider argument is the ipro that has expressed the intent. intentType defines the type of intent. The only current intent type is sap.pdms.ipro.api.StandardIntent.NAVIGATE_TO_CONTEXT. intentParams provides additional information to the intent depending on the intentType.

Params:

NameTypeAttributeDescription
intentHandler IntentHandler

The intent handler function

Return:

void

public setSize(size: Size) source

<Optional Method> Sets the size of the ipro. setSize will be called by the application after the uiContainer has been resized.

Params:

NameTypeAttributeDescription
size Size