CFCOLLECTION

The CFCOLLECTION tag allows you to create and administer Verity collections.

Syntax

<CFCOLLECTION ACTION="action"
    COLLECTION="collection"
    PATH="implementation directory"
    LANGUAGE="language">

ACTION

Required. Specifies the action to perform:

COLLECTION

Required. Specifies a collection name or an alias if the ACTION is MAP.

PATH

Required for CREATE and MAP. Specifies a path to the Verity collection. The effect of the PATH attribute depends on the ACTION that you specify.

ACTION What happens?
CREATE
CFCOLLECTION creates a directory for the use of Verity. The directory path is composed of the directory path specified in the PATH attribute with the name specified in the COLLECTION attribute appended to it. Thus, the full directory path is "path_name\collection_name\." For example, if the path name is "C:\Col\," and the collection name is "myCollection," the full directory path is "C:\Col\myCollection\."
MAP
The MAP action provides a name with which ColdFusion can reference an existing collection. This name is specified with the COLLECTION attribute. It is an alias for the collection, which can be used in CFINDEX, and to re-instate a collection after you have re-installed ColdFusion. The directory path specified with the PATH attribute is the full path name of the Verity directory. Therefore, to reference the directory created in the previous example, specify "C:\Col\myCollection\."

LANGUAGE

Optional for CREATE. To use the LANGUAGE attribute you must have the ColdFusion International Search Pack installed. Valid entries are:

Usage

CFCOLLECTION works at the collection level only. To add content to a collection, use CFINDEX.

Note the following regarding mapped collections:

Example

<!--- This example shows the basic functionality
of the CFCOLLECTION tag (create, repair, optimize, delete) --->
<HTML>
<HEAD>
    <TITLE>CFCOLLECTION</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFCOLLECTION</h3>

<!--- see if a collection name has been specificied ... --->
<CFIF IsDefined("form.CollectionName") AND
IsDefined("form.CollectionAction")>
    <CFIF form.CollectionName is not "">
        <CFOUTPUT>
        <CFSWITCH EXPRESSION=#FORM.CollectionAction#>
          <CFCASE VALUE="Create">
            <CFCOLLECTION ACTION="CREATE"
             COLLECTION="#FORM.CollectionName#"
             PATH="C:\CFUSION\Verity\Collections\">
            <H3>Collection created.</H3>
          </CFCASE>
          <CFCASE VALUE="Repair">
            <CFCOLLECTION ACTION="REPAIR"
             COLLECTION="#FORM.CollectionName#">
            <H3>Collection repaired.</H3>
          </CFCASE>
          <CFCASE VALUE="Optimize">
            <CFCOLLECTION ACTION="OPTIMIZE"
             COLLECTION="#FORM.CollectionName#">
            <H3>Collection optimized.</H3>
          </CFCASE>
          <CFCASE VALUE="Delete">
            <CFCOLLECTION ACTION="DELETE"
             COLLECTION="#FORM.CollectionName#">
           <H3>Collection deleted.</H3>
          </CFCASE>
        </CFSWITCH>
...