#!/usr/local/bin/perl # # -*- Perl -*- # # Do dispatch for DODS servers. Use the `MIME type extension' of the URL to # select the correct DODS server program. This dispatch cgi assumes that the # DODS data server consists of three programs: *_das, *_dds and *_dods, where # `*' is the root name of the dispatch program. Each of these programs takes # one or two arguments; a file name and possibly a query string. # # A Url is handled thus: # http://machine/cgi-bin/nph-nc/file.nc.dods?val # ^^ ^^^^^^^ ^^^^ ^^^ # | | | \ # | | \ - Constraint expression (arg 2) # | | - selects filter (e.g., nc_*dods*) # | \ # \ - File to open (arg 1) # - Root name of the filter (e.g., *nc*_dods) # # NB: This script assumes that all data is rooted in the http document # directory subtree. If you want to access files outside that subtree, use a # symbolic link and make sure that your server is set to follow symbolic # links. To configure your server to follow symbolic links, add # FollowSymLinks to the Options in the access.conf file. # # Base on nph-nc, Reza URI # # $Id: nph-ff,v 1.4 1998/08/12 21:21:17 jimg Exp $ # # $Log: nph-ff,v $ # Revision 1.4 1998/08/12 21:21:17 jimg # Massive changes from Reza. Compatible with the new FFND library # # Revision 1.3 1998/04/16 18:11:25 jimg # Sequence support added by Reza # use Env; use DODS_Dispatch; my $script_rev = '$Revision: 1.4 $ '; $script_rev =~ s@\$([A-z]*): (.*) \$@$2@; # The DODS_Dispatch object reads information from the environment variables # and builds up a command based on the format of a DODS URL. $dispatch = new DODS_Dispatch($script_rev, "jimg\@dcz.cvo.oneworld.com"); $command = $dispatch->command(); if ($command ne "") { # if no error... exec($command); } else { $dispatch->print_error_msg($script_rev); }