Creating single-table databases in FileMaker is straightforward. The first step is to define the fields in the table. In this case, I created a text field for each of the pieces of data in the spec, plus an auto-incrementing ID field. The second step, which is not always necessary, is to revise the layout. Fields that have been defined are automatically added to the layout, but not necessarily in a usable manner.
FileMaker can be used to create a relational database as well as a the single-table one used in this situation. This requires a couple of extra steps, but is still fairly straightforward.
This file can be opened by any FileMaker client with access to the directory. Our real-life configuration is slightly different. Our FileMaker databases are hosted on a dedicated FileMaker server which allows multiple people to access them over the network.
![]()
Export of the data from FileMaker
[top]
FileMaker includes a scripting language that can control data exports. These scripts can also be triggered by an event, such as closing a database file.
To set up the export of data, I first created a script that would export a tab delimited file to a directory on the web server. Second, in the Document Preferences, I set the script to execute when the file was closed. The net result is that the tab delimited file is updated every time a person finishes working in FileMaker.
In our real-life setup, this is one of the major points at which we include business logic. The export script will include filters that determine which data is exported to be visible on the web.
![]()
Creation of an ODBC datasource
[top]
ColdFusion (Professional Edition) is compatible with any ODBC data source. To make the data in the tab delimited file exported from FileMaker accessible to ColdFusion, I set up a text data source. This took several steps. First, I created and configured a System DSN named 'ACSF' using the Microsoft text driver. This is also possible to to through the ColdFusion Administrator, but I have found that it does not work well for text data sources. The Microsoft ODBC text driver treats an entire directory as a database, and each compatible file within it as a table. The net result is that the table 'codeoff.tab' is available to ColdFusion within a datasource called 'ACSF.' Second, I edited the schema.ini file to define field names for codeoff.tab.
In our real-life setup, we have a directory already defined as an ODBC text datasource. When we add an export from FileMaker, we skip the first step of this process and update. We only need to edit the schema.ini file to include information on the newly exported data.
![]()
Creation of the web interface
[top]
The address book is handled within a single URL, http://www.ssw.umich.edu/ssw-web/acsf/index.html. Based on the presence of a the URL variable "id," a template for the summary or detail listing is called.
|
Index Page/Summary List
[top]
The summary template (_list.cfm) contains two primary components.
First, it queries the database "ACSF" to get the firstname, lastname,
and id field of every entry in codeoff.tab. Second it uses a <cfoutput>
statement to loop over the data rows returned by the query, and output an
item in a bullet list for each one.
|
Detail Page
[top]
The detail template starts with a section checking the validity of the URL data passed to it. Otherwise, it is very similar to the summary template. It has two primary parts: a query, followed by an output of the data from the query. The primary difference is that the query is constructed to return a single record based on a url variable. The output section then displays the detail data returned by the query.
|
![]()
How this process fits in with our existing site
[top]
This address book application is a very simplified model of our data / web infrastructure. The three differences are:
![]()
Pros and Cons of this system
[top]
Pros