Prev Up Next Index
Go backward to The ASCII Data Filter
Go up to 4.1 Data Servers
Go forward to 4.1.5 Documenting Your Work

4.1.4 The Usage Filter

Client requests containing a .info suffix should return to the client HTML text containing documentation of both the server usage and the dataset named in the query. DODS provides a usage filter that can be used for this purpose. The DODS_Dispatch class invokes this filter.

The DODS-provided usage filter accepts two arguments, the data file name requested and the name of the CGI script (the dispatch CGI) in use:

usage filename CGI-name

The usage filter looks in the dataset directory for a file called filename.html, and in the directory specified in the CGI-name argument for a file called CGI-name.html. These two files must contain HTML, but without the <html>, <head> or <body> tags.

For example, suppose a dispatch CGI using the DODS_Dispatch class receives a URL like this:

http://dods/cgi-bin/nph-nc/data.info

In this case, the usage filter looks for two files: cgi-bin/nph-nc.html and data.html (the htdocs directory is assumed in the second case). The contents of these two files are concatenated with an HTML representation of the DAS and DDS for the data.nc file, and the whole thing is returned to the client. If the HTML files are not found, the returned document contains only the DAS and DDS.


Tom Sgouros, July 2, 2004

Prev Up Next