LDD Today


[Back to "Building real-time access to an LDAP directory server from your Notes application."]

The LDAPSearchWithFilter agent code
The following is the complete code example for the LDAPSearchWithFilter agent.

import lotus.domino.*;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import java.util.Vector;

public class LDAPSearchWithFilter extends AgentBase {

// Specify the search filter
String filter = "(|(cn="+searchCN+")(uid="+searchCN+"))";

// Search for objects using the above filter
NamingEnumeration answer = ctx.search("", filter, ctls);

findCN(answer, doc);
} // end of NotesMain

public static void findCN(NamingEnumeration enum, Document doc) {
} else { } } // end of findCN

public static void findAttrs(Attributes attrs, Document doc) {
} } // end of findAttrs

The Search LDAP button code
The following is the complete code example for the Search LDAP button.

Sub Click(Source As Button) End Sub

The Entering event code for the SearchCN field
The following is the code example for the Entering event of the SearchCN field.

The Exiting event code for the SearchCN field
The following is the code example for the Exiting event of the SearchCN field. The code is similar to the code for the Search LDAP button, but with additional string processing as follows:

'Get the updated field