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
Use Cases

Creating a Remote Portlet

A remote portlet is a portlet that calls a remote Web application. A remote Web application is an application that runs outside of the portal Web application.

To create a remote portlet, use the following steps:

  1. Create the Web application.
  2. Create a portlet deployment descriptor file.
  3. Create display resources files containing the portlet title and description.
  4. Create WAR and PAR files.

Step 1: Create the Web Application

The Web application for a remote portlet can be developed using any Web technology, and can be as simple as a single JSP page. Follow these guidelines when you create a remote Web application:

  • The remote application must be located outside of the portal Web application.

  • The remote application must have access to the portal Web application's context information, including session and user identity information, through the use of SAS Foundation Services (this is the only point at which remote portlets are coupled with the portal Web application).

  • The remote application must display an HTML fragment when a request is received from the portal Web application.

  • The remote application must rewrite URLs so that requests are routed through the portal Web application before they are passed to the remote portlet.

For an example of a JSP page for a remote portlet's Web application, see Sample: Web Application (HelloUserWikExample).


Step 2: Create a Portlet Deployment Descriptor File

To create a portlet deployment descriptor file for a remote portlet, use the following steps:

  1. In the <remote-portlet> element, do the following:

    1. Specify the portlet's name and title. The name cannot contain spaces. The portlet identifier, which consists of the portlet path (defined in the portlet-path element) together with the portlet name, must be unique within the portal Web application.

    2. Specify the value "true" for the passContextId attribute. This value makes the portal Web application's session information, including user identity, available to the remote portlet.

  2. Optionally, use the <keyword> element to specify key words for use in searching.

  3. Specify the URL for the remote portlet's Web application in the url subelement of the portlet-action element. This subelement must contain a fully qualified URL, and the URL must contain a fully qualified host domain name.

For more information, see Creating a Portlet Deployment Descriptor. For an example of a deployment descriptor for a remote portlet, see Sample: Remote Portlet (HelloUserRemotePortlet).


Step 3: Create Display Resources Files Containing the Portlet Title and Description

To specify the title and description for the portlet's metadata, create a portletDisplayResources.properties file. If you want the portlet title and description to be localized at the time of deployment according to the portal Web application's default locale, then create a separate portletDisplayResources.properties for each locale. For details, see Creating Display Resources Files.

Note: If you omit this step, the portal Web application will use the portlet's name to create a default description. In addition, the portlet deployment mechanism will send a warning message to the server log that no localized title or description can be found.


Step 4: Create the PAR File and WAR File

Use the JAR utility to place the portlet deployment descriptor into an archive. For information about the required directory structure, see Creating a PAR File for Deployment in the Portal.

You must also create a WAR file to use in deploying the remote portlet's Web application.