EMC Developer Network


Cost Effective Development using the WDK
 

This paper illustrates how you can use free, open source tools like NetBeans and Tomcat to address the cost of developing WDK-powered solution, (rather than addressing the cost of deploying them).

DISCLAIMER: The WDK doesn't certify against any IDE in particular. Consequently IDE-specific questions should be sent to the company or organization producing the IDE, not Documentum Technical Support. Please understand that the following information is provided in an unsupported fashion.


NetBeans Java IDE

The NetBeans Java IDE (http://www.netbeans.org) is a full-featured, free, open source tool that you can use to develop your WDK-powered applications. This paper is intended to show you how to use NetBeans efficiently in this manner.

Installing NetBeans 3.2

  1. Download the 3.2 release from http://www.netbeans.org/downloads.html (e.g. NetBeans-release32.exe).
  2. Launch the executable and follow its instructions to install the IDE.
Configuring NetBeans
  1. Enabling Code Completion for the WDK and the DFC

    When using the NetBeans editor, pressing Ctrl-Space will usually pop-up a window with a list of possible choices for code completion. This works out-of-box with the Java API but not with our WDK classes or DFC.

    In order to enable this feature, you have to manually update the parser database.

    1. Go to the FileSystem tab in the explorer window and select the wdk.jar file, right click it and select "Tools | Update Parser Database..."
    2. In the Update Parser Database dialog:
      • Enter "pd_wdk" as the prefix
      • Select Protected and public" for all three columns (i.e. Classes, Fields, Methods).
    3. Go to the FileSystem tab in the explorer window and select the dfcbase.jar file, right click it and select "Tools | Update Parser Database..."
    4. In the Update Parser Database dialog:
      • Enter "pd_dfc" as the prefix
      • Select "Protected and public" for all three columns (i.e. Classes, Fields, Methods).
    5. Now, you should be able to get code completion for the WDK and the DFC.

    Note: You can also do this for your own application-specific code or for any other third party libraries used by your application. If this code is inside a JAR file, you can follow steps similar to those above. If this code exists as individual files, go to its root Java folder in Project explorer window instead, right click it and select "Tools | Update Parser Database..."

  2. Using Interface and Inheritance Synchronization

    When changing a class declaration, NetBeans automatically detects changes in inheritance and will offer to implement the needed methods skeletons for you.

  3. Importing WDK Projects in NetBeans

    NetBeans does not yet support a robust method of sharing projects across a development team (e.g. the equivalent of a .vep file in Visual Cafe).

    As a workaround, it is possible to do the following:

             
    1. Copy all the files under:
      <NetBeans User Directory>/System/Projects/<your project name>
    2. Now that the files are backed-up, open NetBeans on the another machine you want to import the project to, and create a new Project with the name of the project you are importing (wdkSpace for instance).
    3. Close the project and open another one.
    4. Exit NetBeans
    5. Go to the directory:
      <NetBeans User Directory>/System/Projects/<your new project>
    6. Copy your backed-up files over the new project files.
    7. Restart NetBeans and open the new project.

Debugging with NetBeans and Various Application Servers
  1. NetBeans and JRun

    1. Go to JRun Management Console (i.e. (1) Start | Programs | JRun 3.0 | JRun Admin Server, then (2) Start | Programs | JRun 3.0 | JRun Management Console) and edit the Java arguments for the default server (Default Server /Java Settings/Java Arguments), adding the following arguments:

      -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12000

      The port# is 12000 but this can be changed.

    2. Start JRun (e.g. Start | Programs | JRun 3.0 | JRun Default Server).
    3. Go to NetBeans menu: Debug | Attach
    4. Select Default Debugger (JPDA)
    5. In Connector, select "Socket Attach" and enter the port # (12000 with the arguments specified above).
    6. Click OK and start wdkSpace.

  2. NetBeans and WebLogic

    1. Edit startWebLogic.cmd (in <webLogic> root directory) and find the java command line that is used to launch the server, then add the following args:

      -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12000

      The port# is 12000 but this can be changed.

    2. Start WebLogic by launching startWebLogic.cmd.
    3. Go to NetBeans menu: Debug | Attach
    4. Select Default Debugger (JPDA)
    5. In Connector, select "Socket Attach" and enter the port # (12000 with the arguments specified above).
    6. Click OK and start wdkSpace.

  3. NetBeans and Tomcat

    These steps assume that you have a project with the following Filesystems mounted: Your webapp's directory, bsf.jar, dfcbase.jar, wdk.jar, xalan.jar, xerces.jar, and your webapp's JAR file, if it exists.

    Note: NetBeans includes a copy of the xerces.jar file located in <NetBeans Home Directory>\lib\ext. You may need to use the version of Xerces-J that comes with the WDK 4.2. To do so, first make a backup of the JAR in <NetBeans Home Directory>\lib\ext, then copy over xerces.jar from the WDK 4.2 distribution.

    1. Select Project | Settings...
    2. Open Execution Types > JSP Execution
    3. Enter the context base URI for your webapp (ie: "/wdkSpace42")
    4. Edit the External Process property by adding the following arguments before the {database} argument:

      -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12000

      The port# is 12000 but this can be changed.

    5. Start Tomcat by right-clicking a JSP page and selecting Execute from the menu (or use the Build | Execute menu)
    6. Go to NetBeans menu: Debug | Attach
    7. Select Default Debugger (JPDA)
    8. In Connector, select "Socket Attach" and enter the port # (12000 with the arguments specified above).
    9. Click OK and start wdkSpace.


Apache Tomcat

DISCLAIMER: The use of Apache Tomcat 3.2.1 for WDK-powered applications is not a certified configuration supported by Documentum Technical Support. Please understand that the following information is provided in an unsupported fashion.

The Apache Tomcat 3.2.1 JSP/Servlet engine (http://jakarta.apache.org/tomcat/index.html) is a standards-compliant, free, open source tool that you can use to develop your WDK-powered applications. This paper is intended to show you how to use Tomcat efficiently in this manner on Windows NT Server and Windows 2000 Server platforms.

Installing Apache Tomcat 3.2.1

  1. Download Tomcat 3.2.1 at http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/jakarta-tomcat-3.2.1.zip.
  2. Download the ISAPI filter for use with IIS at http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/win32/i386/isapi_redirect.zip.
  3. Unzip everything. You now have Tomcat content in a directory named "jakarta-tomcat-3.2.1."
  4. Rename this directory to "jakarta-tomcat" and copy it, for example, to your C: drive.
  5. Create the following folder: C:\jakarta-tomcat\bin\win32\i386. Copy the ISAPI filter and the JNI connector DLLs there (i.e. isapi_redirect.dll and jni_connect.dll).

Deploying WDK-Powered Applications into Tomcat

  1. Copy wdkSpace42.war from, for example, C:\Documentum\wdk\4.2\webapps to C:\jakarta-tomcat\webapps directory. Optionally rename the WAR file with your application name of choice (i.e. <webappname>.war) If you don't do this, Tomcat will use "wdkSpace42" as the name of your web application.
  2. Tomcat uses batch files to boot and terminate. C:\jakarta-tomcat\bin\tomcat.bat will need to be modified to have the correct environment variable settings for the following three environment variables:

    set JAVA_HOME=C:\jdk1.2.2

    This sets the location of the JDK used by Tomcat. Note: Other files in the "conf" folder expect to find the JDK at C:\jdk1.2.2, so you will need to change any other references to it if you installed JDK 1.3 or used a different location (e.g. C:\jdk1.3.0_02).

    set TOMCAT_OPTS=-Djava.library.path=C:\Documentum\wdk\4.2\lib\windows

    This environment variable passes extra arguments to the Java Virtual Machine, and is used to set the path to the JNI libraries used by DFC.

    set CLASSPATH=

    This tells Tomcat to ignore the system CLASSPATH setting.

  3. OK, if you made it this far, then run C:\jakarta-tomcat\bin\startup.bat. Make sure that Tomcat starts without errors and that it adds a context for your web application.
  4. Try accessing wdkSpace on Tomcat's default port of 8080 (i.e. http://localhost:8080/wdkSpace42/wdkSpace/)

Using IIS as Your HTTP Server Instead of Tomcat

  1. Launch RegEdit.
  2. Create a new registry key named "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0".
  3. Add a string value with the name "extension_uri" and a value of "/jakarta/isapi_redirect.dll."
  4. Add a string value with the name "log_file" and a value pointing to where you want your log file to be (e.g. "C:\jakarta-tomcat\logs\isapi.log").
  5. Add a string value with the name "log_level" and a value for your log level (can be "debug," "info," "error" or "emerg").
  6. Add a string value with the name "worker_file" and a value which is the full path to your workers.properties file (for example "C:\jakarta-tomcat\conf\workers.properties").
  7. Add a string value with the name worker_mount_file and a value which is the full path to your uriworkermap.properties file (for example c:\jakarta-tomcat\conf\uriworkermap.properties)

    Note: Here is a registry file that contains steps 2-7. You will need to rename its extension to ".reg" before double-clicking the file to configure your Windows Registry with this information.

    tomcat-isapi.reg_

  8. Using the IIS Management Console (e.g. in Windows 2000 Server: Start | Programs | Administrative Tools | Internet Services Manager), add a new virtual directory to your IIS web site.

    • The name of the virtual directory must be "jakarta."
    • Its physical path should be the directory where you placed isapi_redirect.dll, which in our example is "C:\jakarta-tomcat\bin\win32\i386."
    • While creating this new virtual directory assign it with execute access.

  9. Using the IIS Management Console, add "isapi_redirect.dll" as a filter in your IIS web site.

    • The name of the filter should reflect its task (e.g. "jakarta")
    • Its executable must match where you've placed the ISAPI filter, which in our example is C:\jakarta-tomcat\bin\win32\i386\isapi_redirect.dll.

  10. Exit the IIS Management Console and restart IIS (e.g. "net stop iisadmin /y" then "net start w3svc" from a Command Windows).
  11. Open the IIS Management Console and verify that the "jakarta" filter is marked with a green up-pointing arrow.
  12. Assuming that you've already deployed wdkSpace, try accessing the sample application without Tomcat's default port (i.e.  (i.e. http://localhost/wdkSpace42/wdkSpace/).