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
Sample: Localized Display Portlet (Welcome Portlet)

Step 5: Create the Resource Bundles

The resource bundles provide translated text to be displayed inside the Welcome portlet. The portlet's WelcomeAction.class calls the NavigationUtil.prepareLocalizedResources() method to create a JSTL localization context based on the user's locale preference. This context enables the JSTL tags in Welcome.jsp to use the appropriate resource bundle to display the text. For more information about creating resource bundles, see Creating a Localized Portlet.

Note: For information about localizing the portlet's title and description, see Step 6: Create Translated Titles and Descriptions.

A number of resource bundles are provided with the Welcome portlet. The contents of three of the files (Resources.properties for U.S. English, Resources_de.properties for German, and Resources_es.properties for Spanish) follow.


#This is where you put key/value pairs for message strings that need to
#be localized.
##These are the messages for the Welcome portlet
#This is for the Public Kiosk Welcome portlet
welcome.msg1.txt=Welcome to Version 2 of the Information Delivery Portal.
welcome.msg2.txt=Please look around!

#This is where you put key/value pairs for message strings that need to
#be localized.
##These are the messages for the Welcome portlet
#This is for the Public Kiosk Welcome portlet
welcome.msg1.txt=Willkommen bei Information Delivery Portal Version 2.
welcome.msg2.txt=Schauen Sie sich um!

#This is where you put key/value pairs for message strings that need to
#be localized.
##These are the messages for the Welcome portlet
#This is for the Public Kiosk Welcome portlet
welcome.msg1.txt=Bienvenido a la versión 2 de Information Delivery 
  Portal.
welcome.msg2.txt=Puede continuar