SAS 9.1.3 Integration Technologies » SAS Web Infrastructure Kit: Developer's Guide


Developing Custom Portlets
Development Steps
Creating a Deployment Descriptor
Creating Display Resources Files
Developing the Presentation JSP Page
Creating Action Classes
Implementing Portlet Help
Creating a PAR File
Use Cases
Simple Display Portlet
Localized Portlet
Portlet Template (Editable Portlet)
Remote Portlet
Tips and Best Practices
Using the Portlet API
Sample Portlets
Localized Display Portlet (Welcome)
Interactive Form Portlet (FormExample)
Portlet Template, or Editable Portlet (DisplayURL)
Web Application (HelloUserWikExample)
Remote Portlet (HelloUserRemote
Portlet
Development Steps

Creating Display Resources Files

A display resources file is a file that contains <key>=<value> statements to define text strings for a portlet's title and description. You can create display resources files for the following purposes:

  • To specify a description for your portlet. If you do not provide a display resources file, the portal Web application will use the portlet's name to create a default description.

    Note: The local-portlet and remote-portlet elements of the portlet deployment descriptor contain a description attribute. However, this description is only for internal documentation purposes. It is not displayed to users.

  • To enable the portal Web application to localize the portlet title and description at the time of deployment, according to the portal Web application's default locale. When the portlet is first deployed, the deployment process checks to see which default locale was specified when the SAS Web Infrastructure Kit was installed. Based on this locale, the deployment process uses the title and description from the appropriate display resources file to create metadata and register the portlet in the SAS Metadata Repository.

    If your portlet will be deployed in only one locale, then the display resources files can be omitted.

    Note: The SAS Metadata Repository cannot store multiple, localized values for metadata. Therefore, the portlet title and description are translated only into the portal Web application's default locale. They cannot be translated based on the user's locale preference.

If your portlet does not include any display resources files, the portlet deployment mechanism will send a warning message to the server log. The message will indicate that no localized title or description can be found.

To create display resources files:

  1. Create a separate file for each language (or each country and language combination) that you need to support. In each file, use <key>=<value> statements to define text strings for portlet.title and portlet.description, as in the following examples:

    portlet.title=Welcome Portlet
    portlet.description=Welcome Portlet
    
    portlet.title=Portlet de bienvenida
    portlet.description=Portlet de bienvenida
            
  2. Name the files as follows:

    • Use the base name portletDisplayResources.properties.

    • If you are creating files for multiple locales, append each file's name with the appropriate locale identifier (for example, portletDisplayResources_en_US.properties for U.S. English, portletDisplayResources_fr_CA.properties for Canadian French, etc.). The file for the default locale does not need to have a locale identifier.

  3. Place the files in the /portletname/classes directory of the PAR file.