Adobe COLDFUSION 9 Manual page 489

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
2
Save the file as collection_create_form.cfm in the myapps directory under the web root directory.
Note: The form does not work until you write an action page for it, which is the next procedure.
Create a collection action page
1
Create a ColdFusion page with the following content:
<html>
<head>
<title>cfcollection</title>
</head>
<body>
<h2>Collection creation</h2>
<cfoutput>
<cfswitch expression=#Form.collectionaction#>
<cfcase value="Create">
<cfcollection action="Create"
collection="#Form.CollectionName#"
path="c:\CFusion\verity\collections\">
<p>The collection #Form.CollectionName# is created.</p>
</cfcase>
<cfcase value="Optimize">
<cfcollection action="Optimize"
collection="#Form.CollectionName#">
<p>The collection #Form.CollectionName# is optimized.</p>
</cfcase>
<cfcase value="Delete">
<cfcollection action="Delete"
collection="#Form.CollectionName#">
<p>The collection is deleted.</p>
</cfcase>
</cfswitch>
</cfoutput>
</body>
</html>
Save the file as collection_create_action.cfm in the myapps directory under the web root directory.
2
3
In the web browser, enter the following URL to display the form page:
http://hostname:portnumber/myapps/collection_create_form.cfm
4
Enter a collection name; for example, CodeColl.
Verify that Create is selected and submit the form.
5
(Optional) In the ColdFusion Administrator, reload the ColdFusion Collections page.
6
The name and full path of the new collection appear in the list of Verity Collections.
You successfully created a collection, named CodeColl, that currently has no data.
Last updated 8/5/2010
484

Advertisement

Table of Contents
loading

Table of Contents