AppConfigOperationsExtension

Interface

The extension interface for ContextTool extension point. The methods in this class must return the new appConfig

Inheritance: AppConfigOperationsExtensionBaseExtension

Properties

Hide inherited properties
PropertyTypeNotes
(sourceWidgetIdstring, sourceAppConfigIMAppConfig, destWidgetIdstring, destAppConfigIMAppConfig, widgetMap?{}) => IMAppConfig

Process the widget's internal config after it is copied if necessary. Only the original widget's extension should get invoked with the new copiedWidgetId.

(appConfigIMAppConfig, widgetIdstring) => IMAppConfig

This method is invoked when a widget is going to be removed from the app config. This method is invoked before the widget has been removed from the layout.

(appConfigIMAppConfig) => IMAppConfig

This method is invoked before the app config is changed.

(appConfigIMAppConfig, dataSourceIdstring) => IMAppConfig

If a widget saves the data source id in its internal config, it should override this method to do the clean ups. Only the widgets that save the data source id in it's useDataSources will get invoked.

id
inherited
string

The unique ID. For widget's provided extension, the id pattern is: widgetId + extensionName

index
inherited
number

If an extension point supports multiple extensions, the index is used to determine the extension order.

label
inherited
string

The extension label.

(appConfigIMAppConfig, mapWidgetIdstring) => IMAppConfig

If a widget saves some map related data its internal config, it should override this method to do the clean ups. Only the widgets that save the map widget id in it's useMapWidgets will get invoked.

name
inherited
string

The extension name.

(appConfigIMAppConfig, dataSourceIdstring) => IMAppConfig

If a widget saves some config that is related to the data source in its internal config, it should override this method to do the clean ups. In most cases, a widget can just do the clean ups in its setting panel. However, when we remove a used data source from the list, the list internal widgets don't have the chance to do the clean ups. These widgets (Text/Image/Button) should override this method to do the clean ups. Another case is in Express mode, when the map widget de-selects a data source, all related widgets "useDataSources" are cleared.

(appConfigIMAppConfig, utilityIdstring) => IMAppConfig

If a widget saves the utility id in its internal config, it should override this method to do the clean ups. Only the widgets that save the utility id in it's useUtilities will get invoked.

widgetId
inherited
string

The widget ID that provides the extension. No widget id means the extension is provided by Jimu.

(appConfigIMAppConfig) => IMAppConfig

Do some cleanup operations before current widget is removed. This method is invoked after the widget has been removed from the layout.

afterWidgetCopied

optional
Interface Property
afterWidgetCopied: (sourceWidgetIdstring, sourceAppConfigIMAppConfig, destWidgetIdstring, destAppConfigIMAppConfig, widgetMap?{}) => IMAppConfig

Process the widget's internal config after it is copied if necessary. Only the original widget's extension should get invoked with the new copiedWidgetId.

Type declaration
    function(sourceWidgetIdstring, sourceAppConfigIMAppConfig, destWidgetIdstring, destAppConfigIMAppConfig, widgetMap?{}): IMAppConfig
    Parameters
    ParameterTypeNotes
    sourceWidgetId
    string

    Id of the widget that is copied.

    sourceAppConfig
    IMAppConfig

    The app config the sourceWidgetId comes from.

    destWidgetId
    string

    Id of the widget that is created in the destAppConfig.

    destAppConfig
    IMAppConfig

    The app config the destWidgetId is created in.

    widgetMap
    {}

    The map of widget ids after copying. Only provided when the whole page is duplicated. The key is the widget id in the original page, and the value is the widget id in the copied page.

    Returns 
    IMAppConfig

    The updated appConfig

anyWidgetWillRemove

optional
Interface Property
anyWidgetWillRemove: (appConfigIMAppConfig, widgetIdstring) => IMAppConfig

This method is invoked when a widget is going to be removed from the app config. This method is invoked before the widget has been removed from the layout.

Type declaration
    function(appConfigIMAppConfig, widgetIdstring): IMAppConfig
    Parameters
    ParameterTypeNotes
    appConfig
    IMAppConfig
    widgetId
    string

    the widget id that is going to be removed

    Returns 
    IMAppConfig

    The updated appConfig

appConfigWillChange

optional
Interface Property
appConfigWillChange: (appConfigIMAppConfig) => IMAppConfig

