Enable Portlet through Configuration
After you define a custom portlet as an extension with the above steps, you need to enable the custom portlet configuration so as to display the portlet in the CentraSite Business UI. To enable a custom portlet configuration, follow these steps:
Important: | The portlet configuration parameters initially defined in the configuration file are editable and cannot be protected. |
1. Open the custom configuration file.
2. Locate the Portlet Configuration under BUI Configuration.
The configuration snippet looks like this:
<Portlets>
<Portlet id="MyFavoritesPortlet"
description="INMBU_STR_PORTLET_FAVORITES_DESC"
type="text"
dataFeed="MyFavorites"
icon="images/system/favorites_16X16.png"
row="0"
column="0"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_FAVORITES
</Portlet>
<Portlet id="TopXServicesBasedOnInvocationsPortlet"
description="INMBU_STR_PORTLET_TOPX_SERVICES_BASED_ON_INVOCATIONS"
type="text"
dataFeed="TopXServicesBasedOnInvocations"
icon="images/system/highest_invocation_16X16.png"
row="0"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_TOPX_SERVICES
</Portlet>
<Portlet id="RecentLifecycleChangesPortlet"
description="INMBU_STR_PORTLET_RECENT_LIFECYCLE_CHANGES_DESC"
type="text"
dataFeed="RecentLifecycleChanges"
icon="images/system/recent_lifecycle_changed_16X16.png"
row="0"
column="2"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_RECENT_LCM_CHANGES
</Portlet>
<Portlet id="LastCreatedAssetsPortlet"
description="INMBU_STR_PORTLET_RECENTLY_CREATED_ASSETS_DESC"
type="text"
dataFeed="LastCreatedAssets"
icon="images/system/recently_created_16X16.png"
row="1"
column="0"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_LAST_CREATED_ASSETS
</Portlet>
<Portlet id="MySavedSearchesPortlet"
description="INMBU_STR_PORTLET_SAVED_SEARCH_DESC"
type="text"
dataFeed="MySavedSearches"
icon="images/system/saved_searches_16X16.png"
row="1"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_SAVED_SEARCHES
</Portlet>
</Portlets>
3. Append the required custom portlet (for example, "My Custom Portlet") configuration statement as below:
<Portlet id="MyCustomPortlet"
description="INMBU_STR_PORTLET_CUSTOM_DESC"
type="text"
dataFeed="MyFavorites"
icon="images/system/custom_16X16.png"
row="1"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_CUSTOM_PORTLET
</Portlet>
wherein,
Parameter | Description |
id [Portlet] | A unique identifier for the portlet. It uniquely distinguishes a portlet in the CentraSite registry. If you wish to reset the portlet at a later stage, you identify the portlet using this id. |
description | A comment or descriptive information about the portlet. |
type | The type of portlet. CentraSite Business UI supports the following portlet types: text iframe graphical custom |
dataFeed | Required for text/graphical type. Name of a saved search query that feeds in the data to the portlet. |
url | Required for iframe type. An arbitrary URL that points to any external HTML page. It renders the HTML content within an HTML IFRAME on the portlet. |
icon | An icon to display at the top left corner of the portlet header. The icon is specified as the path to an image file. Prerequisite: The icon must be in PNG format. To ensure proper alignment when it is displayed in the user interface, the icon must be 16 x 16 pixels in size. The icon must reside in the folder <CentraSiteInstallDir>\cast\cswebapps\BusinessUI\images\system. The path for the icon should be specified as images/system/icon.png |
row, column | The row and column number to place a portlet in the Welcome page. By default, the portlet is configured to start at level 0. Thus a setting of 0 (zero) refers to the first portlet in the Welcome page. For example, if you want to place a portlet in second row and fourth column, you will need to specify row=1 column=3. However, if at a later state, you attempt to drag and drop a portlet in the Welcome page, automatically updates the GUI configuration in the repository. Important: | To define a portlet of type custom, make sure that you have set the value of row=-1 column=-1 in order to dynamically place the custom portlet in your Welcome page. |
|
isVisible | To show/hide the portlet in the Welcome page when you log in to CentraSite Business UI for the first time after product installation. Once you have logged in, you can show/hide the portlet directly from the Welcome page. Possible values: true (default value) – show the portlet; false – hide the portlet. |
refreshInterval | The time interval (in seconds) to refresh your portlet content automatically. Note: | A value 0 is indicates that the portlet content will not be refreshed automatically. |
|
actions | Actions that you want to display in the portlet's configuration. By default, CentraSite supports the following actions: Configure Refresh Note: | You can specify a comma separated list of actions. |
Important: | When you define a custom action, make sure that you do not specify any of the inherited actions (Expand, Collapse and Close) explicitly. |
|
4. Now the Portlet Configuration section looks similar to this.
<Portlets>
<Portlet id="MyFavoritesPortlet"
description="INMBU_STR_PORTLET_FAVORITES_DESC"
type="text"
dataFeed="MyFavorites"
icon="images/system/favorites_16X16.png"
row="0"
column="0"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_FAVORITES
</Portlet>
<Portlet id="TopXServicesBasedOnInvocationsPortlet"
description="INMBU_STR_PORTLET_TOPX_SERVICES_BASED_ON_INVOCATIONS"
type="text"
dataFeed="TopXServicesBasedOnInvocations"
icon="images/system/highest_invocation_16X16.png"
row="0"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_TOPX_SERVICES
</Portlet>
<Portlet id="RecentLifecycleChangesPortlet"
description="INMBU_STR_PORTLET_RECENT_LIFECYCLE_CHANGES_DESC"
type="text"
dataFeed="RecentLifecycleChanges"
icon="images/system/recent_lifecycle_changed_16X16.png"
row="0"
column="2"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_RECENT_LCM_CHANGES
</Portlet>
<Portlet id="LastCreatedAssetsPortlet"
description="INMBU_STR_PORTLET_RECENTLY_CREATED_ASSETS_DESC"
type="text"
dataFeed="LastCreatedAssets"
icon="images/system/recently_created_16X16.png"
row="1"
column="0"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_LAST_CREATED_ASSETS
</Portlet>
<Portlet id="MySavedSearchesPortlet"
description="INMBU_STR_PORTLET_SAVED_SEARCH_DESC"
type="text"
dataFeed="MySavedSearches"
icon="images/system/saved_searches_16X16.png"
row="1"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_SAVED_SEARCHES
</Portlet>
<Portlet id="MyCustomPortlet"
description="INMBU_STR_PORTLET_CUSTOM_DESC"
type="text"
dataFeed="MyFavorites"
icon="images/system/custom_16X16.png"
row="1"
column="1"
isVisible="true"
refreshInterval="0"
actions="configure,refresh">
INMBU_STR_PORTLET_NAME_MY_CUSTOM_PORTLET
</Portlet>
</Portlets>
5. Define the actions that you want to render in the portlet's settings as described in the following property statements.
<PortletActions>
<PortletAction id="configure">
INMBU_STR_PORTLET_ACTION_EDIT
</PortletAction>
<PortletAction id="refresh">
INMBU_STR_PORTLET_ACTION_REFRESH
</PortletAction>
</PortletActions>
Parameter | Description |
id [PortletAction] | A unique identifier for the action. It uniquely distinguishes an action in the CentraSite registry. If you want to reset the action at a later stage, you identify the action using this id. |
6. Define the parameters that you wish to display in the portlet as described in the following property statements:
<PortletParameters>
<PortletParameter
id="MyFavoritesPortletParam" ref="MyFavoritesPortlet"
params="noOfAssets#VSEP#10#PSEP#assetTypeKeys#VSEP#uddi:cd906138-59
f5-4d7f-4f5f-6115adfa8d9c#ASEP#uddi:cd906138-59f5-4d7f-4f5f-6115adfa8e3d"
attributes="" />
</PortletParameters>
Parameter | Description |
id [PortletParameter] | A unique identifier for the parameter. It uniquely distinguishes the portlet's parameter in the CentraSite registry. If you want to reset the parameter at a later stage, you identify the parameter using this id. |
ref | The specified unique identifier for the portlet. |
params | Parameters that you want to display in the portlet's configuration. The parameter values determine which data displays in the portlet. When you define a parameter, keep the following points in mind: A value separator ( #VSEP#) is required between the parameter name and the value. Thus, for example, if you want to define a parameter noOfAssets with value 10, you can write the parameter name-value pair as noOfAssets#VSEP#10 A parameter separator ( #PSEP#) is required between the multiple parameters. Thus, for example, if you want to define two parameters, one parameter noOfAssets with value 10, and another parameter assetTypeKeys with value uddi:cd906138-59f5-4d7f-4f5f-6115adfa8d9c, you can write the above parameters as params="noOfAssetsToReturn#VSEP#10#PSEP#asset TypeKeys#VSEP#uddi:cd906138-59f5-4d7f-4f5f- 6115adfa8d9c" An array separator ( #ASEP#) is required between multiple values (i.e., an array of values). Thus, for example, if you want to assign a parameter assetTypeKeys with more than one value (uddi:cd906138-59f5-4d7f-4f5f-6115adfa8d9c, uddi:cd906138-59f5-4d7f-4f5f-6115adfa8e3d), you can write the parameter as assetTypeKeys#VSEP#uddi:cd906138-59f5-4d7f-4f5f- 6115adfa8d9c#ASEP#uddi:cd906138-59f5-4d7f-4f5f- 6115adfa8e3d |
attributes | List of attributes you wanted to display in the portlet's configuration. |
7. For a graphical chart configuration. If you have opted to show different colors in a graphical chart configuration, specify the colors for each bar, line or pie plot.
In this case, the line would look like this:
<Colors>
<Color id="#233356">OceanBlue</Color>
<Color id="#038299">LagunaBlue</Color>
</Colors>
The <Colors> list should have the colors specified in the HEX color code format. The HEX format is a hash (#) followed by 6 numbers or letters. The position of the numbers/letters correlates to the RGB value. For example, "#233356" translates into "OceanBlue".
8. Locate the following property statement and specify the required values:
<PortletConfigurations portletsPerRow="3" settingsPopupColumnCount="2"
helpToken="HELPCENTER_007" headerMaxCharacterLength="27">
Parameter | Description |
PortletsPerRow | The number of portlets to display per row in the Welcome page. |
settingsPopupColumnCount | The number of columns to display in the Configure Your Welcome Page dialog. |
helpUrl | The URL of the standard Help Center that's delivered with the CentraSite Business UI. |
headerMaxCharacterLength | The maximum content length of a portlet's header text. By default, the allowed header text length is 27 characters. If the character in the header text exceeds 27, the text gets automatically truncated. |
9. Save and close the configuration file.
10. Restart Software AG Runtime.
Portlet Display Names
The display name for a portlet or an action is the name that is displayed by the CentraSite Business UI. A portlet's or action's display name can either be a localized string fetched from the message database or a plain string.
If you want to specify a localized name, enter the message ID. The message ID (e.g., INMBU_LBL_PORTLET_PENDING_APPROVALS) must begin with a INMBU label. The portlet will internally identify the message ID, and display the localized name, if available in the message database. Else, if you specify a name without INMBU label, the portlet will simply display a plain text name.
For details on configuration of the portlets using the user interface, see
Working with Portlets.