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 Portlets

Sample: Portlet Template, or Editable Portlet (DisplayURL)

A portlet template, also referred to as an editable portlet, is a portlet from which users can create their own portlet instances. The portlet called DisplayURL (shown below), which is delivered with the portal Web application, is one example of a portlet template.

Sample URL display portlet before editing

Users can create new instances of this portlet by choosing Add a portlet on the Options menu and then choosing URL Display Portlet as the portlet type in the Create a New Portlet dialog box. The DisplayUrl portlet includes classes that enable the user to edit the new portlet instance to point to any URL which returns an HTML fragment. For example, the user could edit the portlet instance to point to a URL which returns an HTML fragment, as shown here:

Sample URL display portlet after editing

If you create a portlet template, the title of the portlet template will appear as a portlet type that users can create their own instances of. Action classes that you provide with the portlet template will then enable users to edit the portlet instances that they have created.

The following steps were used to create the DisplayURL portlet and the URL Display Portlet portlet type. Click on each step to display details.

  1. Create a directory structure for the portlet.

  2. Create the portlet deployment descriptor (portlet.xml).

  3. Create display pages for the portlet and the editor (FormExample.jsp).

  4. Create the action classes.

  5. Create the resource bundle.

  6. Create the display resources file.

  7. Create the PAR file, and deploy and test the portlet.