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: Remote Portlet (HelloUserRemotePortlet)

Step 2: Create the Portlet Deployment Descriptor

The portlet deployment descriptor is an XML file that provides all of the information that the portal Web application needs to deploy one or more portlets. Here is the portlet deployment descriptor for the HelloUserRemotePortlet. The boxes contain explanatory comments. For more information, see Creating a Portlet Deployment Descriptor.


<?xml version="1.0" encoding="UTF-8"?>

The DOCTYPE statement must be present in the descriptor file in order for the portlet to run. However, the document type definition (DTD) does not need to be accessible at the URL that the statement specifies.

If you want to look at the portlet.dtd file, you can find it in the portal setup directory in the path Portal\WEB-INF. For example, if you used the default installation location on a Windows system, then the DTD is located under the following path: c:\Program Files\SAS\Web\Portal2.0.1\Portal\WEB-INF.

<!DOCTYPE portlets SYSTEM "http://www.sas.com/idp/portlet.dtd">

<portlets>

The remote-portlet element assigns the name HelloUserRemotePortlet to the portlet. 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.

The "true" setting for the passContextId attribute makes the portal Web application session information, including user identity, available to the remote portlet.

  <remote-portlet name="HelloUserRemotePortlet"
    title="HelloUserRemotePortlet" passContextId="true">
    <localized-resources locales="en" />
    <deployment scope="user" autoDeploy="true" 
      userCanCreateMore="false" />
    <portlet-path>/sas/portlets/remote</portlet-path>
    <portlet-actions>

The URL for the remote portlet's Web application, called HelloUserWikExample, is specified in the url subelement of the portlet-action element. This subelement must contain a fully qualified URL, including a fully qualified host domain name.

For details about the Web application, see Sample Web Application (HelloUserWikExample).

      <portlet-action name="display" default="true">
        <url>
        http://d9999.mycompany.com:8080/HelloUserWikExample/jsp/app.jsp
        </url>
      </portlet-action>
    </portlet-actions>
  </remote-portlet>
</portlets>