Programmer Reference : LDAP : Setting up the Example
Setting up the Example
The sample use cases need the following components:
An LDAP server with a directory of data
LDAP implementation in VAST Platform
Smalltalk sample use cases which exercise the previous two components.
The sample data referenced can be found in <varoot>/samples/ldap/exampleData.ldif where varoot is the root directory of the product installation. (See Installation Guide for further information).
The LDAP implementation is found in the LDAP Support feature. The Smalltalk sample use cases are in a separate configuration map named ENVY/Image LDAP Examples. The EsLdapExamples class implements the sample use cases.
To set up the example
1. Install and start Apache Directory Studio and populate it with the sample data. Apache Directory Studio performs the role of the server for the examples.(See See <varoot>/samples/ldap/ldap.rtf for instructions.)
2. Load the LDAP Support feature to get access to the LDAP implemantation
3. Load the example code (EsLdapExamples) found in the configuration map ENVY/Image LDAP Examples into the image.
That’s it. You are ready to run the LDAP samples.
Example overview
Open a hierarchy browser on EsLdapExamples and look at the class methods. Many sample use cases of LDAP are in these Example methods. The pattern in each use case is to create an LdapSession and bind it to the server before accessing the data provided by the server and then to unbind the session from the server at the end of the example.
Data, in the form of LdapEntry instances, may be accessed as part of a search or from retrieving child entries from their parent LdapEntry (or parent LdapEntry from its child). New data in the expressed as LdapEntry instances can be presented to the session for incorporation into the LDAP directory of information. Likewise, entries can be modified or entirely deleted from the server's data.
All these use cases are represented in the EsLdapExamples.
Advanced Setup Topics
The abt.ini file is used to configure the LDAP dll used in the Smalltalk LDAP implementation, as well as the host and port over which the data is transferred between client and server. It is set up properly for these samples. However, it is possible to configure the LDAP implementation to adapt to other configurations. Here is how.
The VAST LDAP code has been tested with both the Window LDAP dll (wldap32) and on Linux with the dll from openLdap.org (libldap). The logical name LDAP_LIB must reference one of these dlls must be in the abt.ini file under the [PlatformLibrary Name Mappings] stanza. For instance, here is the setting for Windows:
[PlatformLibrary Name Mappings]
;windows
LDAP_LIB=wldap32
 
The abt.ini file also contains the stanza [ldap]. Depending on how the LDAP server is set up, hostName and portNumber may need to change for a VAST application using the LDAP feature and making requests to a server on a different machine or over a different port. Here are the hostName and portNumber set appropriately for the example.
[ldap]
hostName='127.0.0.1'
portNumber=389
 
Last modified date: 03/17/2021