Next-generation platform

Associating new portlets with an appropriate view

After you create portlets, you must associate the new portlets with an appropriate view.

The customization framework provides a registry mechanism to register newly added custom portlets or override application-provided portlets. This registry mechanism reads the portlet configuration from <store-temp>/extensions/override-static-assets/portlets/config/isf-persona-config.json file.

A following sample JSON specification illustrates for various properties of the view and portlet.

{
        personaName: 'Inv_Management',
        personaIconClass: 'app-icon-inventory_mgmt_20',
        portlets: [
            {
                portletTitleBundleKey: 'moveInventoryPortlet.TITLE_MoveInventoryPortlet',
                portletSequenceNumber: 4,
                extensionType:'CODE',
                portletComponent: MoveInventoryPortletComponent,
                portletTID: 'moveInventoryPortlet',
                resourceId: 'ISF000003'
            }
        ]
    }

The following table describes the supported attributes for JSON specification:

Table 1. Supported attributes for JSON specification
Attribute Description
personaName {String} This attribute is mandatory for a new custom portlet. The name of a view (persona) that is defined in Sterling Business Center. It corresponds to the CodeName for the CommonCode CodeType "WSC_HOMEPAGE_PERSONA". It is used in the UI to determine whether the portlet must be made as one of the available portlets for the currently selected view. It is only considered in the list, if the personaName matches the currently selected view (persona). This attribute does not assure visibility. Visibility is determined by the combination of showPortlet and resourceId.
personaIconClass {String} This is an optional attribute. Enter the name of the CSS class that is used to display the icon for the view in the side navigation.
portlets {JSON} Mandatory for a new custom portlet. This is the JSON configuration for various properties of the portlet. The supported attributes are:
  • portletTitleBundleKey
  • portletSequenceNumber
  • portletComponent
  • portletTID
  • extensionType
  • resourceId
  • showPortlet
  • portletColor
  • displayPortletTitleName
  • miniPortletCountProvider
  • portletIconClass
portletTitleBundleKey {String} This attribute is mandatory for a new custom portlet. The title bundle key of the portlet.
portletSequenceNumber {String} This is an optional attribute. Portlets are sorted in the ascending order of this number. Thus, a smaller number indicates that the portlet appears in the beginning. A bigger number indicates that the portlet is displayed later in the sequence.
extensionType {String} This attribute is mandatory for a new or existing portlet. The valid values are CODE or CONFIG.
  • CODE - Use if you are overriding the application-provided portlet code or creating a new portlet.
  • CONFIG - Use if the portlet customization is limited to configuration. For example, when you change the portlet sequence number.
portletComponent {Component} This attribute is mandatory for a new custom portlet. The class name of the portlet component.
portletTID {String} This attribute is mandatory for a new custom portlet. The unique identifier for the component.
resourceId {String} This attribute is mandatory for a new custom portlet. The resource permission for the portlet. You can combine multiple resource permissions 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} This attribute is mandatory for a new custom portlet. This flag indicates whether the portlet must be displayed in the UI. If you set the value to false, the portlet is not displayed in the UI, regardless of whether the user has the resource permission to the portlet. Pass the value to override the corresponding value of a default portlet.
portletColor {string} This is an optional attribute that is used only in the mini portlet panel. The portlet color code (hex value) is added as a variable in the portlet component SCSS file and used directly in HTML.
Note: The color is provided in the portlet component HTML and .scss files.
iconFontFamily This is an optional attribute. Indicates the font-family of the custom fonts for the mini portlet icons.
displayPortletTitleName {boolean} This is an optional attribute. If the portlet component handles the display of the portlet title, you must set the value of this property to true. Otherwise, the portlet title value that is defined in the portletTitleBundleKey property is displayed in the portlet.
miniPortletCountProvider {string} This is an optional attribute. This property defines the method name to invoke in MiniPortletDataService. This method gets the count value from an API, which is then displayed on the badges in the mini portlet panel.
Note: The miniPortletCountProvideris deprecated, and cannot be used for customization.
miniPortletCountConfig {JSON} This is mandatory for displaying count badges for custom mini portlets. This is the JSON configuration with the following supported attributes:
  • mashupIDForMiniPortletCount - The mashup ID that returns the badge count value.
  • miniPortletCountpath - The xpath that needs to be considered to retrieve the badge count value.
portletIconClass This is an optional attribute. Enter the name of the CSS class that is used to display the icon of the portlet in a mini portlet panel.
Note: This property is used only in a mini portlet panel.
showOnlyMiniPortlets {boolean} This is an optional attribute. Indicates whether only mini portlets need to be displayed in the Home page.
numberOfMiniPortletsPerRow {number} This is an optional attribute. Specifies the number of mini portlets that must be displayed in one row.
callShowPortletMashup {boolean} This is an optional attribute. To determine whether to show or hide portlets during the runtime, use the callShowPortletMashup attribute. If both showPortlet and callShowPortletMashup attribute values are set to true, the application makes a mashup call with the isf.common.getHiddenPortletList mashup ID to determine the portlets to be hidden.