Skip to main content

metadatapanel.widget.type.mapping

MetadataPanelWidgetTypeMapping : d2/sdk/widgets/metadata.panel/metadatapanel.widget.type.mapping​

An array of mappings between a D2-Config widget type and the metadata panel view which has to be rendered for that widget type.

These mappings are added to the default mappings shipped with smartview (versions, relations, renditions, locations, audit, permissions, doclist), so that a sub-widget configured on the D2-Config properties widget can be rendered by a metadata view coming from a plugin.

Extends: Array
Example (To register a mapping, add the entry in extension.json as)

{
"d2/sdk/widgets/metadata.panel/metadatapanel.widget.type.mapping": {
"extensions": {
"mybundle": [
"mybundle/extensions/metadatapanel.widget.type.mapping"
]
}
}
}

Example (The mybundle/extensions/metadatapanel.widget.type.mapping.js is defined as below)

define([
'mybundle/widgets/metadata/extWidgetTypeMappings/helloworld/metadata.helloworld.view'
], function (MetadataHelloworldView) {
'use strict';

// Array of widget type mappings added by the plugin
return [

// Each entry should have the D2-Config widget type and the metadata view (panel)
// which has to be rendered when a sub-widget of that type is configured on the D2-Config properties widget.

{
type: 'HelloWorldWidget', // The D2-Config widget type, it has to be a unique string
panel: MetadataHelloworldView
}

// Additional mappings can also be registered in this array
];
});

MetadataPanelWidgetTypeMapping~WidgetTypeMapping : Object​

Kind: inner typedef of MetadataPanelWidgetTypeMapping
Properties

NameTypeDescription
typestring

Name of the D2-Config widget type

panelMetadataPanelView

The metadata view rendered for this widget type