Importing portlets

Create an empty portlet project before importing a portlet WAR file.

To import a portlet WAR file:

  1. Create an empty portlet project.
    1. Select File > New > Portlet project or File > New > Portlet project (JSR 168).
    2. Deselect the Create a portlet check box.
    3. Select a WebSphere® Portal version.
    4. Click Finish. If the Confirm Perspective Switch dialog appears, click Yes.
  2. Import a portlet WAR file to the portlet project you created in the step above.
    1. Select File > Import > WAR file. Click Next.
    2. Select a WAR file from the local file system using the Browse button.
    3. For the WAR project, select the portlet project you created above.
    4. Select the Overwrite existing resources without warning check box.
    5. Click Finish.
  3. If the WAR file includes exported sources files, move them from the source folder to the JavaSource folder.
    1. In the Project Explorer view, highlight the portlet project you created in the step above.
    2. Expand WebContent > WEB-INF > source
    3. Expand Java Resources > JavaSource
    1. Move the contents under the source folder to the JavaSource folder.
  4. Click Finish. If the Confirm Perspective Switch dialog appears, click Yes. A portlet project and an Enterprise Application (EAR) project are created, and the WAR file is imported.
The import will appear as a project in the Project Explorer view. To change the target server of an existing project,
  1. Right-click the project in the Project Explorer view.
  2. Select PropertiesServer.
  3. Change the Target runtime in the right pane. Click OK to save the change.

Tip:After importing a portlet WAR file that uses the JSR 168 portlet API, make sure that the portlet deployment descriptor (portlet.xml) has a unique value specified for the ID attribute on the <portlet-app> element. To check this, double-click on the Portlet Deployment Descriptor entry for your project in the Project Explorer view. When the Portlet Deployment Descriptor editor opens, go to the Source tab.

Related concepts
Creating portlets and portlet projects
Related tasks
Exporting and installing portlet projects
Importing portal sites
Migrating to the portal tools in Rational® Application Developer V6.0

(C) Copyright IBM Corporation 2002, 2005. All Rights Reserved.