Skip to main content

skip to main content

developerWorks  >  Information Management  >

Customize the eClient, Part 2: Set up an IBM Content Manager eClient development environment

developerWorks
Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
1.1MB (20 pages)

Get Adobe® Reader®

Document options requiring JavaScript are not displayed


Rate this page

Help us improve this content


Level: Intermediate

Guang Xu (xuguang@cn.ibm.com), Software Engineer, IBM Content Manager Development, IBM

10 Apr 2008

Learn step-by-step how to set up a customized development environment for the IBM® Content Manager eClient. In addition, you'll explore design and implementation considerations for the eClient development environment.

Development environment options

There are many options for development tools that can be used to customize eClient. It can be as simple as using a generic text editor or as complicated as using some J2EE software development tools. The following sections provide several options for a development environment, including some of the reasons to choose one over another. They also provide a detailed description of how to install, configure, and use some of the options.

Simple text editor and command-line tools

If you are making a small number of simple changes, there is no need to install and configure a J2EE development system. You can simply modify the JSPs in the WebSphere® directories with Notepad or your favorite editor. WebSphere automatically recompiles the JSP the next time the JSP is accessed. It is recommend that you use a text editor and command-line tools to get a quick start in development.

IBM Rational Software Development Platform

IBM Rational Software Development Platform Version 7.0 is the latest J2EE development platform from IBM. It is flexible and powerful. For serious software development, it is recommended that you use the IBM Rational Software Development Platform, which can be downloaded (try or buy) from the Rational Application Developer for WebSphere Software page.



Back to top


Use a simple editor and command-line utilities

If you are making simple changes to the application, this can be done by simply using Notepad or your favorite source code editor to modify the JSP files in the eClient. The JSP files are located in two main directories in your WebSphere directory.

After installing the eClient, the JSPs and other components of the eClient are stored as shown in Figure 1.


Figure 1. Standard location of eClient source files
Standard location of eClient source files

You can edit these JSP files with an editor. The next time the JSP files are accessed by eClient, they are re-compiled on the fly by WebSphere.

If there are compilation errors, you get an eClient error page. You need to check the stdout file configured in WebSphere for the eClient application. The default location for this file is C:\Program Files\IBM\db2cmv8\log\eclient\.

To debug the Java code in your JSP, use the following to write debug messages to the stdout file: System.out.println("test").



Back to top


Configure IBM Rational Software Development Platform for use with eClient

This section describes how to set up your development environment using IBM Rational Software Development Platform.

You can download a trial version or buy a version of IBM Rational Software Development Platform Version 6.0 from the Rational Application Developer for WebSphere Software page.

This article explains the architecture of IBM Rational Software Development Platform and how to set up your workbench and workspace preference. It covers IBM Rational Software Development Platform basic tooling and team environment along with the development and deployment of Web applications. This is where you can find out general information you need to know about programming and debugging your application in IBM Rational Software Development Platform.

Set up your eClient application in IBM Rational Software Development Platform

