Setup for Rich UI access to LDAP

Configuring this project takes approximately 5 minutes.

Before you begin

The Rich UI access to LDAP sample requires the following:
  • LDAP-compliant server
  • IBM® WebSphere® Application Server
  • com.ibm.egl.rui project in your workspace

If you do not have an LDAP-compliant server, you can use an open-source server (such as ApacheDS), and a client (such as Apache Directory Studio) that provides access to that server. To install ApacheDS and Apache Directory Studio, see Configuring LDAP-compliant software.

Verify that you have the WebSphere Application Server feature installed and that the runtime environment is specified.
  • The features are listed during the installation process and the installed feature must match the level of the WebSphere Application server. To see which features are installed, start IBM Installation manager. Click File > View Installed Packages > IBM Rational Business Developer. If you do not have the appropriate feature installed, use the IBM Installation Manager Modify function to install the feature.
  • To specify the location of the application server, click Window > Preferences > Server > Runtime Environments.. Select the appropriate server and type the location.

The com.ibm.egl.rui project is created automatically when you use the Create an EGL Rich UI project wizard. If you do not have this project, click Get the dependency project to import it into your workspace on the Rich UI access to LDAP page.

About this task

To run the sample, do the following:

Procedure

  1. To import the sample projects into your workspace on the Rich UI access to LDAP page, click the Get the sample link. Allow the workspace migration tool to perform any necessary migration. . If the workspace migration tool prompts you to select a runtime server, select the WebSphere Application Server that you are using to run this sample.
  2. If the default port for your WebSphere Application Server is not 9080, do the following:
    1. Double click WebBindings.egl in the LdapRuiSample/EGLSource/bindings folder to open the EGL Editor.
    2. Change the port in constant ldapUri to the one used by your runtime server.
    3. Close the file, saving the changes.
    4. Double click on LdapRuiSample.egldd in the LdapRuiSample/EGLSource folder to open it in the EGL Deployment Descriptor Editor.
    5. Click the Service Binding tab and change the port in the base URI to the one used by your runtime server.
    6. Close the file, saving the changes.
    You can find the default port for your runtime server using the Administrative Console.
  3. If you use an existing LDAP-compliant server go to the LdapRuiServices project, open the following files and make sure that the content is appropriate for your server:
    • EGLSource/libraries/LdapLoginLib.egl, where you might need to change the following providerURL entry
      providerUrl String = "ldap://localhost:389/o=sample";
    • EGLSource/libraries/UserObjectLib.egl
  4. In your LdapRuiSample project, find the SampleCompany.ldif file. From that file, import the sample data.
    • If you use an existing LDAP-compliant server, import the sample data from SampleCompany.ldif file, which is in the following location:
      workspace/LdapRuiSample/
      Note: workspace is the fully qualified path name of your EGL product workspace (for example, C:/MyWorkspace).
    • If you use the open-source Apache software for demonstration purposes, import the sample data onto your ApacheDS directory server by following the instructions in Importing sample data using Apache Directory Studio.
  5. To generate Java™ code into LdapRuiServices for the web services in the project, right click LdapRuiServices, and then click Generate.
  6. To generate JavaScript code into LdapRuiSample for the parts in the project, right click LdapRuiSample, and then click Generate.
  7. Update the EGL deployment descriptor in LdapRuiSample
    1. Double click LdapRuiSample.egldd to open the EGL deployment descriptor editor.
    2. Ensure that the Target project radio button is selected.
    3. Click New and type LdapRuiDeployed in the Project name field.
    4. Select a specific version of WebSphere Application Server as the runtime server. The value for Dynamic web module version is 2.5 for versions at or greater than 7.0.
    5. Ensure that the Add project to an EAR checkbox is checked.
    6. Click New Project and type LdapRuiDeployedEAR in the Project name field.
    7. Click Finish to create the EAR project.
    8. Click Finish to create the dynamic web project.
    9. Ensure that LdapRuiDeployed is specified as the target project and then close the deployment descriptor editor, saving the changes.
  8. Deploy the Rich UI application:
    1. Select LdapRuiSample.egldd .
    2. Right click and select Deploy EGL Descriptor.
    The LdapRuiDeployed and LdapRuiDeployedEAR projects are displayed in your workspace.
  9. Add LdapRuiDeployedEAR and LdapRuiServicesEAR to your IBM WebSphere Application Server as follows:
    1. In the Servers view, right click you WebSphere Application Server then click Add and Remove Projects.
    2. Click LdapRuiDeployedEAR > Add.
    3. Click LdapRuiServicesEAR > Add.
    4. Click Finish.
  10. In the Servers view, start your WebSphere Application Server.
  11. Run the sample Rich UI application:
    1. Expand the LdapRuiDeployed project and WebContent.
    2. Right click SampleCompany-en_US.html then click Run As > Run on Server.
    3. Make sure that your WebSphere Application Server is selected. Click Finish.
    4. On the Sample Company login page, type a user ID that is stored in the LDAP-compliant server (for example, msmith) and use the password pass for whichever name you use. Click Log in.
    The data that is associated with the user ID is displayed. You can use Apache Directory Studio to see other sample user IDs that are stored in the LDAP-compliant directory. To see the data for other users, enter other user IDs and use pass for the password. The fields that are shown for employees vary from those shown for customers.

    To prevent an authentication error, make sure that the ApacheDS directory server is started. For the instructions to start the server, see the end of Configuring LDAP-compliant software.


Feedback