User Guide

Table Of Contents
556 Chapter 24: Building a Search Interface
You can create a collection by directly assigning a value to the collection attribute of the
cfcollection tag, as shown in the following code:
<cfcollection action = "create"
collection = "a_new_collection"
path = "c:\CFusionMX7\verity\collections\">
If you want your users to be able to dynamically supply the name and location for a new
collection, use the following procedures to create form and action pages.
To create a simple collection form page:
1.
Create a ColdFusion page with the following content:
<html>
<head>
<title>Collection Creation Input Form</title>
</head>
<body>
<h2>Specify a collection</h2>
<form action="collection_create_action.cfm" method="POST">
<p>Collection name:
<input type="text" name="CollectionName" size="25"></p>
<p>What do you want to do with the collection?</p>
<input type="radio"
name="CollectionAction"
value="Create" checked>Create<br>
<input type="radio"
name="CollectionAction"
value="Optimize">Optimize<br>
<input type="submit"
name="submit"
value="Submit">
</form>
</body>
</html>
2.
Save the file as collection_create_form.cfm in the myapps directory under the web root
directory
.
Note: The form will not work until you write an action page for it, which is the next procedure.