The Eclipse Portal Pack provides a set of plug-ins that help you to develop JSR 168/286 Portlets and deploy them on supported portlet containers.
There are three plug-ins available in the Eclipse Portal Pack.
JSR 168/286 Portlet Builder — This plug-in allows you to create a JSR 168/286 portlet project using the wizards available in the Eclipse IDE. Once you create a portlet project using the wizards, the Eclipse Portal Pack plug-in creates the appropriate class files and updates the portlet.xml file. In addition, the plug-in provides a build.xml file that allows you to build a WAR, which you can deploy on any portal.
Sun GlassFish Web Space Server — This plug-in registers the Sun GlassFish Web Space Server that runs on GlassFish server in Eclipse IDE, as a Server Runtime. Currently, the Sun GlassFish Web Space Server plug-in allows you to start and stop the Sun GlassFish Web Space Server (GlassFish server) from within the IDE using the generic server framework in Eclipse.
OpenPortal Portlet Container — This plug-in registers the OpenPortal Portlet Container 2.0 that runs on GlassFish server in Eclipse IDE, as a Server Runtime. Currently, the OpenPortal Portlet Container plug-in allows you to start and stop the Portlet Container (GlassFish server) from within the IDE using the generic server framework in Eclipse.
You need to install the Eclipse Portal Pack to use the plug-ins and develop and deploy portlets.
Download Eclipse Portal Pack from the Eclipse Portal Pack download page.
Unzip the Eclipse Portal Pack.
Copy the .jar files to the ECLIPSE_HOME\plugins directory.
(Optional) — Restart Eclipse, only if it is running while you copy the .jar files.
This section explains how to use the Eclipse Portal Pack and the plug-ins in the Sun GlassFish Web Space Server. You need to perform the following tasks before using the Eclipse Portal Pack.
Creating Runtime and Server for the Sun GlassFish Web Space Server.
Creating a Runtime and Server for OpenPortal Portlet Container 2.0
You need to create a runtime and server for Eclipse Portal Pack in order to deploy it on the Sun GlassFish Web Space Server.
On Eclipse IDE, click the Window menu and select Preferences.
The Preferences window appears.
From the left pane, click Installed Runtimes.
The Installed Server Runtime Environments appear on the right pane.
Click Add.
The New Server Runtime window appears. In this window, you can choose the runtime environment for a newly installed server.
From the available runtime types, expand Sun Microsystems Inc and select Sun GlassFish Web Space Server. Select the Also create new local server check box.
Click Next.
Enter the JRE name, GlassFish Home directory, and the Domain Name information for Sun GlassFish Web Space Server.
These details are useful to create a runtime for Sun GlassFish Web Space Server.
Click Next.
Enter the server address, server port, and the debug port information for Sun GlassFish Web Space Server.
Click Finish.
The Sun GlassFish Web Space Server server is created.
You need to create a runtime and server for Eclipse Portal Pack in order to deploy it on OpenPortal Portlet Container 2.0.
On Eclipse IDE, click the Window menu and select Preferences.
The Preferences window appears.
From the left pane, click Installed Runtimes.
The Installed Server Runtime Environments appear on the right pane.
Click Add.
The New Server Runtime window appears. In this window, you can choose the runtime environment for a newly installed server.
From the available runtime types, expand Sun Microsystems Inc and select OpenPortal Portlet Container 2.0. Select the Also create new local server check box.
Click Next.
Enter the JRE name, GlassFish Home directory, and the Domain Name information for OpenPortal Portlet Container 2.0.
These details are useful to create a runtime for OpenPortal Portlet Container 2.0.
Click Next.
Enter the server address, server port, and the debug port information for OpenPortal Portlet Container 2.0.
Click Finish.
The OpenPortal Portlet Container 2.0 server is created.
You can use the plug-ins in Eclipse Portal Pack to create and deploy portlets on Sun GlassFish Web Space Server. This section explains how to create and deploy portlets on Sun GlassFish Web Space Server using the Eclipse Portal Pack plug-ins.
On Eclipse IDE, click the File menu and select New. Form New, choose Dynamic Web Project.
The New Dynamic Web Project window appears.
In the New Dynamic Web Project window, enter a name for your project, choose Sun GlassFish Web Space Server or OpenPortal Portlet Container 2.0 as project runtime, and select Portlet 1.0 or 2.0 support as the configuration.
If Portlet 2.0 configuration is not available in the list, you need to manually add the configuration. To do this, click Modify, select Portal Pack and click Save.
Click Finish.
A new web project is created.
To add a portlet to the web project, click the File menu. From the options, select New and click Other.
The New window to create a Java portlet appears.
From the list of Wizards, expand the Portlet wizard and click Java Portlet.
Click Next.
The Create a Portlet Class window appears.
Enter the details of the portlet that you want to generate.
Click Finish.
A portlet class is created and an entry about the portlet is created in the portlet.xml file.
To deploy the portlet, right click on the name of the portlet, select Run As, and click Run On Server. Accept the default values.
This action deploys the portlet web application and starts the target server, which is either Sun GlassFish Web Space Server or OpenPortal Portlet Container.