Chapter 16: Connecting to LDAP Directories
255
Although sophisticated search criteria can be constructed from these filter operators,
performance may degrade if the LDAP server is slow to process the synchronous
search routines supported by CFLDAP. The TIMEOUT and MAXROWS attributes can
be used to control query performance.
The following uses CFLDAP to retrieve the name and telephone numbers for US
organizations with a common name that starts with ’A’ through ’E’. The search starts
in the country: US. The filter is a regular expression that limits the search to
expressions of any length that begin with "A," "B," "C," "D," or "E."
To query an LDAP directory:
1.
Open a new file in Studio.
2.
Modify the file so that it appears as follows:
<CFLDAP NAME="OrgList"
SERVER="ldap.itd.umich.edu"
ACTION="QUERY"
ATTRIBUTES="o,st,telephoneNumber"
SCOPE="ONELEVEL"
FILTER="(|(o=A*)(o=B*)(o=C*)(o=D*)(o=E*))"
MAXROWS=200
SORT="o"
START="c=US">
<HTML>
<HEAD>
<TITLE>LDAP Directory Example</TITLE>
</HEAD>
<BODY>
<H3>US Organizations beginning with
the letter ’A’ thru ’E’:</H3>
*
o=alla* - organization names starting with "alla"
o=*aire - organization names ending with "aire"
o=all*aire - organization names starting with "all and " ending with
"aire"
&
(&(o=allaire)(co=usa)) - organization name = "allaire" AND country =
"usa"
|
(|(o=allaire)(sn=allaire)) - organization name = "allaire" OR surname =
"allaire"
!
(!(STREET=*)) - all entries that do NOT contain a StreetAddress attribute
CFLDAP Filter Operators (Continued)
Operator
Example
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...