Release 1.x‎ > ‎Development‎ > ‎NetBeans‎ > ‎

App Portlets

The Apps-Portlets package is a Project OpenPTK solution that delivers a set of JSR-168 Portlets for performing user provisioning operations. The portlets include: Forgotten Password, Self Service and User Administration.

New Project


  1. From the File menu, select New Project
  2. From the Categories Pane, select "Web"
  3. From the Projects Pane, select "Web Application with Existing Source"
  4. Click the "Next >" button

Add Existing Sources


  1. Select the Folder that contains the Web Application source files.
  2. Click the Browse button to the right of the Location: field
  3. From the browse panel, locate the web folder that's under the Apps/Portlets folder,found in ${PTK_HOME} folder.
  4. Select the web folder and click open
  5. Set the Project Name to Apps-Portlets
  6. Set the Project Folder to be under ${NB_HOME}. Use the name Apps-Portlets /work/Software/netbeans/openptk/Apps-Portlets
  7. Select the deployment server. This document uses Glassfish v1.
  8. Set Context Path to /OpenPTK-Portlets
  9. Select Next >

Existing Source and Libraries

We need to add the Java source packages:
Select the "Add Folder" Button for Source Package Folders.
From the browse panel, locate the src folder that's under the Apps/Portlets folder. These folder are found in the ${PTK_HOME} folder.
Select the src folder and click open
Click the Finish button

Verify New Project

After the Web Application has been created, verify it's components. Select the Projects tab and the Files tab. Explore tabs to verify the components.
See the images below:

Resolve Dependancies

Configure this Project to use the following:

  • OpenPTK Projects:
    • OpenPTK-Framework
    • OpenPTK-Service-SPML
    • OpenPTK-Service-JNDI
    • OpenPTK-Service-JDBC
    • OpenPTK-Consumer-Taglib
  • Third-party JAR files
  • OpenPTK Configuration files

  1. Select the Apps-Portlets Project from the Projects panel.
  2. From the File menu, select the menu item Apps-Portlets Properties
  3. Configure the Project so that it can be compiled, It will be configured for packaging in the next step.
    From the Categories pane, Select the Libraries item
    1. From the Compile-Time Libraries section, click the "Add Project ..." button.
      1. Using the Add Project panel, locate the NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
      2. Add the following Project: OpenPTK-Framework
      3. Make sure the Package check-box is selected
    2. From the Compile-Time Libraries: section, click the "Add JAR/Folder" button.
      NOTE: This JAR file will NOT be packaged with the created WAR file. This JAR file is only needed to support compiling of the application.
      1. Using the Add File/Folder panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
      2. Add the following JAR files: portlet-api-1.0.jar
      3. Make sure that the Package check-box is NOT SELECTED
  4. Configure the Project for packaging.
    From the Categories pane, Select the Build -> Packaging item
    1. From the WAR Content: pane, click the "Add Project ..." button.
      1. Using the Add Project panel, locate the NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
      2. Add the following Projects:
        • OpenPTK-Service-SPML
        • OpenPTK-Service-JNDI
        • OpenPTK-Service-JDBC
        • OpenPTK-Consumer-Taglib
      3. Set the Path in WAR value to: /WEB-INF/lib
    2. From the WAR Content: pane, click the "Add File/Folder ..." button.
      1. Using the Add File/Folder panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
      2. Add the following JAR files:
        • openspml.jar
        • soap.jar
        • activation.jar
        • mail.jar
        • ldapbp.jar
        • jstl.jar
        • standard.jar
        • mysqljdbc.jar
          Note: If deploying to a J2EE container, activation.jar and mail.jar are not needed.
      3. Set the Path in WAR value to: /WEB-INF/lib
    3. From the WAR Content: pane, click the "Add File/Folder ..." button.
      1. Using the "Add File/Folder" panel, locate the OpenPTK configuration files that need to be included. These are in ${PTK_HOME}/projects/OpenPTK.
      2. Add the following files: openptk.xml and openptk.xsd
      3. Set the Path in WAR value to: /WEB-INF/classes
  5. Click the OK button on the Project Properties panel.

Clean and Build

You can now build the project. Select the Apps-Portlets Project from the Projects panel. Right-click on the selected project and select Clean and Build. The Project should build successfully. A WAR file will be created in the dist directory called Apps-Portlets.war

Deploying and Running

If you are connected to the Internet, you can test the sample taglib JSPs. The default configuration for Project OpenPTK is setup to access a user repository (via SPML) hosted on http://sample.openptk.org
The WAR file needs to be deployed to a JSR-168 compliant Portal Server. This project has been tested with the open source JetSpeed 2.1.x portal server and the Sun Portal Server 7.1
Here are the Portlets running in JetSpeed:

Forgotten Password

Self Service

Change My Password

Change My Info

User Administration

Find a User

Create a User

Search Results

Edit User