Update NEWS files for next release
[ACE_TAO.git] / ACE / apps / JAWS / clients / WebSTONE / bin / WebStone-setup.pl
blobfcf41e632b23db5c83e2c8d383131c8af673a249
1 #!/pkg/gnu/bin//perl5
4 push(@INC, "$wd/bin");
5 require('WebStone-common.pl');
7 @keylist = ();
9 html_begin("Setup");
11 show_model();
13 print CLIENT <<EOF
14 <FORM METHOD="POST" ACTION="$wd/bin/write-testbed.pl">
15 EOF
18 &gettestbed();
19 &getconfig();
21 print CLIENT <<EOF
22 </DL>
23 <P><INPUT TYPE="SUBMIT" VALUE="Write Configuration">
24 </FORM>
26 <HR>
27 <FORM METHOD="POST" ACTION="$wd/bin/move-filelist.pl">
28 <H3>Choose a Web site model:</H3>
29 <DL>
30 EOF
33 for $key (sort(keys %filelist)) {
34 print CLIENT "<DD><INPUT TYPE=RADIO NAME=filelist ";
35 if ($key eq "filelist") {
36 print CLIENT " CHECKED ";
38 print CLIENT " VALUE=\"$wd/conf/$key\"> $key: $filelist{$key}";
41 print CLIENT <<EOF
42 </DL>
43 <INPUT TYPE="SUBMIT" VALUE="Set Workload">
45 EOF
48 html_end();
50 # end of main program
52 sub gettestbed {
53 open(TESTBED, "$wd/conf/testbed");
54 while (<TESTBED>) {
55 if (/^\#|^(\w)*$/) { # do nothing
57 else {
58 ( $textvalue, $thevalue ) = split( '=', $_ );
59 ( $thevalue ) = split( '#', $thevalue);
60 $testbed{$textvalue} = $thevalue;
61 push(@keylist, $textvalue);
64 close(TESTBED);
66 open(HELPFILE, "$wd/doc/testbed.help");
67 while (<HELPFILE>) {
68 ( $key, $textvalue ) = split( ':', $_ );
69 $helptext{$key} = $textvalue;
71 close(HELPFILE);
73 foreach $key (@keylist) {
74 print CLIENT "<P><DT>$helptext{$key}";
75 $thesize = length($testbed{$key}) + 5;
76 print CLIENT "<DD>$key <INPUT TYPE=TEXT NAME=$key ";
77 print CLIENT "SIZE=$thesize VALUE=$testbed{$key}>\n";
81 sub getconfig {
82 opendir(CONF, "$wd/conf") || die "open $wd/conf: $!";
83 %filelist = "";
84 foreach $file (sort readdir(CONF)) {
85 if ( $file =~ /^filelist.*/ ) {
86 $headtext = `head -1 $wd/conf/$file`;
87 $headtext =~ s/\#//;
88 ( $headtext ) = split(':', $headtext);
89 $filelist{$file} = $headtext;
92 closedir(CONF);
95 # end