CentraSite 10.5 | CentraSite Developer's Guide | Customizing CentraSite | Customization of CentraSite Business UI | Customizing CentraSite Content Page | Adding Portlets | Enable Portlet through Configuration
 
Enable Portlet through Configuration
After you define a custom portlet as an extension, you have to enable the custom portlet configuration so as to display the portlet in the CentraSite Business UI.
Important:
The portlet configuration parameters initially defined in the configuration file are editable and cannot be protected.
*To enable a portlet through configuration
1. Open the customization file, centrasite.xml, in a rich text editor.
You can find the centrasite.xml file on <CentraSiteInstall_Directory>\cast\cswebapps\BusinessUI\custom\conf.
2. Locate the Portlet Configuration under BUI Configuration.
This is a sample configuration snippet.
<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="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>
...
</Portlets>
3. Append the required custom portlet (for example, My Custom Portlet) configuration statement.
<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 want 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 <CentraSiteInstall_Directory>\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, it automatically updates the GUI configuration in the repository.
Important:
To define a portlet of type custom, ensure 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 or 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 or hide the portlet directly from the Welcome page.
Possible values: true (default value) – show the portlet or false – hide the portlet.
refresh
Interval
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, ensure that you do not specify any of the inherited actions (for example, Expand, Collapse, and Close) explicitly.
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="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="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>
4. Define the actions that you want to render in the portlet's settings.
<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.
5. Define the parameters that you want to display in the portlet.
<PortletParameters>
<PortletParameter
id="MyFavoritesPortletParam" ref="MyFavoritesPortlet"
params="noOfAssets#VSEP#10#PSEP#assetTypeKeys#VSEP#
uddi:cd906138-59f5-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 (that is, 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.
6. 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:
<Colors>
<Color id="#233356">OceanBlue</Color>
<Color id="#038299">LagunaBlue</Color>
</Colors>
The <Colors> list must 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 or letters correlates to the RGB value. For example, ,#233356 translates into OceanBlue.
7. 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.
8. Save and close the configuration file.
9. 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 (for example, INMBU_LBL_PORTLET_PENDING_APPROVALS) must begin with a INMBU label. The portlet internally identifies 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 displays a plain text name.