home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
- #
- use Guppy;
- $Pwhere = "http://japan.park.org/Japan/Fujitsu/GJ/jp";
- $Iwhere = "../../../i";
- $path = `pwd`;
- chop $path;
- unless ($Pwhere) {
- print("The pdocs path has not been established. Please enter its value: ");
- $Pwhere = <STDIN>;
- chop $Pwhere;
- }
- unless ($Iwhere) {
- print("The idocs path has not been established. Please enter its value: ");
- $Iwhere = <STDIN>;
- chop $Iwhere;
- }
- print("Enter File Name of List: ");
- $InputFile = <STDIN>;
- chop $InputFile;
- if (-e "$path/$InputFile") {
- $data = &Guppy::ReadVarAsText(&Guppy::ReadFile("$path/$InputFile")) || die ("Can't open file $InputFile for read.\n");
- } else {
- die ("File $path/$InputFile does not exist.\n");
- }
- print("Running with pdocs as $Pwhere\n\t and idocs as $Iwhere\n");
- print("\tReading Input File $InputFile\n\n");
- # print("\t\t\tIs this correct? (y/n) ");
- # $ans = <STDIN>;
-
- # unless ($ans =~ /y/) {
- # die ("\tOkay, then change it, buster!\n\n");
- # }
-
- print "Working...\n";
-
- sub NAVLINE {
- my $now = shift;
- $Itemp = $Iwhere;
- # $Itemp = "../$Iwhere" if ($now eq "pix");
- my $pageURL = $MachineURL.$StateURL;
- $topP = &Guppy::HtmlTarget("pix");
- $topT = &Guppy::HtmlTarget('_top');
- my $out;
- $out = "<TABLE BORDER=0 WIDTH=60%>\n";
- unless ($now eq "pix" || $now eq "anthro") {
- $out .= "<TR>\n<TD ALIGN=CENTER><img src=\"$Itemp/java/classes/images/lowerfiller.gif\" border=0 width=95 height=26></TD></TR>\n";
- }
- $out .= "<TR><TD ALIGN=CENTER VALIGN=TOP><TABLE BORDER=0><TR>\n";
- if ($now eq "pix" || $now eq "anthro") {
- $out .= "<TD ALIGN=CENTER VALIGN=TOP WIDTH=50%>\n";
- $out .= "<applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"sekr\">\n";
- $out .= "<param name=txt value = \"j_sekrtxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/americas/$DirectoryName/sekino.html\">\n";
- $out .= "<param name=target value=\"_self\">\n";
- $out .= "<A HREF = \"$Pwhere/americas/$DirectoryName/sekino.html\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/sekr.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/j_sekrtxt.gif\" border=0 width=95 height=28></A></applet>\n";
- $out .= "<P></TD>\n";
- }
- if (($AnthroReport) && $now ne "anthro") {
- $out .= "<TD ALIGN=CENTER VALIGN=TOP WIDTH=50%>\n";
- $out .= "<center><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"anthro\">\n";
- $out .= "<param name=txt value = \"anthrotxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/americas/$DirectoryName/anthro.html\">\n";
- $out .= "<param name=target value=\"_self\">\n";
- $out .= "<A HREF = \"$Pwhere/americas/$DirectoryName/anthro.html\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/anthro.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/anthrotxt.gif\" border=0 width=95 height=28></A></applet>\n";
- $out .= "<P></TD>\n";
- }
- $out .= "</TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>\n<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR>\n";
- $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"intro\">\n";
- $out .= "<param name=txt value = \"j_introtxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/intro.html\">\n";
- $out .= "<param name=target value=\"_top\">\n";
- $out .= "<A HREF = \"$Pwhere/intro.html\" TARGET=\"_top\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/intro.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/j_introtxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
-
-
- $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"home\">\n";
- $out .= "<param name=txt value = \"j_hometxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/home.html\">\n";
- $out .= "<param name=target value=\"_top\">\n";
- $out .= "<A HREF = \"$Pwhere/home.html\" TARGET=\"_top\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/home.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/j_hometxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
-
-
- $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"sek\">\n";
- $out .= "<param name=txt value = \"j_sektxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/sekino/\">\n";
- $out .= "<param name=target value=\"_top\">\n";
- $out .= "<A HREF = \"$Pwhere/sekino/\" TARGET=\"_top\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/sek.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/j_sektxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
-
-
- $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"amer\">\n";
- $out .= "<param name=txt value = \"amertxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/americas/\">\n";
- $out .= "<param name=target value=\"_top\">\n";
- $out .= "<A HREF = \"$Pwhere/americas/\" TARGET=\"_top\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/amer.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/amertxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
-
-
- $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
- $out .= "<param name=image value = \"human\">\n";
- $out .= "<param name=txt value = \"humantxt\">\n";
- $out .= "<param name=bakg value = \"lowerfiller\">\n";
- $out .= "<param name=xmin value = \"36\">\n";
- $out .= "<param name=xmax value = \"72\">\n";
- $out .= "<param name=ymin value = \"5\">\n";
- $out .= "<param name=ymax value = \"36\">\n";
- $out .= "<param name=xposimage value = \"0\">\n";
- $out .= "<param name=xpostxt value = \"0\">\n";
- $out .= "<param name=URL value = \"$Pwhere/hmap/\">\n";
- $out .= "<param name=target value=\"_top\">\n";
- $out .= "<A HREF = \"$Pwhere/hmap/\" TARGET=\"_top\">\n";
- $out .= "<img src=\"$Itemp/java/classes/images/human.gif\" border=0 width=95 height=26><br>\n";
- $out .= "<img src=\"$Itemp/java/classes/images/humantxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
- $out .= "</TR><TR>\n";
- $out .= "<TD ALIGN=CENTER><img src=\"$Itemp/java/classes/images/lowerfiller.gif\" border=0 width=95 height=26></TD>\n";
- $out .= "</TR></TABLE></TD></TR></TABLE>\n";
- $out;
- }
-
- sub MakeHeader {
- my $title = shift;
- my $out;
- $out = "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n";
- $out .= "<BODY BGCOLOR=\"#000000\" TEXT=\"#FFFFFF\" LINK=\"#BB0000\" ALINK=\"#000000\" VLINK=\"#925656\">\n\n";
- $out;
- }
-
- sub MakeFooter {
- my $type = shift;
- my $out;
- $out = &NAVLINE($type);
- $out .= "\n\n</BODY></HTML>";
- $out;
- }
-
- foreach $c (@{$data}) {
- $LocationName = $c->{'LocationName'};
- $DirectoryName = $c->{'DirectoryName'};
- $SekinoReport = $c->{'SekinoReport'};
- $AnthroReport = $c->{'AnthroReport'};
- $DescriptionFile = $c->{'DescriptionFile'};
- $NumberOfPictures = $c->{'NumberOfPictures'};
-
- print "Working on $DirectoryName:\n";
-
- # MAKE THE CORRECTLY NAMED DIRECTORY
-
- if (-e "$path/$DirectoryName") {
- die ("Error: the directory $DirectoryName already exists.\n");
- } else {
- mkdir ("$path/$DirectoryName", 0754) || die ("Can't make directory $DirectoryName.\n");
- }
-
- # READ TEXT SEKINO'S REPORT AND MAKE THE HTML VERSION
-
- $FileContents = &Guppy::ReadFile("$path/textdata/$SekinoReport") || die ("Error: not reading Sekino's Report File $SekinoReport.\n");
- $header = &MakeHeader("$LocationName");
- $footer = &MakeFooter('report');
- $FileContents = "$header$FileContents\n\n$footer";
- open (OUTPUT, ">$path/$DirectoryName/sekino.html") || die ("Error: can't open sekino.html in $DirectoryName.\n");
- print OUTPUT ("$FileContents");
- close OUTPUT;
-
- # READ TEXT ANTHRO REPORT AND MAKE THE HTML VERSION
-
- $FileContents = &Guppy::ReadFile("$path/textdata/$AnthroReport") || die ("Error: not reading Sekino's Report File $SekinoReport.\n");
- $header = &MakeHeader("$LocationName");
- $footer = &MakeFooter('anthro');
- $FileContents = "$header\n\n$FileContents\n\n$footer";
- open (OUTPUT, ">$path/$DirectoryName/anthro.html") || die ("Error: can't open anthro.html in $DirectoryName.\n");
- print OUTPUT ("$FileContents");
- close OUTPUT;
-
- # MAKE FRAMESET PAGES
-
- open (OUTPUT, ">$path/$DirectoryName/index.html") || die ("Error: can't open index.html (frameset page) in $DirectoryName.\n");
- print OUTPUT ("<HTML>\n<HEAD><TITLE>$LocationName</TITLE></HEAD>\n<FRAMESET rows=\"*,120\">\n<FRAME NAME=\"pix\" MARGINWIDTH=0 MARGINHEIGHT=0 SRC=\"sekino.html\">\n");
- print OUTPUT ("<FRAME NAME=\"list\" MARGINWIDTH=0 MARGINHEIGHT=0 noresize SRC=\"filmstrip.html\">\n");
- print OUTPUT ("</FRAMESET></HTML>");
- close OUTPUT;
-
- # MAKE FILMSTIP PAGES
-
- $header = &MakeHeader("$LocationName");
- open (OUTPUT, ">$path/$DirectoryName/filmstrip.html") || die ("Error: can't open filmstrip.html in $DirectoryName.\n");
- print OUTPUT ("$header");
- print OUTPUT ("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR>\n");
- print OUTPUT ("<TD VALIGN=TOP><img src=\"$Iwhere/americas/$DirectoryName/icons/title.gif\" border=0 alt=\"\" width=108 height=100></TD>\n");
- $count = 1;
- while ($count<=$NumberOfPictures) {
- print OUTPUT ("<TD VALIGN=TOP><a href=\"$count.html\" target=\"pix\"><img BORDER=0 ALIGN=LEFT HSPACE=0 src=\"$Iwhere/americas/$DirectoryName/icons/$count.gif\" alt=\"\" width=108 height=100></a></TD>\n");
- $count++;
- }
- print OUTPUT ("<TD NOWRAP>more REPORTS....</TD>\n");
- print OUTPUT ("</TR></TABLE>\n<\BODY><\HTML>");
- close OUTPUT;
-
- # MAKE EACH PICTURE PAGE
-
- $header = &MakeHeader("$LocationName");
- $footer = &MakeFooter('pix');
- open (INPUT, "$path/textdata/$DescriptionFile") || die ("Can't open file $DescriptionFile for read.\n");
- $line = <INPUT>;
- @lines = split("\n", $line);
- mkdir ("$path/$DirectoryName/pix", 0754) || die ("Can't make directory $DirectoryName/pix.\n");
- $count = 1;
- while ($count<=$NumberOfPictures) {
- open (OUTPUT, ">$path/$DirectoryName/$count.html") || die ("Error: can't open picture page $count.html for write.\n");
- print OUTPUT ("$header");
- print OUTPUT ("<CENTER><P><BR>\n");
- print OUTPUT ("$LocationName\n<TABLE BORDER=0 HEIGHT=70% WIDTH=384><TR><TD ALIGN=CENTER>\n");
- print OUTPUT ("<IMG BORDER=0 SRC=\"$Iwhere/americas/$DirectoryName/$count.jpeg\"><BR>\n");
- print OUTPUT ("<FONT SIZE=-1>$lines[$count-1]</FONT>\n");
- print OUTPUT ("</TD></TR></TABLE>\n");
- print OUTPUT ("$footer");
- close OUTPUT;
- $count++;
- }
- close INPUT;
-
- }
-
- print ("No Errors Encountered. Subsite Complete.\n");
- exit(0);
-