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: Portlet Template, or Editable Portlet (DisplayURL)

Step 1: Create the Directory Structure

The following directory structure was used to create the DisplayURL portlet:

Directory structure for DisplayUrl portlet

This structure includes this following directories and subdirectories:

Directory Contents
work (root)

This directory serves as a development area for the portlet.
Portlet deployment descriptor file portlet.xml

The name of the deployment descriptor file must be portlet.xml.
/DisplayURL
This is the main portlet directory. It does not contain any files. The directory name must not have any spaces, and it must match the name of the portlet as specified in the name attribute of the <local-portlet> element in portlet.xml.
/DisplayURL/classes This directory contains the display resources file file.
/DisplayURL/classes/com/SAS
   /portal/portlets/displayurl
This directory contains the resources.properties file and the following action classes:

BaseAction.class
CancelAction.class
DisplayAction.class
EditorAction.class
ErrorHandler.class
Initializer.class
OKAction.class
/DisplayURL/content This directory contains the display pages called Editor.jsp, Error.jsp, and Viewer.jsp.

Each portlet can have only one content location directory, and the directory name must be content. However, the content location directory can have an unlimited number of subdirectories.

The following rules apply when you set up the directory structure:

  • Neither portlet names nor their paths can contain spaces.

  • The portlet identifier (which consists of the name and the path) must be unique. Developers should devise a convention to ensure unique name-spaces, similar to the conventions used for naming Java packages.