 | Warning
This page is under construction! It is being updated to reflect the enhancements for version 2.0. |
Top
Revision History
| Description |
Author |
Version |
Date |
| Initial Creation |
Scott Fehrman |
0.9.0 |
December 2007 |
| Update for release |
Scott Fehrman |
1.0.0 |
January 2008 |
| Update for release, move to wiki |
Scott Fehrman |
1.1.0 |
August 2008 |
| Update / Testing with Netbeans 6.5 |
Derrick Harcey |
1.1.1 |
Jan 2009 |
| version 2.0 Update / Testing with Netbeans 6.5 |
Derrick Harcey |
2.0.0 |
Sept 2009 |
Top
This Document
This document provides instructions on how to use NetBeans with the OpenPTK source files.
Top
Related Documents
Project OpenPTK includes a collection of related documents to assist teams that want to:
- Install Project OpenPTK in their environment
- Configure it for a specific situation
- Customize the samples
- Develop extra features
The following Project OpenPTK version 1.x documents are available:
Top
Overview
This document will assist the developer in setting-up NetBeans Projects that leverage the various packages within Project OpenPTK.
The processes outlined in this document will allow the developer to leverage the bundled build process (ant and build.xml file) that is provided with Project OpenPTK while using the development features of NetBeans.
The process involves downloading the entire Project OpenPTK source code distribution and then creating a specific NetBean's projects (both Java and Web) that "map" to OpenPTK projects.
Top
Setup
Create a directory (folder) structure which will be used to hold the Project OpenPTK checked-out source code and NetBeans Projects. This document will use the following variable for the structure:
| ${NB_HOME} |
/work/Software/netbeans |
| ${PTK_HOME} |
/work/Software/openptk |
NetBeans
Install NetBeans 5.5 or higher. The instructions in this document have been tested on Netbeans 5.5, 6.0, and 6.5. The screenshots included in this page were taken on Netbeans 6.0 on Mac OSX, other Netbeans versions and operating systems may vary slightly from these screenshots.
New NetBeans projects will be created for the components of the Project OpenPTK. The new NetBeans projects will be created under the
${NB_HOME} directory.
Project OpenPTK
Checkout the source code for Project OpenPTK from http://openptk.dev.java.net. Use the following svn command to obtain the source code.
Version 1.1, Released Oct 2008
svn checkout https://openptk.dev.java.net/svn/openptk/tags/release-1.1/openptk openptk-1.2 --username <username>
Current Development Release
svn checkout https://openptk.dev.java.net/svn/openptk/trunk/openptk openptk --username <username>
Replace the "<username>" with your java.net login or you can use "guest".
[http://wikis.sun.com/display/openptk/Download]
Place the source code tree under the ${PTK_HOME} directory. The following files/directories will be available:
bash-3.00$ ls -F
PROJECT build.xml ext lib projects resource
The projects sub-directory contains a collection of packages:
bash-3.00$ ls -F projects
Apps/ OpenPTK/ Samples/
The "Apps" directory contains complete applications that demonstrate Project OpenPTK:
- CLI
- Portlets
- UserManagementLite
- WebServiceWSDL
The "OpenPTK" directory contains the three tiers of the project:
- Consumer
- Framework
- Service
The "Samples" directory contains focused projects that are used to test different parts of Project OpenPTK:
Top
OpenPTK Framework
Create a NetBeans Project called "OpenPTK-Framework". The Framework package within Project OpenPTK is a core component and needs to be established first. This project will be needed by the other NetBeans projects.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source" (We're going to reference the code that was checked-out from svn)
- Click the "Next >" button
|
|
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to OpenPTK-Framework
- Use the "Browse" button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Framework
- 1.Click the "Next >" button
|
|
Existing Sources
Add Project OpenPTK source files for the Framework (ONLY).
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Framework/src
- Click the "Next >" button
|
|
Includes and Excludes
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
|
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Clean and Build
You can now build the project. Select the "OpenPTK-Framework" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
Top
OpenPTK - Service - SPML
Create a "OpenPTK-Service-SPML" NetBeans Project that maps the Project OpenPTK's Service for SPML. The Service Provisioning Markup Language (SPML) Service is used by Project OpenPTK to interface with Sun's Identity Manager user provisioning solution.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source" (We're going to reference the code that was checked-out from svn)
- Click the "Next >" button
|
|
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to OpenPTK-Service-SPML
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Service-SPML
- Click the "Next >" button
|
|
Existing Sources
Add Project OpenPTK source files for the Service SPML.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Service/SPML/src
- Click the "Next >" button
|
|
OPTIONAL: Add Sun SPML Service source files
This additional source file is used for integration with Sun Identity Manager's SPML interface. It includes SPML extensions for authentication with userId and Password of the proxy user being used. This source file is highly recommended for integration with Sun Identity Manager. This source file also assumes that the openspml.jar file being used by the openptk framework will include the required extentions for authentication.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/ext/Sun/IdentityManager/src
- Click the "Next >" button
|
|
Includes and Excludes
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. (If the Sun SPML source file was added an additional file will also be in the include SPMLSunService.java or SPMLSunOperations in OpenPTK v2.0) |
|
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependancies
From the section above, "Verify New Project", notice that the Project is marked with a red exclamation symbol. This symbol indicates that there are references to other packages and/or libraries that are not resolved.
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- OpenSPML Library (openspml.jar)
- Select the "OpenPTK-Service-SPML" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "OpenPTK-Service-SPML" Properties
- From the Categories pane, Select the Libraries item
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the "OpenPTK-Framework" NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the "OpenPTK-Framework" Project and click the "Add Project JAR File" button.
- Click the "OK" button on the Project Properties panel.
|
|
- Select the "OpenPTK-Service-SPML" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "OpenPTK-Service-SPML" Properties
- From the Categories pane, Select the Libraries item
- From the Compile-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the "openspml.jar" file and click the "Choose" button
- Click the "OK" button on the Project Properties panel.
|
|
Clean and Build
The red indicators on the project should now be gone. You can now build the project. Select the "OpenPTK-Service-SPML" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
Top
OpenPTK - Service - JNDI
Create a "OpenPTK-Service-JNDI" NetBeans Project that maps the Project OpenPTK's Service for JNDI. The Java Naming and Directory Interface (JNDI) Service is currently under development and incomplete. Some of it's classes are used by other Project OpenPTK packages and therefore needs to be created as a NetBeans project.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source"
- Click the "Next >" button
|
 |
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to OpenPTK-Service-JNDI
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Service-JNDI
- Click the "Next >" button
|
 |
Existing Sources
Add Project OpenPTK source files for the Service JNDI.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Service/JNDI/src
- Click the "Next >" button
|
 |
Includes and Excludes:
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
 |
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependencies
From the section above, "Verify New Project", notice that the Project is marked with a red exclamation symbol. This symbol indicates that there are references to other packages and/or libraries that are not resolved.
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- Select the OpenPTK-Service-JNDI Project, from the Projects panel, if it is not already selected.
- From the File menu, select the menu item OpenPTK-Service-JNDI Properties
- From the Categories pane, Select the Libraries item
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the Add Project panel, locate the OpenPTK-Framework NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the OpenPTK-Framework Project and click the Add Project JAR File button.
- From the Compile-Time Librarties: pane, click the Add JAR/Folder button.
- Using the Add JAR/Folder panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the ldapbp.jar file and click the Choose button
- Click the OK button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the OpenPTK-Service-JNDI Project from the Projects panel. Right-click on the selected project and select Clean and Build. The Project should build successfully.
Top
OpenPTK - Service - JDBC
Create a "OpenPTK-Service-JDBC" NetBeans Project that maps the Project OpenPTK's Service for JDBC. The Java Database Connectivity (JDBC) Service is currently under development and incomplete.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source"
- Click the "Next >" button
|
 |
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to OpenPTK-Service-JDBC
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Service-JDBC
- Click the "Next >" button
|
 |
Existing Sources
Add Project OpenPTK source files for the Service JDBC.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Service/JDBC/src
- Click the "Next >" button
|
 |
Includes and Excludes:
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
 |
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependencies
From the section above, "Verify New Project", notice that the Project is marked with a red exclamation symbol. This symbol indicates that there are references to other packages and/or libraries that are not resolved.
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- Select the OpenPTK-Service-JNDI Project, from the Projects panel, if it is not already selected.
- From the File menu, select the menu item OpenPTK-Service-JDBC Properties
- From the Categories pane, Select the Libraries item
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the Add Project panel, locate the OpenPTK-Framework NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the OpenPTK-Framework Project and click the Add Project JAR File button.
- From the Compile-Time Librarties: pane, click the Add JAR/Folder button.
- Using the Add JAR/Folder panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the mysqljdbc.jar file and click the Choose button
- Click the OK button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the OpenPTK-Service-JDBC Project from the Projects panel. Right-click on the selected project and select Clean and Build. The Project should build successfully.
Top
OpenPTK-Server
The OpenPTK-Server 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 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
- 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 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
- Right-click on the "OpenPTK-Server" project and select "Undeploy and Deploy".
- Right-click on the "OpenPTK-Server" project and select "Run".
Server URL:
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
Top
OpenPTK-Consumer-Taglib
Create a "OpenPTK-Consumer-Taglib" NetBeans Project that maps to Project OpenPTK's Consumer module for the JSP Taglib.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source"
- Click the "Next >" button
|
 |
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to OpenPTK-Consumer-Taglib
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/OpenPTK-Consumer-Taglib
- Click the "Next >" button
|
 |
Existing Sources
Add Project OpenPTK source files for the Consumer Taglib package.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Consumer/Taglib/src
- Click the "Next >" button
|
 |
Includes and Excludes
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
 |
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependencies
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- Servlet JSP Library (servlet2.5-jsp2.1-api.jar)
- Select the "OpenPTK-Consumer-Taglib" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "OpenPTK-Consumer-Taglib" Properties
- From the Categories pane, Select the Library item
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the "OpenPTK-Framework" NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the "OpenPTK-Framework" Project and click the "Add Project JAR File" button.
- Click the "OK" button on the Project Properties panel.
|
 |
- Select the "OpenPTK-Consumer-Taglib" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "OpenPTK-Consumer-Taglib" Properties
- From the Categories pane, Select the Library item
- From the Compile-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the "servlet2.5-jsp2.1-api.jar" file and click the "Choose" button
- Click the "OK" button on the Project Properties panel.
|
 |
Clean and Build
The red indicators on the project should now be gone. You can now build the project. Select the "OpenPTK-Consumer-Taglib" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
Top
Samples-JavaAPI
The Samples-JavaAPI package contains Java programs that demonstrate the use of Project OpenPTK's Consumer Tier API.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source"
- Click the "Next >" button
|
 |
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to Samples-JavaAPI
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/Samples-JavaAPI
- Click the "Next >" button
|
 |
Existing Sources
Add Project OpenPTK source files for the Samples JavaAPI package.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/Samples/JavaAPI/src
- Click the "Next >" button
|
 |
Includes and Excludes
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
 |
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependencies
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- OpenPTK-Service-SPML Project.
- OpenPTK-Service-JNDI Project.
- OpenSPML Library (openspml.jar, soap.jar, mail.jar, activation.jar)
- OpenPTK Configuration files.
- Select the "Samples-JavaAPI" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "Samples-JavaAPI" Properties
- From the Categories pane, Select the Library item
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the "OpenPTK-Framework" NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the "OpenPTK-Framework" Project and click the "Add Project JAR File" button.
- Add the "OpenPTK-Service-JNDI" Project (steps 4-6)
- Add the "OpenPTK-Service-SPML" Project (steps 4-6)
- Add the "OpenPTK-Service-JDBC" Project (steps 4-6)
- Click the "OK" button on the Project Properties panel.
|
|
- Select the "Samples-JavaAPI" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "Samples-JavaAPI" Properties
- From the Categories pane, Select the Libraries item
- Select the "Run" tab
- From the Run-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the "openspml.jar" file and click the "Choose" button
- Add "soap.jar" (steps 5-7)
- Add "activation.jar" (steps 5-7)
- Add "mail.jar" (steps 5-7)
- Add "ldapbp.jar" (steps 5-7)
- Add "mysqljdbc.jar" (steps 5-7)
- From the Run-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" pane, locate the directory (Folder) that contains the openptk.xml file. This file is in the OpenPTK folder. The folder is located in ${PTK_HOME}/projects. Select the "OpenPTK" Folder and click the "Choose" button.
- Click the "OK" button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the "Samples-JavaAPI" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
Running
- Expand the "Samples-JavaAPI" Project to display all the Java source files.
- Select the "apiSearch.java" file
- Right-click on the apiSearch.java file and select "Run"
The file will be compiled (if needed) and then executed. The output will be displayed in the NetBeans output window. This sample program will perform two searches. The first search has no filter and returns all the user records. The second search returns a sub-set of users with a common firstname.
|
 |
Top
Samples-Taglib
The Samples-Taglib package contains Java Server Pages (JSPs) that demonstrates the use of Project OpenPTK's Consumer Tier custom JSP Taglib.
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
|
 |
Add Existing Sources
- 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 "web" folder that's under the "Samples/Taglib" folder. These folder are found in the ${PTK_HOME} folder.
- Select the "web" folder and click "open"
- Set the Project Name to "Samples-Taglib"
- Set the Project Folder to be under ${NB_HOME}. Use the name "Samples-Taglib" /work/Software/netbeans/openptk/Samples-Taglib
- Select the deployment server. This document uses Glassfish v1. You must have a configured web container.
- Select "Next >"
|
 |
Existing Sources and Libraries
We will not be making any changes to this part of the set-up.
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 use the following:
- Projects:
- OpenPTK-Framework
- OpenPTK-Service-SPML
- OpenPTK-Service-JNDI
- OpenPTK-Service-JDBC
- OpenPTK-Consumer-Taglib
- OpenSPML JAR files:
- openspml.jar
- soap.jar
- mail.jar
- activation.jar
- mysqljdbc.jar
- OpenPTK Configuration files
- Select the "Samples-Taglib" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "Samples-JavaAPI" Properties
- 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 "OpenPTK-Framework" 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, OpenPTK-Consumer-Taglib
- Set the "Path in WAR" value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- Using the "Add File/Folder" panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
- Add the following JAR files: openspml.jar, soap.jar, activation.jar, mail.jar, ldapbp.jar, mysqljdbc.jar Note: If deploying to a J2EE container, activation.jar and mail.jar are not needed.
- Set the "Path in WAR" value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- Using the "Add File/Folder" panel, locate the OpenPTK confoguration files that need to be included. These are in ${PTK_HOME}/projects/OpenPTK.
- Add the following files: openptk.xml and openptk.xsd
- Set the "Path in WAR" value to: /WEB-INF/classes
- Click the "OK" button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the "Samples-Taglib" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
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://www.openptk.org
Right-click on the "Samples-Taglib" project and select "Undelpoy and Deploy".
Right-click on the "Samples-Taglib" project and select "Run".
Top
Apps-CLI
The Application CLI package contains is a Project OpenPTK solution that delivers a "Command Line Interface" (CLI) for performing user provisioning operations.
New Project
- From the File menu, select New Project
- From the Categories Pane, select "Java"
- From the Projects Pane, select "Java Project with Existing Source"
- Click the "Next >" button
|
 |
Name and Location
Specify the name of the new NetBeans project and where it will be located.
- Set the Project Name to Apps-CLI
- Use the Browse button and select the the ${NB_HOME} directory. Make sure the Project Folder is set to the ${NB_HOME} directory with a sub-directory name that matches the Project Name: /work/Software/netbeans/openptk/Apps-CLI
- Click the "Next >" button
|
 |
Existing Sources
Add Project OpenPTK source files for the Samples JavaAPI package.
- Use the "Add Folder ..." button to locate the "src" folder. This folder will be under the ${PTK_HOME} directory as a sub-directory. The directory pathname to the src folder is: /work/Software/openptk/projects/OpenPTK/Apps/CLI/src
- Click the "Next >" button
|
 |
Includes and Excludes
The last dialog will show all the Java files that will be referenced by the new NetBeans Project. This dialog allows you to include and/or exclude other files. No changes will be made.
Click the "Finish" button.
NetBeans will create the new Project. |
 |
Verify New Project
After the project has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components of the new Project.
See the images below:
Resolve Dependencies
We need to configure this Project use the following:
- OpenPTK-Framework NetBeans Project.
- OpenPTK-Service-SPML Project.
- OpenPTK-Service-JNDI Project.
- OpenPTK-Service-JDBC Project.
- OpenSPML Library
- openspml.jar
- soap.jar
- mail.jar
- activation.jar
- mysqljdbc.jar
- OpenPTK Configuration files.
- Select the "Apps-CLI" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "Apps-CLI" Properties
- From the Categories pane, Select the Libraries item.
- From the Compile-Time Libraries: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the "OpenPTK-Framework" NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
- Select the "OpenPTK-Framework" Project and click the "Add Project JAR File" button.
- Click the "OK" button on the Project Properties panel.
|
 |
Add the missing run-time libraries (JAR files).
- Select the "Apps-CLI" Project, from the Projects panel, if it is not already selected.
- From the "File" menu, select the menu item "Apps-CLI" Properties
- From the Categories pane, Select the Libraries item
- Select the "Run" tab
- From the Run-Time Libraries: pane, click the "Add Project ..." button.
- Using the "Add Project" panel, locate the "OpenPTK-Service-SPML" project. This is located in the ${NB_HOME}/openptk directory.
- Select the "OpenPTK-Service-SPML" Project and click the "Add Project JAR Files" button
- Repeat the steps above to add the "OpenPTK-Service-JNDI and OpenPTK-Service-JDBC" project jar files
- From the Run-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" panel, locate the necessary JAR files. These JAR files are in the ${PTK_HOME}/lib directory.
- Select the "openspml.jar" file and click the "Choose" button
- Add the following JAR files:
- soap.jar
- activation.jar
- mail.jar
- ldapbp,jar
- mysqljdbc.jar
- From the Run-Time Libraries: pane, click the "Add JAR/Folder ..." button.
- Using the "Add JAR/Folder" pane, locate the directory (Folder) that contains the openptk.xml file. It's in the OpenPTK folder. The folder is located in ${PTK_HOME}/projects. Select the "OpenPTK" Folder and click the "Choose" button.
- Click the "OK" button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the "Apps-CLI" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
Running
If you are conncted to the Internet, you can test the sample java programs. The default configuration for Project OpenPTK is setup to access a user repository (via SPML) hosted on http://www.openptk.org
- Expand the "Apps-CLI" Project to display all the Java source files.
- Select the "PTKCLI.java" file
- Right-click on the PTKCLI.java file and select "Run"
The file will be compiled (if needed) and then executed. The output will be displayed in the NetBeans output window.
|
 |
Top
Apps-UserManagementLite
The Apps-UserManagementLite package is a Project OpenPTK solution that delivers a custom web-based (JSP/Taglib) 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
|
 |
Add Existing Sources
- 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 "web" folder that's under the "Apps/UserManagementLite" folder. These folder are found in the ${PTK_HOME} folder.
- Select the "web" folder and click "open"
- Set the Project Name to "Apps-UserManagmentLite"
- Set the Project Folder to be under ${NB_HOME}. Use the name "Apps-UserManagementLite" /work/Software/netbeans/openptk/Apps-UserManagementLite
- Select the deployment server. This document uses Glassfish v1. You must have a configured web container.
- Select "Next >"
|
 |
Existing Source and Libraries
We will not be making any changes to this part of the set-up.
Click the "Finish" button |
 |
Verify New Project
After the Web Application has been created, verify it's components. Select the "Projects" tab and the "*Files8" tab. Explore tabs to verify the components.
See the images below:
Resolve Dependancies
Configure this Project use the following:
- Projects:
- OpenPTK-Framework
- OpenPTK-Service-SPML
- OpenPTK-Service-JNDI
- OpenPTK-Service-JDBC
- OpenPTK-Consumer-Taglib
- OpenSPML JAR files:
- openspml.jar
- soap.jar
- mail.jar
- activation.jar
- ldapbp.jar
- mysqljdbc.jar
- OpenPTK Configuration files
- Select the "Apps-UserManagementLite" Project from the Projects panel.
- From the "File" menu, select the menu item "Apps-UserManagementLite" Properties
- 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
- OpenPTK-Consumer-Taglib
- Set the "Path in WAR" value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- Using the "Add File/Folder" panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
- Add the following JAR files:
- openspml.jar
- soap.jar
- activation.jar
- mail.jar
- ldapbp.jar
- mysqljdbc.jar
Note: If deploying to a J2EE container, activation.jar and mail.jar are not needed.
- Set the "Path in WAR" value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- 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: openptk.xml and openptk.xsd
- Set the "Path in WAR" value to: /WEB-INF/classes
- Click the "OK" button on the Project Properties panel.
|
 |
Clean and Build
You can now build the project. Select the "Apps-UserManagementLite" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.
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://www.openptk.org
- Right-click on the "Apps-UserManagementLite" project and select "Undeploy and Deploy".
- Right-click on the "Apps-UserManagementLite" project and select "Run".
Top
Apps-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
- 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
|
 |
Add Existing Sources
- 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 web folder that's under the Apps/Portlets folder,found in ${PTK_HOME} folder.
- Select the web folder and click open
- Set the Project Name to Apps-Portlets
- Set the Project Folder to be under ${NB_HOME}. Use the name Apps-Portlets /work/Software/netbeans/openptk/Apps-Portlets
- Select the deployment server. This document uses Glassfish v1.
- Set Context Path to /OpenPTK-Portlets
- 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
- Select the Apps-Portlets Project from the Projects panel.
- From the File menu, select the menu item Apps-Portlets Properties
- 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
- From the Compile-Time Libraries section, 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: OpenPTK-Framework
- Make sure the Package check-box is selected
- 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.
- Using the Add File/Folder panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
- Add the following JAR files: portlet-api-1.0.jar
- Make sure that the Package check-box is NOT SELECTED
- Configure the Project for 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-Service-SPML
- OpenPTK-Service-JNDI
- OpenPTK-Service-JDBC
- OpenPTK-Consumer-Taglib
- Set the Path in WAR value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- Using the Add File/Folder panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
- 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.
- Set the Path in WAR value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- 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: openptk.xml and openptk.xsd
- Set the Path in WAR value to: /WEB-INF/classes
- 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  |
Top
Apps-WebServiceWSDL
The Apps-WebServiceWSDL package is a Project OpenPTK solution that delivers a WSDL-based web service for performing user provisioning operations. The Project will need to generate JAX-RPC Java code to implement the solution.
 | Warning
This project uses JAX-RPC for the web service. You will need to install the JAX-RPC plug-in for NetBeans. If the plug-in is not installed, you will see an error message when you try to create the Web Service. |
You can check to see if the JAX-RPC plug-in is installed. Open the plugin manager and look for the plugin that is highlighted in the image below:

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
|
 |
Add Existing Sources
- 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 WebServiceWSDL folder that's under the Apps folder,found in ${PTK_HOME} folder.
- Select the WebServiceWSDL folder and click open
- Set the Project Name to Apps-WebSericeWSDL
- Set the Project Folder to be under ${NB_HOME}. Use the name Apps-WebServiceWSDL /work/Software/netbeans/openptk/Apps-WebServiceWSDL
- Select the deployment server. This document uses Glassfish v1/v2.
- Set Context Path to /ProvWebService
- Select "Next >"
|
 |
Existing Sources and Libraries
Nothing should need to be done on this page.
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:
 | Note:
The project will NOT build at this point. The source Java files have a dependancy on files that need to be generated. These files will be generated in a later step. You will see RED indicators on the files that can not resolve their dependancies. |
Resolve Dependancies
Configure this Project to use the following:
- OpenPTK Projects:
- OpenPTK-Framework
- OpenPTK-Service-SPML
- OpenPTK-Service-JNDI
- OpenPTK-Service-JDBC
- Third-party JAR files
- OpenPTK Configuration files
- Select the Apps-WebServiceWSDL Project from the Projects panel.
- From the File menu, select the menu item Apps-WebServiceWSDL Properties
- 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
- From the Compile-Time Libraries section, 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:
- Make sure the Package check-box is selected
- Configure the Project for 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-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 File/Folder" panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
- Add the following JAR files:
- openspml.jar
- soap.jar
- activation.jar
- mail.jar
- ldapbp.jar
- mysqljdbc.jar
Note: If deploying to a J2EE container, activation.jar and mail.jar are not needed.
- Set the Path in WAR value to: /WEB-INF/lib
- From the WAR Content: pane, click the "Add File/Folder ..." button.
- 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: openptk.xml and openptk.xsd
- Set the Path in WAR value to: /WEB-INF/classes
- Click the OK button on the Project Properties panel.
|
 |
New Web Service from WSDL:
Create the Web Service from the projects WSDL file.
NOTE: There is a known issue which may prevent this step on Netbeans 6.5 (http://statistics.netbeans.org/analytics/exception.do?id=151622), previous versions of Netbeans did not have this issue.
- Select the Apps-WebServiceWSDL Project. From the File Menu, select New File ...
- From the Wizard, Categories, select Web Services. From the File Types, select Web Service from WSDL
- Click Next >
- Set the Web Service Name: to ProvisionPerson
- Set the Package to be a new level below the existing package name. Select the default Package name "org.openptk.app.prov.webservice". Append the value ".generated" to the name. The full package name should be:
org.openptk.app.prov.webservice.generated
- Select the Local WSDL file. Click the Browse ... button. Locate the ProvisionPerson.wsdl file. This file is in ${PTK_HOME}/projects/Apps/WeberviceWSDL/src.
- Click Finish
|
 |
Code generated
NetBeans created Java file under the "generated" package.
Some files need to be updated. The defined servlet class references the Web Service Implementation that was generated by NetBeans. We need to replace this with the ProvisionPerson class.
- Expand the Projects Configuration Files. Open the web.xml file. Select the XML Tab of the web.xml file. Change the <servlet-class> value.
Before:
<servlet-class>
org.openptk.app.prov.webservice.generated.Person_PortType_Impl
</servlet-class>
After:
<servlet-class>
org.openptk.app.prov.webservice.ProvisionPersonService
</servlet-class>
- Expand the Projects Configuration Files. Open the sun-web.xml file. Select the XML Tab of the sun-web.xml file. Make sure the Context root is set to:
<context-root>/ProvisionService</context-root>
- Expand the Projects Configuration Files. Open the context.xml file. Make sure the Context path is set to:
<Context path="/ProvisionService"/>
- Save the files.
|
 |
Clean and Build
You can now build the project. Select the Apps-WebServiceWSDL 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-WebServiceWSDL.war
Deploying
If you are connected to the Internet, you can test the Web Service. The default configuration for Project OpenPTK is setup to access a user repository (via SPML) hosted on http://www.openptk.org
Right-click on the "Apps-WebServiceWSDL" project and select "Undeploy and Deploy".
Running
Use Firefox to test access to the Web Services at this URL:
http://localhost:8080/ProvisionService/ProvisionPerson?wsdl
Review the WSDL
soapUI
Top
Comments (2)
Sep 22
hjimenez says:
Hello, I checked out the 2.0 version and when following these instructions I s...Hello,
I checked out the 2.0 version and when following these instructions I see references to JAX-RPC, isn“t 2.0 now JAX-WS API compliant?
Hector Jimenez
Sep 22
hjimenez says:
Just to comment, from the current development subversion source code: In projec...Just to comment, from the current development subversion source code:
In project Apps-WebServiceWSDL inside class org.openptk.app.prov.webservice.ProvisionPersonService I had to change an import from org.openptk.provision.config.Configuration to org.openptk.config.Configuration