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
Development Steps

Creating a PAR File for Deployment in the Portal

A portlet archive (PAR) file is an archive file that contains all of the files needed in order to deploy a portlet or a group of portlets into the portal Web application.

A PAR file can contain files for one portlet, or it can contain files for multiple related portlets. There is no limit to the number of portlets that a PAR file can contain. In addition, a PAR file can contain local portlets, remote portlets, or a combination of local and remote portlets.

To create a PAR file, use these steps:

  1. Create the directory structure for the portlet(s) on your local machine, and place the required files in the appropriate directory location.

  2. Use the JAR utility to compress the directories and files into an archive.

  3. Rename the archive with a unique name and the extension .par.

For information about how to deploy a PAR file into the portal Web application, refer to Adding Custom-Developed Portlets in the "Adding Content to the Portal" chapter in the SAS Intelligence Platform: Web Application Administration Guide.

PAR File Directory Structure

For correct deployment, you must organize the files in a PAR file using the following directory structure:

Directory Contents Notes
(root) Portlet deployment descriptor file
The name of the deployment descriptor file must be portlet.xml.
/portletname
None Include one portletname directory (and associated subdirectories) for each portlet that is defined in portlet.xml. The directory name must match the name of the portlet as specified in the name attribute of the <local-portlet> or <remote-portlet> element in portlet.xml.
/portletname/classes Portlet action classes, other custom classes that are used by the portlet, and display resources files that are used by the portlet. Replicate any package structure as subdirectories of /portletname/classes.

Portlet action classes (but not other classes) must be defined in the portlet deployment descriptor file (portlet.xml).

The display resources files must be in /portletname/classes.
/portletname/content Web resources used by the portlet, including JSPs, HTML files, CSS files, and images The directory name must be content. Each portlet can have only one content location directory; however, the content location directory can have an unlimited number of subdirectories.
/portletname/lib JAR files used by the portlet Place any custom JAR files that are used by the portlet in this directory.