Changeset 39719 for branches/czw_branch/20160809/DataStoreServer
- Timestamp:
- Sep 24, 2016, 3:29:05 PM (10 years ago)
- Location:
- branches/czw_branch/20160809
- Files:
-
- 6 edited
- 5 copied
-
. (modified) (1 prop)
-
DataStoreServer/scripts/dsprodindex (modified) (1 diff)
-
DataStoreServer/scripts/dsrootindex (modified) (2 diffs)
-
DataStoreServer/web/cgi/dsgetindex (modified) (4 diffs)
-
DataStoreServer/web/cgi/findskycalcmf.pl (copied) (copied from trunk/DataStoreServer/web/cgi/findskycalcmf.pl )
-
DataStoreServer/web/cgi/findsmf.pl (modified) (2 diffs)
-
DataStoreServer/web/cgi/listsmfs.pl (copied) (copied from trunk/DataStoreServer/web/cgi/listsmfs.pl )
-
DataStoreServer/web/doc (copied) (copied from trunk/DataStoreServer/web/doc )
-
DataStoreServer/web/php/getskycalcmf.php (copied) (copied from trunk/DataStoreServer/web/php/getskycalcmf.php )
-
DataStoreServer/web/php/getsmf.php (modified) (5 diffs)
-
DataStoreServer/web/php/listsmfs.php (copied) (copied from trunk/DataStoreServer/web/php/listsmfs.php )
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809
-
branches/czw_branch/20160809/DataStoreServer/scripts/dsprodindex
r26926 r39719 75 75 # 76 76 # XXX: the spec doesn't say what should happen in this case. 77 # Here we follow the conductor implementation and return the whole list. 78 # This may not be the right thing to do. It might be better to throw an error 77 # We used to follow the conductor implementation and return the whole list. 78 # but that is definitely not the right thing to do in our context. 79 # Exit with an error 80 exit 404; 79 81 } 80 82 } -
branches/czw_branch/20160809/DataStoreServer/scripts/dsrootindex
r17381 r39719 14 14 my $PS_EXIT_CONFIG_ERROR = 3; 15 15 16 # set this variable to redirect listings of the root datastore directory 17 # to the password protected php page on the postage stamp server web site. 18 # Since the data store is restricted by IP address now this is no longer necessary 19 my $redirect_root_to_pstamp = 0; 20 if ($redirect_root_to_pstamp) { 21 22 print ' 23 <html> 24 <head> 25 <meta HTTP-EQUIV="REFRESH" content="0; url=http://pstamp.ipp.ifa.hawaii.edu/dsroot.php"> 26 </head> 27 </html> 28 '; 29 30 exit 0; 31 } 32 16 33 my $dbh = getDBHandle(); 17 34 18 my $stmt = $dbh->prepare("SELECT * FROM dsProduct ");35 my $stmt = $dbh->prepare("SELECT * FROM dsProduct ORDER BY type"); 19 36 $stmt->execute(); 20 37 … … 36 53 $row->{type}, $row->{description}; 37 54 55 # XXX EAM : security by obfuscation 38 56 print $line; 39 57 } -
branches/czw_branch/20160809/DataStoreServer/web/cgi/dsgetindex
r25366 r39719 20 20 my $PS_EXIT_CONFIG_ERROR = 3; 21 21 my $PS_EXIT_DATA_ERROR = 5; 22 23 my $redirect_root_to_pstamp = 0; 22 24 23 25 my $uri = shift; … … 132 134 print @$stdout_buf; 133 135 } 136 $error_code = 0 if !defined $error_code; 134 137 } else { 135 138 if (0 && $html_mode) { … … 199 202 200 203 # return link 201 print a({-href=>"./index.txt"}, "Text Version"); 204 if (!$redirect_root_to_pstamp || $program ne "dsrootindex") { 205 print a({-href=>"./index.txt"}, "Text Version"); 206 } 202 207 203 208 if ($#path >= 1) { 204 print "    \n"; 205 206 my $up = join('/', @path[0..$#path-1]); 207 print a({-href=>".."}, "Up to $up"); 208 209 # including the up links in the data store display causes 210 # wget -r to follow them up which makes a mess 211 # Turn them off if the user agent looks like wget 212 my $display_up_links = (lc($ENV{HTTP_USER_AGENT}) =~ /wget/) ? 0 : 1; 213 if ($display_up_links) { 214 print "    \n"; 215 my $up = join('/', @path[0..$#path-1]); 216 if ($redirect_root_to_pstamp and $program eq "dsprodindex") { 217 print a({-href=>"http://pstamp.ipp.ifa.hawaii.edu/dsroot.php"}, "Up to $up"); 218 } elsif ($program eq 'dsrootindex') { 219 # no up link in dsroot 220 } else { 221 print a({-href=>".."}, "Up to $up"); 222 } 223 } 209 224 } 210 225 print "</p>\n"; … … 244 259 if ($nolink) { 245 260 print $toks[0]; 246 } 247 248 else { 249 # assumes id is always first field 250 my $wpath = "./$toks[0]"; 251 252 # if this is a file request, use a download cgi 253 if ($wpath =~ /\.fits\s*$/) { 254 # This doesn't work through the proxy 255 # The /ds-cgi gets tried on alala 256 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 261 } else { 262 # First column is link to an entity down one level in data store (product, fileset, file) 263 # assumes id is always first field 264 my $wpath = "./$toks[0]"; 265 266 # if this is a file request, use a download cgi 267 my $fits = 0; 268 if ($wpath =~ /\.fits\s*$/) { 269 # This doesn't work through the proxy 270 # The /ds-cgi gets tried on alala 271 # $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 272 $fits = 1; 273 } 274 275 if ($fits) { 276 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]); 277 } else { 278 print a({-href=>$wpath}, $toks[0]); 279 } 280 281 if ($program eq 'dsrootindex') { 282 # for root listing make most recent fileset a link as well unless there are no filesets 283 my $fileset = $toks[1]; 284 $fileset =~ s/^\s+//; 285 $fileset =~ s/\s+$//; 286 if ($fileset ne 'none') { 287 print "</$celltag>"; 288 print "<$celltag>"; 289 # drop the product from the list of tokens 290 my $product = shift @toks; 291 # elmiminate any whitesapace 292 $product =~ s/^\s+//; 293 $product =~ s/\s+$//; 294 print a({-href=>"./$product/$fileset"}, $fileset); 257 295 } 258 259 print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]);260 }296 } 297 } 298 shift @toks; 261 299 262 300 print "</$celltag>"; 263 301 264 foreach my $val (@toks[1..$#toks]) { 302 # foreach my $val (@toks[1..$#toks]) { 303 foreach my $val (@toks) { 265 304 print "<$celltag>"; 266 305 print $val; -
branches/czw_branch/20160809/DataStoreServer/web/cgi/findsmf.pl
r35241 r39719 35 35 36 36 # NOTE: We do not use the ipp configuration to simplify running from a CGI script 37 my $dbname = " XXX";38 my $dbserver = " XXX";39 my $dbuser = " XXX";40 my $dbpassword = " XXX";37 my $dbname = "gpc1"; 38 my $dbserver = "scidbm"; 39 my $dbuser = "ippuser"; 40 my $dbpassword = "ippuser"; 41 41 42 42 … … 77 77 exit 2 if (!$resolved) 78 78 } 79 # HERE IS THE OUTPUT FOR A SUCCESSFUL LOOKUP 79 80 print "$filename $resolved"; 80 81 } else { -
branches/czw_branch/20160809/DataStoreServer/web/php/getsmf.php
r35330 r39719 5 5 // To just list use wget 'http://ippc17/ipp-misc/getsmf.php?exp_name=o5732g0036o&list=1' 6 6 7 // Only configuration variable here, the location of the cgi script to find smf files8 $command = "/data/ippc17.0/datastore/ds-cgi/findsmf.pl";9 10 $rvar_exp_name = "";11 $rvar_cam_id = "";12 $rvar_data_group = "";13 $rvar_list = 0;14 7 15 8 $error_string = ""; 16 9 $debug = 0; 17 18 # import_request_variables("g", "rvar_");19 10 20 11 $rvar_exp_name = getVar('exp_name'); … … 24 15 $rvar_data_group = getVar('data_group'); 25 16 $rvar_list = getVar('list'); 17 18 $command = "/data/ippc17.0/datastore/ds-cgi/findsmf.pl"; 26 19 27 20 # cam_id takes priority … … 38 31 if ($command) { 39 32 if ($rvar_release) { 40 $command .= " --release $release"; 33 if ($rvar_release == "3PI.GR1") { 34 $rvar_release = "3PI.PV1"; 35 } 36 $command .= " --release $rvar_release"; 41 37 } 42 38 if ($rvar_data_group) { … … 69 65 } 70 66 } else { 71 echo " unexpected output from $command: $output[0] $output[1]\n";67 echo "<br>unexpected output from $command: $output[0] $output[1]\n"; 72 68 } 73 69 } else { 74 70 if ($debug) { 75 echo " command failed $command_status\n";71 echo "<br>command failed $command_status\n"; 76 72 } 77 73 } … … 92 88 readfile($pathname); 93 89 } else { 94 echo "smf file name is $filename<br>\nfile is $pathname\n"; 90 echo "smf : $filename\n"; 91 # echo "path: $pathname\n"; 95 92 } 96 97 93 } else { 98 94 // XXX: Figure out how to stop wget from redirecting these error
Note:
See TracChangeset
for help on using the changeset viewer.
