Chapter 8: Processors


WEB·FM 4.0 introduces a new plug-in architecture for database level add-on Filter and Server-Side Include (SSI) Processors such as Maxum Development's NetCloak 2.5. Processors are separate web server plug-ins supporting the PIXO ("Plug-In Cross-Over") API standard for web server plug-ins to communicate and cooperate.

The value of Processors are that they offer extensibility to the capabilities of WEB·FM. Custom security or logging processors are good examples where a processor might prove useful. Off the shelf processors even exist like NetCloak 2.5. Keep these points in mind:

Installation

Processors are stand-alone plug-ins and need to be installed in the web server's "Plug-ins" folder. Plug-in services are named according to the ACTION they register at web server startup. These ACTION names must to be defined using the Plug-in services pop-up menu in the Admin database (shown below) before they can be called by WEB·FM.

WEB·FM includes Processor services pre-defined for "cookie" support and international character translations, among others. To enable a Processor, drag the plug-in into the web server's "Plug-ins" folder, restart the server, and update the Admin database with the plug-in service enabled for the desired database.

ENCODER PROCESSOR

ASCII is one encoding system for the standard characters in the range of zero to 127. Characters from 128 to 255 are defined differently for different operating systems, different languages, and different countries. Because of these differences, computers may encode values differently so they will not translate correctly without help.

The Encoder Processor plug-in offers the capability to perform character encodings on out-going HTML documents using a customizable character translation table. The Encoder plug-in can be called upon by WEB·FM to perform character encoding for improved international browser support.

A common character set for many types of software is the ISO Latin 1 character set as defined in the ISO 8859-1 (1987) standard. Included with the Encoder plug-in is an "Encoding Table" for translating from the MacRoman character set to the ISO Latin 1 character set. But because this table will not work for all countries, you can and should modify this table for your specific translation needs. Translation tables go into the "FM Prefs" folder in the server's "Plug-ins" folder. The Encoder plug-in expects the file to have a name of "Encoding Table".

A FileMaker Pro database is included with pre-defined entries for character encodings. Use this database to find and omit character encodings as you need. Use the "Export..." menu to export a new "Encoding Table".

TIP Refer to the chapter on Advanced Features for information on including custom HTTP response headers that include fields for specifying the "Content-Type" language for encodings.

DECODER PROCESSOR

The character mapping problems that exist between different operating systems and languages with regard to outgoing documents also exists for incoming requests. An accented character submitted with a Find or Add web form may not end up as the same character when viewed in the database. For this reason the Decoder plug-in can be installed with optionally a custom "Decoding Table" and called by WEB·FM for character translation services.

REPLACE PROCESSOR

The Replace plug-in is an additional Processor for miscellaneous search & replace services. Install and customize the "Replace Table" as needed.

FILTER PROCESSOR

The Filter Processor is pre-configured with a number of search & replace strings for incoming requests. Enable this Processor to use abbreviated, succinct URL's or to perform data manipulation tasks. Example substitutions might include:

"sort=down" "sortorder=descending"
"sort=up" "sortorder=ascending"
"&script=" "&doscript="
"op=" "operator="
"/00" "/2000"
"filter=today" "date=//&sort=date&sortorder=descending&max=10"
"filter=all" "sort=date&sortorder=descending&max=10&findall="
"filter=add" "client=[domain]&browser=[browser]&referer=[referer]"

COOKIECUTTER PROCESSOR

Included as a component of Got Cookies?, "CookieCutter" has a singular purpose to filter incoming database request arguments, replacing [cookie] tokens, if any, with the appropriate "cookie" value in the HTTP request header. The "cookie" MUST have a name equal to the database field you intend to use it with. This is because CookieCutter looks at the name portion of the incoming name/value pairs to determine which HTTP cookie value needs to replace the [cookie] token. In this example, the two [cookie] tokens are replaced by the corresponding cookies "user" and "referal" (if any) in the HTTP request header.

Example:

"user=[cookie]&referal=[cookie]"

Refer to Got Cookies? for information on how to set client-side cookie values.