Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 509

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
When creating an index from an LDAP query, remember the following considerations:
• Because LDAP structures vary greatly, you must know the directory schema of the server and the exact name of
every LDAP attribute that you intend to use in a query.
• The records on an LDAP server can be subject to frequent change.
In the following example, the search criterion is records with a telephone number in the 617 area code. Generally,
LDAP servers use the Distinguished Name (
used as the
value for the index.
key
<!--- Run the LDAP query. --->
<cfldap name="OrgList"
server="myserver"
action="query"
attributes="o, telephonenumber, dn, mail"
scope="onelevel"
filter="(|(O=a*) (O=b*))"
sort="o"
start="c=US">
<!--- Output query record set. --->
<cfoutput query="OrgList">
DN: #dn# <br>
O: #o# <br>
TELEPHONENUMBER: #telephonenumber# <br>
MAIL: #mail# <br>
=============================<br>
</cfoutput>
<!--- Index the record set. --->
<cfindex action="update"
collection="ldap_query"
key="dn"
type="custom"
title="o"
query="OrgList"
body="telephonenumber">
<!--- Search the collection. --->
<!--- Use the wildcard * to contain the search string. --->
<cfsearch collection="ldap_query"
name="s_ldap"
criteria="*617*"
maxrows = "100">
<!--- Output returned records. --->
<cfoutput query="s_ldap">
#Key#, #Title#, #Body# <br>
</cfoutput>
Indexing cfpop query results
The contents of mail servers are volatile; specifically, the message number is reset as messages are added and deleted.
To avoid mismatches between the unique message number identifiers on the server and in the Verity collection,
reindex the collection before processing a search.
) attribute as the unique identifier for each record so that attribute is
dn
Last updated 1/20/2012
504

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents