#!/usr/local/bin/perl -w
# about.pl
#Obtains information from the U.S. GLOBEC Georges Bank data management
#system about the cruiseid, chief scientist, etc.
$version="V1.18/July 20, 2012";
# Modified: July 20, 2012. V1.18. Replace poststring with
# return_web_form_data.pl routine. Replace local sendmessage.pl
# with library area send_message.pl. Update mail sent to include
# a subject line of the name of the program. Add scoping. rcg
# Modified: March 26, 2007. V1.17. Stqart remoteobjects search
# at globec level (one higher) so can see the SOGLOBEC and
# NEP data sets. Temporarily using the list_dot_remoteobjects_new.pl
# program since it has changes. Should change this to .active
# after creating such a soft linked file. Still to do is the
# expansion to look at the inventories of all three data sets,
# not just one. It is worth a try to just create a loop around
# the applicable code and cycle through all three subdirecties. rcg
# Modified: June 27, 2005. V1.16. Replace last print with print STDOUT.
# Fix checking for existance of array by using first element in
# test. rcg
# Modified: June 15, 2005. V1.15. Add $debug flag to help debugging.
# rcg
# Modified: July 2, 2003. V1.14. Check for presence of wild card symbol
# "*" in search string, and replace with ".*" since comparison fails
# with just the "*". Also, check for the presence of multiple words
# when searching the remoteobject files and look for each word
# by itself. May want to do this for the inventory search as well. rcg
# Modified: June 18, 2002. V1.13. Fix parsing in URL to not strip away
# unscores within object names. This is done using the magic
# number of $desc_index equal to 12. Try to suppress quotes marks
# in Description field. Remove code to suppress quotes elsewhere.
# rcg
# Modified: June 25, 2001. V1.12. Fix parsing of URL in remoteobjects
# to accept a second "=" in the URL (e.g. for selections)
# Modified: December 29, 2000. V1.11. Fix parsing of URL in remoteobjects
# files to handle missing /jg/serv/ string. rcg
# Modified: September 5, 2000 V1.10. Add to stop this tag before
# next output material. Add searching of .remoteobjects files. rcg
# Modified: August 13, 1999 V1.01. Add -z to list options to remove
# extra spaces. Change split code to parse using tab not \s. rcg
# Original version: V1.00/August 11, 1999
# R. Groman
unshift (@INC, "/home/rgroman/perllib");
require ('send_message.pl');
require ('return_web_form_data.pl');
use lib "/home/rgroman/perllib";
$|=1;
my $error="
&x";
my $warning="
#";
my $debug = "no";
print STDOUT ("Content-type: text/html\n\n",
"\n
**debug, object=$object\n\n"); unless (open INVENTORY, "/data5/globec/bin/list -f -c -t -n -z $object |") { &send_message ($error, "
Could not open inventory file, error=$! ",
"Contact the DMO");
exit;
}
my @array = **debug, arrary[0] (field names)=$array[0]\n")
if $debug eq 'yes';
for ($i=0; $i <= $#fieldnames; $i++) {
($fieldnames[$i],$qual) = split /\[/, $fieldnames[$i];
print STDOUT (" \n");
}
else {
print STDOUT (' There are no matches for ',
$option_nu, ' in the inventory file. ');
if ($option_nu =~ m/\s/ ) {
print STDOUT ("\n Try entering a single word ",
"on which to search.\n");
}
}
# Check the .remoteobjects files on the main server
unless (open REMOTEOBJECTS, "$get_remoteobjects $remoteobjects_root |") {
&send_message ($error, " Could not access remoteobjects files, error=$! ",
"Contact the DML");
exit;
}
@array =
**debug, fieldnames[$i]=$fieldnames[$i]\n")
if $debug eq 'yes';
}
undef $qual;
my @saveindex = ();
#Search for option string somewhere in the inventory
for (my $i=1; $i <= $#array; $i++) {
print STDOUT ("
**debug, array[$i]=$array[$i]\n")
if $debug eq 'yes';
$record_uc = uc $array[$i];
print STDOUT ("
**debug, record_uc=$record_uc\n\t",
"option_uc=",$option_uc,"\n") if $debug eq 'yes';
if ($record_uc =~ m/$option_uc/ ) {push @saveindex, $i; }
}
#print table heading
if ( $#saveindex >= 0 ) {
print STDOUT ("\n
\n");
$output = "";
for (my $i=0; $i <= $last_inventory_param; $i++) {
$output = $output . " \n");
foreach my $i (@saveindex) {
&print_inventory_info ($option, $array[$i]);
}
print STDOUT ("" . $output_heading[$i] . " ";
}
print STDOUT ("$outputChecking the remote objects files. Please wait ...
\n");
&process_remoteobjects;
#Add other places to check latter.
undef $error;
undef $warning;
print STDOUT ("
Version: ",$version, "\n