Adobe COLDFUSION 9 Manual page 508

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
<cfquery name="getEmps" datasource="cfdocexamples">
SELECT * FROM EMPLOYEE WHERE Emp_ID = 15
</cfquery>
<!--- Update the collection with the above query results. --->
<!--- Key specifies a column that contains a directory path. --->
<cfindex
query="getEmps"
collection="CodeColl"
action="update"
type="path"
key="Project_Docs"
title="Project_Docs"
body="Emp_ID,FirstName,LastName,Project_Docs">
<h2>Indexing Complete</h2>
<p>Your collection now includes the following items:</p>
<cfoutput query="getEmps">
<p>#Emp_ID# #FirstName# #LastName# #Project_Docs#</p>
</cfoutput>
Save the file as indexdir.cfm in the myapps directory.
2
The ColdFusion
tag indexes the contents of the specified directory path.
cfindex
Search and display the directory path
1
Create a ColdFusion page that contains the following content:
<cfsearch
collection="#Form.collname#"
name="getEmps"
criteria="#Form.Criteria#"
maxrows = "100">
<!--- Output the directory path contained in the record set. --->
<cfoutput>
Your search returned #getEmps.RecordCount# file(s).
</cfoutput>
<cfoutput query="getEmps">
<p><table>
<tr><td>Title: </td><td>#Title#</td></tr>
<tr><td>Score: </td><td>#Score#</td></tr>
<tr><td>Key: </td><td>#Key#</td></tr>
<tr><td>Summary: </td><td>#Summary#</td></tr>
<tr><td>Custom 1:</td><td>#Custom1#</td></tr>
<tr><td>Column list: </td><td>#ColumnList#</td></tr>
</table></p>
</cfoutput>
Save the file as displaydir.cfm.
2
Indexing query results obtained from an LDAP directory
The widespread use of the Lightweight Directory Access Protocol (LDAP) to build searchable directory structures,
internally and across the web, gives you opportunities to add value to the sites that you create. You can index contact
information or other data from an LDAP-accessible server and let users search it.
Last updated 8/5/2010
503

Advertisement

Table of Contents
loading

Table of Contents