View-Portlet registration
After you create portlets, you must associate them with an appropriate view.
- A registry mechanism is provided to register custom portlets and also to override the sequence or visibility or view configuration of the default portlets.
- A static property
extensionPersonaConfigList
in the store-customization-impl.ts file must be updated for a custom portlet and also for a portlet that must be overridden. - A sample JSON specification for various properties of a view and portlet is as
follows:
{ personaName: 'Inv_Management', personaIconClass: 'app-icon-inventory_mgmt_20', portlets: [ { portletTitleBundleKey: 'moveInventoryPortlet.TITLE_MoveInventoryPortlet', portletSequenceNumber: 4, portletComponent: MoveInventoryPortletComponent, portletTID: 'moveInventoryPortlet', resourceId: 'ISF000003' } ] }
Table 1. Supported attributes for JSON specification Attribute Description personaName {String}
Mandatory for new custom portlet.
This is the name of a view (persona) that is defined in Sterling Business Center. It corresponds to theCodeName
for theCommonCode
CodeType
"WSC_HOMEPAGE_PERSONA
". It is used on the UI to determine whether the portlet should be one of the available portlets for the currently selected view or not. It is only considered in the list, if thepersonaName
matches the currently selected view (persona). This attribute does not guarantee the visibility. Visibility is determined by a combination ofshowPortlet
andresourceId
.personaIconClass {String}
Enter the name of the CSS class that is used to display the icon for the view in the side navigation. Refer View-Portlet registration portlets {JSON}
Mandatory for new custom portlet. This is the JSON configuration for various properties of the portlet. Supported attributes are:- portletTitleBundleKey
- portletSequenceNumber
- portletComponent
- portletTID
- resourceId
- showPortlet
- portletColor
- displayPortletTitleName
- miniPortletCountProvider
- portletIconClass
portletTitleBundleKey {String}
Mandatory for a new custom portlet. It is the title bundle key of the portlet. Refer Defining a bundle entry for a new custom portlet. portletSequenceNumber {String}
Portlets are sorted in the ascending order of this number. Thus, a smaller number indicates that the portlet will appear in the beginning and a bigger number indicates that the portlet will be displayed later in the sequence. portletComponent {Component}
Mandatory for a new custom portlet. It is the class name of the portlet component. portletTID {String}
Mandatory for a new custom portlet. It is the unique identifier for the component. resourceId {String}
Mandatory for a new custom portlet. This is the resource permission for the portlet. Multiple resource permissions can be combined by using a pipe (|). For example, 'EXTN000015|EXTN000012|EXTN000028'. A portlet is displayed if the user has permissions to view at least one of the resourceIds. It can be passed to override the corresponding value of a default portlet. showPortlet {boolean}
Mandatory for a new custom portlet. This is a flag to indicate whether the portlet should be displayed on the UI or not. By setting it to false
, you will not show the portlet on the UI, regardless of whether the user has the resource permission to the portlet or not. It can be passed to override the corresponding value of a default portlet.portletColor {string}
This property is used only in mini portlet panel. Portlet color code (hex value) is added as a variable in portlet component SCSS file and used directly in HTML. Note: The color is provided in portlet component HTML &.scss files.displayPortletTitleName {boolean}
This property should be set to true, if portlet component is handling the display of portlet title.
If not provided, portlet title value defined in
portletTitleBundleKey
property will be displayed in portlet.This property definition is optional.
miniPortletCountProvider {string}
This property defines the method name to be invoked in MiniPortletDataService
. This method gets the count value from API, which is then displayed on the badges in mini portlet.This property definition is optional.
portletIconClass
Enter the name of the CSS class that is used to display the icon of the portlet in a mini portlet panel. This property is used only in a mini portlet panel.