Jetspeed /Eclipse Portlet Plugin Specification
- Introduction
-
Wizards
- Getting Started: Creating a New Portlet Application Project
-
Portlet Application Wizard
- Templates
- Project Dependencies
- First Portlet Application Wizard Page: Eclipse Project Information
- Second Portlet Application Wizard Page: Portlet Application Fields
- Third Portlet Application Wizard Page: User Attributes
- Fourth Portlet Application Wizard Page: Custom Portlet Modes
- Fifth Portlet Application Wizard Page: Custom Window States
- Sixth Portlet Application Wizard Page: Security Constraints
- Portlet Wizard
- Toolbars
- Context menus
- App Server Definition
Jetspeed/Eclipse Portlet Plug-in
Specification
Date: 2004/07/06
Revision: 1.0
Table of Contents
List of Tables
List of Figures
Introduction
Design Goals
The Portlet Eclipse Plug-in has the following goals:
- Automate creation and maintenance of Jetspeed Portlet Applications in the Eclipse IDE. The dependencies of a Java Standard Portlet Application are automatically added to the Eclipse project.
- Abstract the end user from editing the Portlet XML descriptor by providing wizards for creating a Portlet XML descriptor.
- Automatic validation of Portlet XML descriptor
- Provide base Portlet application frameworks: Struts, JSP, JSF ... The dependencies of these frameworks are included into the project when creating a new portlet application project.
- Auto deploy and redeploy the portlet application to an application server
- Create a J2-Plugin compatible Maven project from the Eclipse project.
Wizards
To create portlet applications and portlets, several wizards are provided. The goal of the wizards is to create and maintain the portlet.xml, web.xml and jetspeed-portlet.xml files for a portlet application.
Getting Started: Creating a New Portlet Application Project
To create a new portlet application project, the user selects File->New->Project from the main Eclipse menu, bringing up the Eclispe New Project Wizard. Notice that once the Jetspeed Eclipse Plugin is installed, a new menu option is available:

The user selects “Portlet Application” found under the Java category, pressing Next to invoke the New Portlet Application Wizard.
Portlet Application Wizard
The Java Portlet Application Wizard creates a new Eclipse project specifically for creating Java Standard Portlet Applications.
The Portlet Application Wizard defines the portlet descriptor for a portlet application.
The Portlet Application Wizard can be invoked on an existing project to change the settings of the project. See the sections below Toolbars and Context Menus.
Templates
The plugin will originally support just one template with the layout of a typical Maven project. The Jetspeed-2 plugin should be used to create this directory layout with a Maven project template:

The default template includes these files:
maven.xml
project.xml
project.properties
webapp/WEB-INF/portlet.xml
webapp/WEB-INF/web.xml
webapp/WEB-INF/jetspeed-portlet.xml
webapp/WEB-INF/portlet.tld
If using the JSP framework, create this directory:
webapp/WEB-INF/view/
Project Dependencies
The project.xml needs to have the minimal dependencies for a Jetspeed-2 Plugin project. If any frameworks are selected, their dependencies will also need to be added to the project.
The Jetspeed-2 Maven Plugin should be used to create the project layout.
First Portlet Application Wizard Page: Eclipse Project Information
Extend the Java Application Eclipse plugin:

Second Portlet Application Wizard Page: Portlet Application Fields
The second Portlet Application wizard page is called “Portlet Application Information” and will display the following fields:
Table1
| Field | Description |
| Application ID | The Portlet Application ID |
| Portlet App WAR Name | The name of the portlet application's WAR file |
| Meta Title ¹ | Implementation Title, goes into the META-INF/MANIFEST.MF |
| Meta Version ¹ | Implementation Version, goes into the META-INF/MANIFEST.MF |
| Meta Vendor ¹ | Implementation Vendor, goes into the META-INF/MANIFEST.MF |
| Description ¹, ² | Portlet Application description written out to web.xml <description> tag |
| Display Name ¹, ² | Portlet Application Display Name written out to web.xml <display-name> tag |
¹ Optional, ² Written out to web.xml
DISCUSS: we could spec out the entire Maven project.xml here...
Third Portlet Application Wizard Page: User Attributes
The third Portlet Application wizard page is called “User Attributes” and will display a list of the following fields:
Table2
| Field | Description |
| Name | The name of the user attribute |
| Description ¹, ³ | The description of the user attribute. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
¹ Optional, ³ Multi-lingual Support Required
Zero or more sets of user attributes may be defined. This can be accomplished with a list box, edit field, and insert and remove buttons.
Fourth Portlet Application Wizard Page: Custom Portlet Modes
The fourth Portlet Application wizard page is called “Custom Portlet Modes” and will display the following fields:
Table7
| Field | Description |
| Portlet Mode | The name of the custom portlet mode |
| Description ¹, ³ | The description of the custom portlet mode. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
¹ Optional, ³ Multi-lingual Support Required
Zero or more sets of custom modes may be defined. This can be accomplished with a list box, edit field, and insert and remove buttons.
Fifth Portlet Application Wizard Page: Custom Window States
The fifth Portlet Application wizard page is called “Custom Window States” and will display the following fields:
Table8
| Field | Description |
| Window State | The name of the custom window state |
| Description ¹, ³ | The description of the custom window state. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
¹ Optional, ³ Multi-lingual Support Required
Zero or more sets of custom window states may be defined. This can be accomplished with a list box, edit field, and insert and remove buttons.
Sixth Portlet Application Wizard Page: Security Constraints
The sixth Portlet Application wizard page is called “Security Constraints” and will display the following fields:
Table14
| Field | Description |
| Display Name ¹, ³ | The display name of the security constraint. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
| Portlet Collection | Required. A collection of one or more portlet names. The portlet names should be validated against valid portlet names in the portlet application. |
| User Data Constraint ¹ | The description of the custom window state. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
| User Data Constraint – Transport Guarantee | Automatically fill in this field with “transport-guarantee” |
¹ Optional, ³ Multi-lingual Support Required
Security Constraints are optional. Zero or more pairs of (DisplayName, PortletCollection, UserDataConstaint) may be entered.
Portlet Wizard
When creating a new portlet application, the Portlet Wizard is displayed after the Portlet Application Wizard completes. It can be optionally skipped, and the user can choose to create portlets at a later time from the context menus or toolbar.
The Portlet Wizard has a series of wizard pages to define a portlet. If the wizard is invoked from the New Portlet Application sequence, it will repeatedly ask for new portlet definitions until the user is done defining all portlets for the portlet application.
The Portlet Wizard can be invoked on an existing portlet to change the settings of the project, or it can be invoked to create a new portlet. See the sections below Toolbars and Context Menus.
First Portlet Wizard Page: Portlet Definition
The first Portlet wizard page is called “Portlet Definition” and will display the following fields:
Table3
| Field | Description |
| Portlet Name | The name of the portlet |
| Description ¹, ³ | The description of the portlet. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
| Display Name ¹, ³ | The display name of the portlet. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
| Supported Locales ¹ | List of supported locales. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...). |
| Expiration cache ¹ | Duration before portlet content expires in seconds |
| Use Resource Bundle | Boolean – if checked, adds a “Resource Bundle” wizard page. If not checked (default), allows entering of Portlet Information (3 fields directly below). This field is transient and calculated. |
| Resource Bundle | A filename for the resource bundle. Only enable this field if “Use Resource Bundle” is checked. |
| Portlet Info - Title | The title of the portlet. Only enable this field if “Use Resource Bundle” is not checked. A part of the Portlet Info entry group. |
| Portlet Info - Short Title | Short Title of the portlet. Only enable this field if “Use Resource Bundle” is not checked. A part of the Portlet Info entry group. |
| Portlet Info - Keywords | Comma-separated list of keywords. Only enable this field if “Use Resource Bundle” is not checked. A part of the Portlet Info entry group. |
| Framework | JSP / Struts / none (add more as supported) |
| Portlet Classname | Optional if a Framework is selected, otherwise required |
Second Portlet Wizard Page: Init Parameters
The second Portlet wizard page is called “Init Parameters” and will display the following fields:
Table9
| Field | Description |
| Name | Required. The name of the Init Parameter. |
| Value | Required. The value of the Init Parameter. |
| Description ¹, ³ | The description of the init parameter. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
Init Parameters are optional. Zero or more pairs of (Name,Value,Description) may be entered.
Third Portlet Wizard Page: Supports
The third Portlet wizard page is called “Supports” and will display the following fields:
Table10
| Field | Description |
| Mime Type | Required. A mime type that this portlet supports. Validate against valid Mime Types i.e. “text/html” etc. |
| Portlet Mode | One or more portlet modes must be entered. The modes should be validated against default and extended portlet modes. |
At least one Supports set is required. One or more pairs of (Mime Type, Portlet Modes) may be entered.
Fourth Portlet Wizard Page: Preferences
The fourth Portlet wizard page is called “Preferences” and will display the following fields:
Table11
| Field | Description |
| Name | Required. The name of a single preference. |
| Values ¹ | Required. The values for this single preference. 0..n preferences maybe entrered and associated with a single name. |
| Read-only | Boolean, defaults to false. |
Preferences are optional. Zero or more pairs of (Name,Value,Read-only) may be entered.
Optional Preferences Validator Field:
Table12
| Field | Description |
| Validator Class ¹ | The fully qualified classname of the Preference Validator class that implements the PreferencesValidator interface. |
Fifth Portlet Application Wizard Page: Security Role Refs
The fifth Portlet wizard page is called “Security Ref Roles” and will display the following fields:
Table13
| Field | Description |
| Role-name | Required. The name of the role as known to this portlet. |
| Role-link | Required. The name of role in the application server linked the Role-name. |
| Description ¹, ³ | The description of the security role ref. Default to english language, allow for more languages to be added with 2 character language code (i.e. 'en', 'fr', 'es'...) |
Security Role Refs are optional. Zero or more pairs of (Role-name,Role-link,Description) may be entered.
Toolbars
The Jetspeed Plugin can optionally add a toolbar to Eclipse on installation. The toolbar is a shortcut to the wizards:
Table4
| Tool | |
| New Project | Creates a new project |
| Deploy Project | Deploys a project to an app server |
| App Server | Defines an App Server |
| UnDeploy Project | Undeploys a project |
| New Portlet | Goes to the New Portlet Wizard |
| Edit Portlet | Goes to the Edit Portlet Wizard for the current open Java portlet. |
| Edit Portlet Application | Goes to the Edit Portlet Application Wizard. |
Icons will need to be created for each tool.
Context menus
Context menus options are added to the Eclipse context menus for Java Portlet classes and the Project.
Table5
| Menu | From |
| PA Settings | From Eclipse project goes to edit mode of PA Wizard |
| Portlet Settings | From Eclipse Java file, if it’s a portlet – goes to edit mode of Portlet Wizard for a specific portlet. |
App Server Definition
Enter fields for Application Server definition required for deployment.
Table6
| Field | |
| App Server Type | Catalina / Tomcat 5 / Jetty |
| Location | Root of server |