Once you have eClient and IBM Rational Software Development Platform V6.0 installed and working (that is, you can log on with eClient, search, and display documents from your back-end server), follow these steps to set up the eClient application in IBM Rational Software Development Platform:

  1. Start IBM Rational Software Development Platform:

    1. Select Start > Programs > IBM Rational > IBM Rational Application Developer V6.0 > Rational Application Developer.
    2. Enter a workspace location directory.
    3. Check Use this as the default and do not ask again, as shown in Figure 2. Click OK to continue.


    Figure 2. IBM Rational Software Development Platform — Set up workspace
    IBM Rational Software Development      Platform -- Set up workspace

  2. Import the eClient.ear file into IBM Rational Software Development Platform:

    1. Select File > Import. For Import Type, select the EAR file, and click Next.
    2. Use the Browse button to find the eclient.ear file. By default, it is C:\Program Files\IBM\db2cmv8\CMeClient\eclient.ear (see Figure 3).
    3. Enter eclient-Web as the project name, and click Next.

      Figure 3. IBM Rational Software Development Platform — Import eClient application — Step 1
      IBM Rational Software Development      Platform -- Import eClient application -- Step 1

    4. Click the button Select All (see Figure 4), and click Next.

      Figure 4. IBM Rational Software Development Platform — Import eClient application — Step 2
      IBM Rational Software Development      Platform -- Import eClient application -- Step 2

    5. Click Finish (see Figure 5).

      Figure 5. IBM Rational Software Development Platform — Import eClient application — Step 3
      IBM Rational Software Development Platform -- Import eClient application -- Step 3

    Note: This step may take 5 to 10 minutes to complete. The import process creates directories in your workspace directory and extracts eClient source files from the EAR file to these directories. When using IBM Rational Software Development Platform to modify eClient, you must edit this set of files and not the files in the WebSphere directories.

  3. Copy the following properties files: IDM.properties, IDMadminDefaults.properties, and languageMapping.properties from C:\Program Files\IBM\db2cmv8\CMeClient to eclient82\WebContent:
  4. Open the Web Perspective to view the project content and complete the following steps:

    1. Select Window > Open Perspective > Other....
    2. From the displayed list, select the Web perspective. It should look similar to Figure 6.


    Figure 6. IBM Rational Software Development Platform — Web perspective
    IBM Rational Software Development      Platform -- Web perspective

    You may notice several errors. This is normal until the rest of the setup steps are complete.

    The J2EE Navigator in the upper-left pane of the window (Figure 7) shows the content of the application. This is where you find the JSPs and any custom Java files that you add to your application. If you scroll down in the J2EE Navigator window, you see the JSPs that are included with the eClient. You can view and modify them from here.

    This is where you work during development. You can access the various source files from the J2EE Navigator window and edit the source in the editor. In the bottom-right pane, the Servers tab is where you start and stop the WebSphere test environment for testing your custom application.



    Figure 7. J2EE Navigator view
    J2EE Navigator view

  5. Turn off IBM Rational Software Development Platform validation by completing the following steps:

    1. From the J2EE Navigator window (Figure 7), right-click the eclient project and select Properties. The Properties for eclient window appears (as shown in Figure 8).
    2. Select Validation in the Properties for eclient window (Figure 8).
    3. Check Override validation preferences.
    4. Uncheck Run validation automatically when you save changes, if it is checked.
    5. Click Deselect All, then click Apply and OK.


    Figure 8. IBM Rational Software Development Platform eClient properties window
    IBM Rational Software Development Platform eClient properties window

  6. Delete unused help subdirectories.

    This is optional but recommended. Performing this step saves a lot of time in the next step when changing the project properties. To do this, perform the following steps:

    1. Open the J2EE Navigator pane and expand the eclient project.
    2. Expand Web Content > Help folder.
    3. Select all of the directories except your preferred language (in this example it is en) and onlineHelpFunctions.js, then click Delete, or right-click and select Delete (see Figure 9). To select multiple directory entries, hold down the Ctrl key while selecting each directory. This may takes a couple of minutes to complete.

    After completing this step, the J2EE Navigator window should include only one language. In this scenario, only the en (for English) directory still remains.



    Figure 9. Deleting the help folder from IBM Rational Software Development Platform
    Deleting the help folder from IBM Rational Software Development Platform

  7. Specify the JAR files required by the eClient in the Properties window by completing the following steps:

    1. From the J2EE Navigator view, right-click the eclient project, and select Properties.

      Figure 10. Adding JAR files to IBM Rational Software Development Platform properties
      Adding JAR files to IBM Rational Software Development Platform propertiesm

    2. Select Java Build Path in the list in the left-hand pane (see Figure 10).
    3. Select the Libraries tab on the right.
    4. Click Add External JARS, and add the following JAR files from the C:\Program Files\IBM\db2cmv8\lib directory:
      • cmb81.jar (Yes, the files are named 81 even though this is for 8.3 or 8.4.)
      • cmbsdk81.jar
      • cmbview81.jar
      • log4j-1.2.8.jar (This is required only if you enable log4j logging.)
      • cmblog4j81.jar (This is required only if you enable log4j logging.)
    5. Click Add External JARS again, and add the framework.jar JAR file from the C:\Program Files\IBM\db2cmv8\config directory.
    6. Click OK at the bottom of the Properties window.
  8. Configure a test environment in IBM Rational Software Development Platform:

    When you execute an application in IBM Rational Software Development Platform, do not run it in your normal WebSphere environment. IBM Rational Software Development Platform creates a test environment in which you can run your application. The test environment includes an HTTP server and WebSphere Application Server environment. IBM Rational Software Development Platform can support multiple test environments for different levels of WebSphere Application Server, allowing you to test the application in the same environment you deploy your application to.

    To create a IBM Rational Software Development Platform test environment, perform the following steps:

    1. Select File > New > Other > Server, then click Next.
    2. For the server type, select WebSphere v5.1 Test Environment (see Figure 11). If you plan to use a WebSphere Application Server version other than the default, select the version you plan to deploy here, then click Next.

      Figure 11. Creating test environment server configuration
      Creating test environment server configuration

    3. Get to the HTTP server port number, and the default port number is 9080. Click Next.
    4. Select eclient-Web on the left, and click Add.
    5. Click Finish.
    6. Select Window > Open Perspective > Debug.
    7. In the Server Configurations pane on the upper left of the window, right-click WebSphere v5.1 Test Environment, and select Open.
    8. From the middle pane in the window, select the Environment tab, and in the WebSphere-specific classpath section click Add External Folder....,navigate to C:\Program Files\IBM\db2cmv8\cmgmt, and click OK.
    9. Click Add External JARS. Add the corresponding files from various directories as specified in Table1, and click Open.


    Table 1. External JARs needed to add to the class path
    Directory Files
    C:\Program Files\IBM\db2cmv8\libcmb81.jar; cmbsdk81.jar; cmbview81.jar; log4j-1.2.8.jar
    C:\Program Files\IBM\SQLLIB\javadb2java.zip




    Figure 12. WebSphere Studio Application Developer classpath configuration
    WebSphere Studio Application Developer classpath configuration

  9. Test the eClient environment in IBM Rational Software Development Platform:

    • Select Window > Open Perspective > debug.
    • Stop the WebSphere Application Server service highlighted in Figure 13. With the service stopped, you cannot run the WebSphere Application Server Administration Console. This is because you cannot run the WebSphere Application Server Administration Console and the WebSphere Studio Application Developer test environment at the same time.


    Figure 13 . Stop WebSphere Application Server service
    Stop WebSphere Application Server service

    • Start the IBM Rational Software Development Platform test environment.

    In the Server pane, right-click WebSphere v5.1 Test Environment in the left pane, then select Start to start the test environment.

    • To execute the eClient in your WebSphere Studio Application Developer workspace, open a Web browser, and enter http://hostname:9080/eclient/IDMInit
    • To execute the eClient in the production environment, enter http://hostname:9082/eclient/IDMInit.

