Creating Faces portlet projects

A default Faces portlet will be added in the process of creating the project. The wizard automatically generates the related portlet configuration files, the directory structure that is required, and the necessary updates to the web.xml file.

  1. Select File > New > Project. In the New Project wizard, expand the Portal folder and select Portlet Project. Click Next. The New Portlet Project wizard opens.

  2. Provide values, as appropriate, for the following fields:

    Project name

    Name for the new portlet project.

    Project contents

    The location in the file system where the project will be created. Accept the default workspace, or change the file system location by using Browse.

    Target runtime

    Select the appropriate server version for your portlet project.

    Add module to an EAR project

    Select this check box if you intend to deploy the portlet.

    EAR project

    Name of an enterprise application project (EAR project) that the portlet project should be associated with for purposes of deployment. The information used to deploy the portlet project to WebSphere® Portal in the test environment will be added in this project. All portlet applications associated with a single EAR project will run on a single session at the test environment. You may separate portlet applications into multiple EAR projects. You should use the same EAR project for other projects that are related.

    Portlet API

    Select JSR 168 portlet, JSR 286 portlet, or IBM® portlet as the Portlet API.

    Create a portlet

    To create a portlet for this project, check the box. If this box is not checked you can not create a Faces portlet project. New portlets can be added to a project after it is created. Specify the name for the portlet and its type as Faces portlet.

    Show advanced options

    Check this box to access facet and runtime options within this wizard.

    If you want accept the defaults associated with the portlet project, click Next and then Finish. If you prefer to customize the project options, click Next and continue through the wizard.

  3. In the Portlet Settings page, define the following:

    Content types and modes

    Specify the content type and its modes.

    • The HTML markup, which must be supported by all portlet application, is always generated by the wizard.

    • For projects targeting WebSphere Portal, the wizard will generate a portlet project using an IBM extension: wps.markup, which will allow the portlet further markup distinctions that extend beyond the pure MIME type. For more information about this IBM extension, refer to Developing portlets using JSR 168 and WebSphere Portal V5.02.

    • The view mode is always selected.

    Code generation options

    Check the "Generate a custom portlet class" box if you intend to create a portlet class that performs custom handling of actions or rendering.

    • Package prefix - defaults to a combination of the default package naming preference plus the project name.

    • Class prefix - defaults to a combination of the portlet-name suffixed by "Portlet".

    • Super class - a base class for the portlet class being generated

    Locale specific information

    Choose the default, or click Add to create a new locale.
    Click Next.

    Note: If you are creating an Empty portlet project, your only option is to click Finish. The wizard will create an empty project container primed with the appropriate folder structure, along with a deployment descriptor. To complete the portlet application, you need to customize the new empty portlet project. See Customizing empty JSR portlet projects.

  4. Click Next.

  5. You can add sample code to support credential vault handling, business process integration, and cache key helper, in the Single Sign-On page. This allows users and administrators to safely store credentials for authentication.

    Add credential vault handling

    Select this option to support credential vault handling. WebSphere Portal supports the use of a credential vault where users and administrators can safely store credentials for authentication. For more information on the credential vault handling, refer to "Portlet authentication" in the WebSphere Portal Information Center. Portlets written to extract the user's credentials from the vault can hide the login challenge from the user. Select one of the following types of vault slots.

    Use portlet private credential vault slot

    A portlet private slot stores user credentials that are not shared among portlets.

    Use shared credential vault slot

    A shared slot stores user credentials that are shared among the user's portlets.

    Use administrative credential vault slot

    An administrative slot allows each user to store their confidential information for accessing administrator-defined resources (for example, Lotus Notes®).

    Use system credential vault slot

    A system slot stores system credentials where the actual confidential information is shared among all users and portlets. System credentials are stored by the administrator. Portlets can only retrieve the credentials from the system slot.

    Slot name

    Defines the name of the credential vault slot to store and retrieve user credentials.

    Show password

    Select this option to show the password on the screen in the view mode.

    Enable business process integration

    Add task processing

    Select this option to enable the portlet to initiate a new business process task.

    Add process initiation

    Select this option to enable the portlet to initiate a new business process

    Add cache key helper

    Select this option to enable the portlet to initiate a new cache key helper.
    Click Next.

  6. Click Finish to create the new portlet project.

 

Related concepts

JavaServer Faces portlet applications

Markup languages

Creating Faces portlets and projects

 

Related tasks

Inserting images in portlet JSP files

 

Related reference

Using Session