Skip to main content

Add new metadata view to plugin

If a D2SV plugin intends to define new views like properties, versions, permissions, task performers then this assistant option could be used to create the boilerplate code associated with such views, which is also known as metadata panel.

caution

Use this option when at least one plugin project exists in the workspace.

Associated questions and their meanings -

  • Select plugin to add new metadata view

    Specify the plugin project where to add boilerplate code for the new metadata view.

  • Enter name for the view

    A unique name for the new metadata view.

    This will be the option name shown in the dropdown by default.

  • Do you want to include this metadata as Properties Sub-widget ?

    Specify if this metadata panel should be included as a sub-widget of the Properties widget.

    If yes, the generated code will register the metadata panel as a widget type mapping under the Properties widget, and the view will only be enabled when the associated widget type is configured for the user.

    If no, the metadata panel will be registered as a standalone metadata panel extension, visible for all the users without needing a widget configuration for it.

  • Name of Widget type to associate (E.g. FavoritesWidget, RecentlyAccessedWidget etc.)

    This question is asked only if the previous question is answered as yes.

    Specify a unique widget type name to associate with this metadata panel for mapping.

    The widget type name can only have alpha-numeric characters and must not start with a number.

    The widget type name must be globally unique — it must not collide with any OOTB widget type or any widget type declared in another plugin.

Associated generated boilerplate files and their use -

  • The generated files would be present under <Plugins Directory>\<Selected Plugin>\src\main

  • smartview\src\widgets\metadata\panels\impl folder

    This folder contains the handlebar template file and the style sheet file used by the view.

    It also contains the nls folder which contains the lang files used for the translation strings.

    The option name shown in the dropdown could be changed by changing the translation string value for viewName in lang.js file under nls/root folder.

  • smartview\src\widgets\metadata\panels\metadata.<View Name>.view.js

    This is the main view file for the new metadata view created.

    This will have code for a simple helloworld view.

    The template file, style sheet and lang file used by this view are already loaded.

    A wrapper class name for this view, ui, regions and events are defined in this view for reference.

    Modify this view based on the usecase.

    Incase of complex view, break it into smaller independent views and keep them under impl folder, specify regions in the main view and show these smaller views using regions.

    By default, this view will be shown for all metadata dropdowns. Add conditions in enabled function to restrict this view based on the usecase.

    Note: When included as a Properties Sub-widget, the enabled function will have a condition to check for the associated widget type, so the view will only be shown when the widget type is configured for the user.

  • smartview\src\extensions\metadata.panel.views.js (when not included as Properties Sub-widget)

    This extension file registers the metadata panel as a standalone metadata panel view.

    It is generated under <Selected Plugin>\src\main\smartview\src\extensions.

  • smartview\src\extensions\metadatapanel.widget.type.mapping.js (when included as Properties Sub-widget)

    This extension file registers the metadata panel view with the associated widget type mapping.

    It is generated under <Selected Plugin>\src\main\smartview\src\extensions.

  • resources\WidgetSubtypelist.properties and resources\PropertyWidgetSubType.properties (when included as Properties Sub-widget)

    These resource files contain the widget type registration entries.