![]() ![]() ![]() |
ColdFusion provides two interfaces for creating a Verity collection. You can make selections on the ColdFusion Administrator Verity page or code the CFCOLLECTION tag.
Open the ColdFusion Administrator Verity page. If you checked the option to install the ColdFusion Documentation, the documentation collection is listed by default. The Verity engine is used to search our online documents.
\Cfusion\Verity\Collections\
.
You can easily enable access to a collection on the network by creating a local reference (an alias) for that collection. It only needs to be a valid Verity collection; it doesn't matter whether it was created within ColdFusion or another tool.
If the collection is subsequently moved, the alias path must be updated. The Delete command, when used on a mapped collection, only deletes the alias.
Creating and maintaining collections from a CFML application eliminates the need to access the ColdFusion Administrator. This can be an advantage when you need to schedule these tasks or to allow users to perform them without exposing the Administrator.
With the introduction of CFCOLLECTION, Verity tasks can now be grouped in a more logical way. CFCOLLECTION can be used for collection creation and maintenance and CFINDEX can be used to populate and update collections.
The valid values for the ACTION attribute are:
The CREATE and MAP actions require a collection name and path. The MAP action additionally requires an alias name. The LANGUAGE attribute is required for data in languages other than English. Only the ACTION and COLLECTION attributes are required for maintenance tasks.
<CFCOLLECTION ACTION="action" COLLECTION="collection" PATH="implementation directory" LANGUAGE="language">
This example processes input from a form. Notice the use the new CFSWITCH tag to control page flow.
<HTML> <HEAD> <TITLE>CFCOLLECTION</TITLE> </HEAD> <BODY> <H1>CFCOLLECTION</H1> <CFOUTPUT> <CFSWITCH EXPRESSION=#FORM.CollectionAction#> <CFCASE VALUE="Create"> <CFCOLLECTION ACTION="Create" COLLECTION="#FORM.CollectionName#" PATH="C:\CFUSION\Verity\Collections\"> </CFCASE> <CFCASE VALUE="Repair"> <CFCOLLECTION ACTION="REPAIR" COLLECTION="#FORM.CollectionName#"> <P>Collection repaired. </CFCASE> <CFCASE VALUE="Optimize"> <CFCOLLECTION ACTION="OPTIMIZE" COLLECTION="#FORM.CollectionName#"> <P>Collection optimized. </CFCASE> <CFCASE VALUE="Delete"> <CFCOLLECTION ACTION="DELETE" COLLECTION="#FORM.CollectionName#"> <P>Collection deleted. </CFCASE> </CFSWITCH> </CFOUTPUT> </BODY> </HTML>
The CFCOLLECTION tag operates at the collection level. To add content to a collection, use the CFINDEX tag.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.