Test changes to JSP files

To test this, make a simple change to a JSP file.

In IBM Rational Software Development Platform, open the Web perspective. Scroll down in the J2EE Navigator window until you find IDMLogon2.jsp. This is the JSP that builds the logon window for the eClient.

In the following example, the label for the user ID field is changed from "User ID" to "USER ID" (see Figure 14).


Figure 14. IDMLogon2.jsp in WebSphere Studio Application Developer
IDMLogon2.jsp in WebSphere Studio Application Developer

To change the label, do the following:

  1. Locate the following line in IDMLogon2.jsp by searching for LogonJSP_UserIDPrompt:

    <label for="userid"><%= cub.getIdmResourcesString("LogonJSP_UserIDPrompt") %>

    and replace it with this:

    <label for="userid">USER ID

  2. Press Ctrl+S from the editor window to save the changes. Check the servers of IBM Rational Software Development Platform to be sure your WebSphere test environment is started. Right-click the server, and click Start if it is not started. Go back to the Web browser and enter the following URL to log on to the eClient: http://hostname:9080/eclient/IDMInit

    The original logon window is shown in Figure 15.



    Figure 15. Standard eClient logon window
    Standard eClient logon window

    The new logon window is shown in Figure 16, with the label for the USER ID field all in uppercase. Note that the JSP is compiled by WebSphere when the new file is accessed.



    Figure 16. Modified IDMLogon2.jsp specifying uppercase label for user ID
    Modified IDMLogon2.jsp specifying uppercase label for user ID

    If the user ID is not uppercase, check the following:

    • Make sure you saved the new IDMLogon2.jsp file.
    • Make sure you specified the correct port for your IBM Rational Software Development Platform environment. If you are not sure, stop the IBM Rational Software Development Platform test environment from the servers pane and try to log on using the same URL. It should not be able to find the Web page at all. If it does find the Web page, you are using the URL from another instance of WebSphere Application Server.


Back to top


Deploy customized eClient to another system

If you are modifying a few JSP files, you do not need to create a new .ear file for your Web application. You can copy the new JSPs to the installedApps directory of the target WebSphere environment.

If you add a custom JSP or servlet to eClient, you can create a new eClient .ear file, which can then be deployed to WebSphere. If you add a servlet, a new .ear file must be created and deployed to WebSphere.

If you are using IBM Rational Software Development Platform for development, it can create a new .ear file that includes the files you modified or added to eClient using IBM Rational Software Development Platform. To do this, right-click the eclient project in IBM Rational Software Development Platform, select Export..., and use the GUI to create a new .ear file.



Back to top


Conclusion

In Part 2 of this series, you have looked into the eClient development environment. This article has demonstrated in detail how to set up an eClient development environment and how to configure IBM Rational Software Development Platform, and illustrated a small example for the modification of a JSP file.



Resources

Learn

Get products and technologies

Discuss


About the author

Author Photo: Xu Guang

Xu Guang works as a Content Manager eClient developer in IBM China Software Development Lab (CSDL).




Rate this page


Please take a moment to complete this form to help us better serve you.



YesNoDon't know
 


 


12345
Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top