HomeUsersDevelopersAPIsHow To
 

Jetspeed /Eclipse Portlet Plugin Specification

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:

Graphic1

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:

Graphic2

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:

Graphic3

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

FieldDescription
Application IDThe Portlet Application ID
Portlet App WAR NameThe 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

FieldDescription
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

FieldDescription
Portlet ModeThe 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

FieldDescription
Window StateThe 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

FieldDescription
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 GuaranteeAutomatically 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

FieldDescription
Portlet NameThe 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 BundleBoolean – 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 BundleA filename for the resource bundle. Only enable this field if “Use Resource Bundle” is checked.
Portlet Info - TitleThe 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 TitleShort 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 - KeywordsComma-separated list of keywords. Only enable this field if “Use Resource Bundle” is not checked. A part of the Portlet Info entry group.
FrameworkJSP / Struts / none (add more as supported)
Portlet ClassnameOptional 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

    FieldDescription
    NameRequired. The name of the Init Parameter.
    ValueRequired. 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

      FieldDescription
      Mime TypeRequired. A mime type that this portlet supports. Validate against valid Mime Types i.e. “text/html” etc.
      Portlet ModeOne 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

        FieldDescription
        NameRequired. 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-onlyBoolean, defaults to false.

          Preferences are optional. Zero or more pairs of (Name,Value,Read-only) may be entered.

          Optional Preferences Validator Field:

          Table12

          FieldDescription
          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

            FieldDescription
            Role-nameRequired. The name of the role as known to this portlet.
            Role-linkRequired. 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 ProjectCreates a new project
              Deploy ProjectDeploys a project to an app server
              App Server Defines an App Server
              UnDeploy ProjectUndeploys a project
              New PortletGoes to the New Portlet Wizard
              Edit Portlet Goes to the Edit Portlet Wizard for the current open Java portlet.
              Edit Portlet ApplicationGoes 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

              MenuFrom
              PA SettingsFrom 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 TypeCatalina / Tomcat 5 / Jetty
              LocationRoot of server