Accessibility
Brian Szoszorek

Brian Szoszorek

newpointmedia.com

Table of Contents

Created:
16 October 2006
User Level:
Intermediate
Products:
Coldfusion

Harnessing the power of Verity, ColdFusion event gateways, and Flex 2 – Part 1: Setting up the collection and event gateway

Macromedia ColdFusion comes packed with rich features that enable developers to quickly create powerful web applications. One of the most powerful features in ColdFusion is the built-in Verity search technology. Since the early days of ColdFusion, Verity has been an effective tool for enhancing dynamic ColdFusion web applications. With the release of ColdFusion MX 7, the ColdFusion team made great enhancements by implementing the latest Verity K2 Enterprise 5.5 release.

Another new feature to ColdFusion MX 7 are event gateways, which allow your ColdFusion applications to react to events outside HTTP requests. The DirectoryWatcher event gateway monitors a file system, for instance. When a monitored file changes, the DirectoryWatcher event gateway detects the change and invokes a designated ColdFusion component. This component can receive arguments about the file system event.

Now if you have a Verity collection for a set of documents and the documents change, you typically need to tell Verity to reindex its collection. Normally there are two ways of doing this:

  • You can log in to the ColdFusion Administrator, select the Verity interface, and click Optimize to refresh each collection. Of course, this means someone has to be notified when the change occurs to carry out this step.
  • You can set a scheduled task to run at a defined interval and refresh the collection. With this option, you have ColdFusion and Verity doing work that may be unnecessary if no file changes have occurred. It is not a very efficient solution.

This is part one of a two-part series. In part one, I show you how easy it is to implement a third solution—through event gateways. Here you create a DirectoryWatcher event gateway to watch the directory(s) where your documents reside. If a change occurs, the CFC (ColdFusion component) listener will refresh the Verity collection. This way, you efficiently automate the process of refreshing your Verity collections. In part two, you will add a Flex 2 interface that will expose the power of ColdFusion and Verity through a rich easy use document search application.

In this article, you will learn:

  • How to set up a Verity collection
  • Create a ColdFusion component to handle Verity requests
  • Set up an event gateway to monitor your documents and refresh Verity collections only when a file change occurs

Requirements

To complete this tutorial you will need to install the following software and files:

ColdFusion MX 7 Enterprise

Sample files:

Prerequisite knowledge

  • Basic understanding of ColdFusion
  • Basic knowledge of ColdFusion components (CFCs)

About the author

Brian Szoszorek has been developing ColdFusion applications since 2000. He is a certified ColdFusion developer and the chief technologist of New Point Media. He has worked and provided consulting services to companies such as New Era Cap Company, XL Capital, Spire Systems, and Adobe Systems. Brian is a strong evangelist for how ColdFusion, Flex, Adobe AIR, and the Flash Platform as they provide higher productivity and richer experiences compared to competing technologies.