Changeset 17381 for trunk/DataStoreServer/web/cgi
- Timestamp:
- Apr 7, 2008, 3:59:25 PM (18 years ago)
- Location:
- trunk/DataStoreServer/web/cgi
- Files:
-
- 2 added
- 4 edited
-
dodsfits (added)
-
dsfits.cgi (modified) (1 diff)
-
dsgetindex (modified) (7 diffs)
-
dsindex.cgi (modified) (1 diff)
-
dsshellconfig (added)
-
dstxtindex.cgi (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/web/cgi/dsfits.cgi
r16763 r17381 1 #!/usr/bin/env perl 2 3 use strict; 4 use CGI ':standard'; 5 6 my $DS_DIR = '/var/www/html/ds/dsroot'; 7 #my $DS_DIR = '.'; 8 9 my $uri = $ENV{'REQUEST_URI'}; 10 11 $uri = $ARGV[0]; 12 print STDERR "uri is $uri\n"; 13 14 (my $left, my $param) = split(/\,/, $uri); 15 16 print STDERR "left: $left param: $param\n"; 17 18 if ($left !~ /\.fits$/) { 19 print header( -status => '404 Not Found' ); 20 exit; 21 } 22 23 my @path = split(/\//, $left); 24 25 my $fn = @path[$#path]; 26 my $fpath = $DS_DIR.'/'.$left; 27 28 29 30 print header( -type => 'image/fits', 31 -attachment => $fn, 32 -content_length => -s $fpath, 33 ); 34 35 36 open F, $DS_DIR.'/'.$left; 37 38 binmode(F); 39 binmode(STDOUT); 40 41 print while (<F>); 42 43 close F; 1 #!/bin/bash 2 . ./dsshellconfig 3 ./dodsfits $* -
trunk/DataStoreServer/web/cgi/dsgetindex
r16955 r17381 5 5 # The only required argument is the REQUEST_URI. 6 6 # The number of elements in the URI tell us whether we are listing 7 # the root, a product, or a fileset. 8 # 9 # if a second argument -html is provided, the output is in HTML 7 # the data store root, a product, or a fileset. 8 # 9 # if a second argument -html is provided, the output is in HTML format 10 # otherwise plain text is used 10 11 # 11 12 # The only thing specific to the ipp used here is the exit codes. … … 16 17 use CGI ':standard'; 17 18 use IPC::Cmd 0.36 qw( can_run run ); 18 use PS::IPP::Config qw($PS_EXIT_SUCCESS 19 $PS_EXIT_UNKNOWN_ERROR 20 $PS_EXIT_SYS_ERROR 21 $PS_EXIT_CONFIG_ERROR 22 $PS_EXIT_PROG_ERROR 23 $PS_EXIT_DATA_ERROR 24 $PS_EXIT_TIMEOUT_ERROR 25 metadataLookupStr 26 metadataLookupBool 27 caturi 28 ); 19 20 my $PS_EXIT_CONFIG_ERROR = 3; 21 my $PS_EXIT_DATA_ERROR = 5; 29 22 30 23 my $uri = shift; … … 34 27 exit ($PS_EXIT_CONFIG_ERROR); 35 28 } 29 30 my $DS_ROOT = $ENV{DS_ROOT}; 31 32 die("DS_ROOT not found in the environment") unless defined($DS_ROOT); 36 33 37 34 my @path; … … 59 56 # there is no file on the url 60 57 61 print STDERR "html mode\n";58 # print STDERR "html mode\n"; 62 59 63 60 ($directories, $query_str) = split/\?/, $uri; … … 96 93 97 94 if (@dirs) { 95 # XXX need to output an error page 98 96 warn("unexpected extra directories: @dirs in uri: $uri"); 99 97 exit ($PS_EXIT_CONFIG_ERROR); … … 167 165 # XXX: 168 166 # quick hacky pretty printer 169 # Stolen Eric'smock up167 # Stolen from Eric's Data Store mock up 170 168 # 171 169 … … 174 172 175 173 print header('text/html', '200 OK'); 176 print start_html('Data store');174 print start_html('Data Store'); 177 175 178 176 # get free space 179 # XXX: need to configure DS_DIR 180 my $DS_DIR = '/var/www/html/ds/dsroot'; 181 my $ref = df($DS_DIR); 177 my $ref = df($DS_ROOT); 182 178 printf '<p>Free space: %.2fG (%.1f%%)</p>', 183 179 $ref->{bfree}/(1024*1024), -
trunk/DataStoreServer/web/cgi/dsindex.cgi
r16763 r17381 1 #!/bin/sh 2 /export/data0/bills/psconfig/default.linrh64/bin/pstamp_runcommand.sh dsgetindex $REQUEST_URI -html 1 #!/bin/bash 2 . ./dsshellconfig 3 dsgetindex $REQUEST_URI -html -
trunk/DataStoreServer/web/cgi/dstxtindex.cgi
r16763 r17381 1 #!/bin/sh 2 /export/data0/bills/psconfig/default.linrh64/bin/pstamp_runcommand.sh dsgetindex $REQUEST_URI; 1 #!/bin/bash 2 . ./dsshellconfig 3 ./dsgetindex $REQUEST_URI;
Note:
See TracChangeset
for help on using the changeset viewer.
