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 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.
|
|
|
|