Creating, adding, removing, or editing portlets
Creating a portlet
You can create a new portlet, add an existing portlet to the portlet deployment descriptor, or remove the selected portlet from the portlet deployment descriptor.
To create a new portlet, follow these steps:
- Open the portlet deployment descriptor editor by double-clicking on it in the Project Explorer view, or, by right-clicking on the Portlet Deployment Descriptor node and choosing
Open with | Portlet Deployment Descriptor. In the row of tabs, select Portlets.
- Click the
New button to open a wizard.
- Click Next
- Specify the portlet name. Click Next and then Finish to accept the default information from the existing portlet project.
Adding an existing portlet
To add an existing portlet, follow these steps:
- Click the
Add Portlet button to open a dialog.
- Select a class and package name of a portlet.
Configuring a portlet
You will need to specify the following values:
Table 1. Portlet class Property Name Description Portlet class The canonical name of the portlet selected in the Portlets list box. Select the Browse button to open the
Select Portlet dialog and create a new mapping in the deployment descriptor. Used in the <portlet-class> node.
Table 2. Localization of deployment descriptor values Property Name Description Language The locale information used in the xml:lang attribute to localize the Display name and the
Description. The default value for the xml:lang attribute is English (en). Used in the xml:lang attribute of <display-name> and <description> in <portlet>.
Display name An administrative name used to identify the portlet. It is only shown in GUI tools. Used in <display-name> in <portlet>. Description A descriptive text about the portlet. This text is not displayed to end users. Used in <description> in <portlet>.
Table 3. Language specific portlet information Property Name Description Resource Bundle To provide language specific portlet information, like title and keywords, resource bundles are used. Set the fully qualified class name of the resource bundle. Used in <resource-bundle>. Supported Locales Declare locales the portlet supports at runtime. Used in <supported-locale>, and to locate the resource bundle file for each locale. Portlet Info Specify the following portlet information for each supported locale. Select a supported locale above and specify the portlet information for the selected locale. The specified information will be saved in resource bundle files.
- Title
- The title that should be displayed in the title bar of this portlet. Only one title per locale is allowed. Note that this title may be overridden by the portal or programmatically by the portlet. Used in <title> in <portlet-info> for the default locale, and used in javax.portlet.title in the language specific resource bundle file for other locales.
- Short title
- A short version of the title that may be used for devices with limited display capabilities. Only one short title per locale is allowed. Used in <short-title> in <portlet-info> for the default locale and used in javax.portlet.short-title in the language specific resource bundle file for other locales.
- Keywords
- Keywords that describe the functionality of the portlet. Portals that allow users to search for portlets based on keywords may use these keywords. Multiple keywords per locale are allowed, but must be separated by a comma (,). Used in <keywords> in <portlet-info> for the default locale and used in javax.portlet.keywords in the language specific resource bundle file for other locales.
Removing a portlet
In the Portlet Deployment Descriptor, highlight the portlet you want to remove, then click
Remove.
Related tasks