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
- From the File menu, select New Project
- From the Categories Pane, select "Web"
- From the Projects Pane, select "Web Application with Existing Source"
- Click the "Next >" button
| |
Name and Location
- Select the Folder that contains the Web Application source files.
- Click the "Browse" button to the right of the Location: field
- 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.
- Select the "java" folder and click "open"
- Set the Project Name to "OpenPTK-Server"
- Set the Project Folder to be under ${NB_HOME}. Use the name "OpenPTK-Server"
- Select "Next >"
| |
Server and Settings
- Select the deployment server. This document uses Glassfish v3. You must have a configured web container.
- Set the Context Path to /openptk
Click the "*Next *" button
| |
Existing Sources and Libraries
- Select the Web Pages Folder that contains the Web application files.
- Click the "Browse" button to the right of the Web Pages Folder: field
- 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.
- Select the "web" folder and click "open"
- Select the WEB-INF Content that contains the Web application class and properties files.
- Click the "Browse" button to the right of the WEB-INF Content: field
- 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.
- 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 LibrariesThe 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 PropertiesSelect 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
- From the Categories pane, Select the Build -> Packaging item
- From the WAR Content: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Add the following Project:
- Add the following Libraries:
- Jersey 1.0 (JAX-RS RI)
- JAX-RS 1.0
- Check the Package checkbox to the right of the *** Jersey 1.0 (JAX-RS RI) and JAX-RS 1.0 libraries
- Click the "OK" button on the Project Properties panel.
| |
Build Packaging
- From the Categories pane, Select the Build -> Packaging item
- From the WAR Content: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Add the following Projects:
- OpenPTK-Framework
- OpenPTK-Service-SPML
- OpenPTK-Service-JNDI
- OpenPTK-Service-JDBC
- Set the "Path in WAR" value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- Using the "Add Library" panel, locate the libraries that need to be included.
- Add the following Libraries:
- LDAP Bonus Pack
- OpenSPML-1
- OpenSPML-2
- MYSQL-JDBC
- Set the "Path in WAR" value to: /WEB-INF/lib
- Using the "Add File/Folder" panel, locate the OpenPTK configuration files that need to be included. These are in ${PTK_HOME}/projects/OpenPTK.
- Add the following files:
- Set the "Path in WAR" value to: /WEB-INF/classes
- Click the "OK" button on the Project Properties panel.
| |
Run settings
- From the Categories pane, Select the Run item
- Validate that the Context Path is set to: /openptk
- Click the "OK" button on the Project Properties panel.
| |
Clean and BuildYou 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- Right-click on the "OpenPTK-Server" project and select "Undeploy and Deploy".
- 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
|