This method is invoked before the app config is changed.

Type declaration
    function(appConfigIMAppConfig): IMAppConfig
    Parameters
    ParameterType
    appConfig
    IMAppConfig
    Returns 
    IMAppConfig

dataSourceWillRemove

optional
Interface Property
dataSourceWillRemove: (appConfigIMAppConfig, dataSourceIdstring) => IMAppConfig

If a widget saves the data source id in its internal config, it should override this method to do the clean ups. Only the widgets that save the data source id in it's useDataSources will get invoked.

Type declaration
    function(appConfigIMAppConfig, dataSourceIdstring): IMAppConfig
    Parameters
    ParameterTypeNotes
    appConfig
    IMAppConfig

    The app config.

    dataSourceId
    string

    The data source id that is going to be removed.

    Returns 
    IMAppConfig

    The updated appConfig

id

inheritedinherited
Interface Property
id: string

The unique ID. For widget's provided extension, the id pattern is: widgetId + extensionName

Inherited from BaseExtension.id

index

optionalinheritedinherited
Interface Property
index: number

If an extension point supports multiple extensions, the index is used to determine the extension order.

Inherited from BaseExtension.index

label

optionalinheritedinherited
Interface Property
label: string

The extension label.

Inherited from BaseExtension.label

mapWidgetWillRemove

optional
Interface Property
mapWidgetWillRemove: (appConfigIMAppConfig, mapWidgetIdstring) => IMAppConfig

If a widget saves some map related data its internal config, it should override this method to do the clean ups. Only the widgets that save the map widget id in it's useMapWidgets will get invoked.

Type declaration
    function(appConfigIMAppConfig, mapWidgetIdstring): IMAppConfig
    Parameters
    ParameterTypeNotes
    appConfig
    IMAppConfig

    The app config.

    mapWidgetId
    string

    The map widget id that is going to be removed.

    Returns 
    IMAppConfig

    The updated appConfig

name

optionalinheritedinherited
Interface Property
name: string

The extension name.

Inherited from BaseExtension.name

useDataSourceWillRemove

optional
Interface Property
useDataSourceWillRemove: (appConfigIMAppConfig, dataSourceIdstring) => IMAppConfig

If a widget saves some config that is related to the data source in its internal config, it should override this method to do the clean ups. In most cases, a widget can just do the clean ups in its setting panel. However, when we remove a used data source from the list, the list internal widgets don't have the chance to do the clean ups. These widgets (Text/Image/Button) should override this method to do the clean ups. Another case is in Express mode, when the map widget de-selects a data source, all related widgets "useDataSources" are cleared.

For config in the widget message action and data action, widget can clean up the config in the useDataSourceWillRemove method. For the framework actions, the action can provide the useDataSourceWillRemove method to clean up the config.

Type declaration
    function(appConfigIMAppConfig, dataSourceIdstring): IMAppConfig
    Parameters
    ParameterTypeNotes
    appConfig
    IMAppConfig

    The app config.

    dataSourceId
    string

    The use data source id that is going to be removed.

    Returns 
    IMAppConfig

    The updated appConfig

utilityWillRemove

optional
Interface Property
utilityWillRemove: (appConfigIMAppConfig, utilityIdstring) => IMAppConfig

If a widget saves the utility id in its internal config, it should override this method to do the clean ups. Only the widgets that save the utility id in it's useUtilities will get invoked.

Type declaration
    function(appConfigIMAppConfig, utilityIdstring): IMAppConfig
    Parameters
    ParameterTypeNotes
    appConfig
    IMAppConfig

    The app config.

    utilityId
    string

    The utility id that is going to be removed.

    Returns 
    IMAppConfig

    The updated appConfig

widgetId

optionalinheritedinherited
Interface Property
widgetId: string

The widget ID that provides the extension. No widget id means the extension is provided by Jimu.

Inherited from BaseExtension.widgetId

widgetWillRemove

optional
Interface Property
widgetWillRemove: (appConfigIMAppConfig) => IMAppConfig

Do some cleanup operations before current widget is removed. This method is invoked after the widget has been removed from the layout.

Type declaration
    function(appConfigIMAppConfig): IMAppConfig
    Parameters
    ParameterType
    appConfig
    IMAppConfig
    Returns 
    IMAppConfig

    The updated appConfig

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.