Release 2.x‎ > ‎Development‎ > ‎Netbeans‎ > ‎

2.0: Server Configuration

The OpenPTK-Server 2.0 is a the main install of a Project OpenPTK solution that delivers a RESTful service and web-based solution for performing user provisioning operations.

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

Name and Location


  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 source folder that's under the "projects/OpenPTK/Server/src/java" folder. These folder are found in the ${PTK_HOME} folder.
  4. Select the "java" folder and click "open"
  5. Set the Project Name to "OpenPTK-Server"
  6. Set the Project Folder to be under ${NB_HOME}. Use the name "OpenPTK-Server"
  7. Select "Next >"

Server and Settings


  1. Select the deployment server. This document uses Glassfish v3. You must have a configured web container.
  2. Set the Context Path to /openptk
    Click the "*Next *" button

Existing Sources and Libraries


  1. Select the Web Pages Folder that contains the Web application files.
  2. Click the "Browse" button to the right of the Web Pages Folder: field
  3. From the browse panel, locate the source folder that's under the "projects/OpenPTK/Server/web" folder. These folder are found in the ${PTK_HOME} folder.
  4. Select the "web" folder and click "open"
  5. Select the WEB-INF Content that contains the Web application class and properties files.
  6. Click the "Browse" button to the right of the WEB-INF Content: field
  7. From the browse panel, locate the source folder that's under the "projects/OpenPTK/Server/web/WEB-INF" folder. These folder are found in the ${PTK_HOME} folder.
  8. Select the "WEB-INF" folder and click "open"
    #Validate that the java source folder (added in step 2 above) is set properly.
    Click the "Finish" button

Configure / Validate dependent Libraries

The following Netbeans Libraries are used by this project. If they are not already available, create them. 
Project Library:

LDAP Bonus Pack
OpenSPML-1
OpenSPML-2
MYSQL-JDBC

Use the Tools -> Libraries menu option to manage the libraries.
These .jars are in ${PTK_HOME}/lib.

Configure New Project Properties

Select the "OpenPTK-Server" Project from the Projects panel.
After the Web Application has been created, verify it's components. Select the "Projects" tab. Select the OpenPTK-Server project, right-click and select Properties (or: From the "File" menu, select the menu item "OpenPTK-Server" Properties).

Configure this Project use the following properties:

Configure Libraries
  1. From the Categories pane, Select the Build -> Packaging item
  2. 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 Project:
      • OpenPTK-Framework
    3. Add the following Libraries:
      • Jersey 1.0 (JAX-RS RI)
      • JAX-RS 1.0
  3. Check the Package checkbox to the right of the *** Jersey 1.0 (JAX-RS RI) and JAX-RS 1.0 libraries
  4. Click the "OK" button on the Project Properties panel.
Build Packaging
  1. From the Categories pane, Select the Build -> Packaging item
  2. 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-Framework
      • OpenPTK-Service-SPML
      • OpenPTK-Service-JNDI
      • OpenPTK-Service-JDBC
    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 Library" panel, locate the libraries that need to be included.
    2. Add the following Libraries:
      • LDAP Bonus Pack
      • OpenSPML-1
      • OpenSPML-2
      • MYSQL-JDBC
    3. Set the "Path in WAR" value to: /WEB-INF/lib
    4. Using the "Add File/Folder" panel, locate the OpenPTK configuration files that need to be included. These are in ${PTK_HOME}/projects/OpenPTK.
    5. Add the following files:
      • openptk.xml
      • openptk.xsd
    6. Set the "Path in WAR" value to: /WEB-INF/classes
  4. Click the "OK" button on the Project Properties panel.
Run settings
  1. From the Categories pane, Select the Run item
  2. Validate that the Context Path is set to: /openptk
  3. Click the "OK" button on the Project Properties panel.

Clean and Build

You can now build the project. Select the "OpenPTK-Server" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.

Deploying and Running

  1. Right-click on the "OpenPTK-Server" project and select "Undeploy and Deploy".
  2. Right-click on the "OpenPTK-Server" project and select "Run".

Server URL:

http://localhost:8080/openptk 

REST URIs:

  • http://localhost:8080/openptk/resources/contexts
  • http://localhost:8080/openptk/resources/engine

For more information on testing the RESTful interface, see: Curl command line