import InsightProvider from '@sap/pdms-ipro-api/src/InsightProviderInterface.js'InsightProvider
Interface each ipro.js has to implement
Static Method Summary
| Static Public Methods | ||
| public static |
create(insightProviderOptions: InsightProviderOptions): InsightProvider | Promise<InsightProvider> 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 |
|
| 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 |
<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:
| Name | Type | Attribute | Description |
| insightProviderOptions | InsightProviderOptions | create options |
Return:
| InsightProvider | Promise<InsightProvider> | returns instance or Promise of an instance of 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:
| Name | Type | Attribute | Description |
| contextQuery | ContextQuery | The context query object |
public getContextChangeHandler(): ContextChangeHandler source
public getIntentHandler(): IntentHandler source
public getUiContainer(): Element source
Gets the uiContainer DOM element. This element has been previously passed into the 'create' factory function of the ipro class.
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:
| Name | Type | Attribute | Description |
| 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
Params:
| Name | Type | Attribute | Description |
| contextChangeHandler | ContextChangeHandler | The context change handler function. |
Return:
| void |
public setIntentHandler(intentHandler: IntentHandler): void source
Params:
| Name | Type | Attribute | Description |
| intentHandler | IntentHandler | The intent handler function |
Return:
| void |