Check-in Number:
|
4775 | |
Date: |
2004-Oct-25 17:42:43 (local)
2004-Oct-25 15:42:43 (UTC) |
User: | rse |
Branch: | |
Comment: |
initial cut for CGI |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/quos/TODO 1.2 -> 1.3
--- TODO 2004/10/25 15:19:20 1.2
+++ TODO 2004/10/25 15:42:43 1.3
@@ -10,3 +10,9 @@
perl-util
apache
+- apache.conf:
+ Alias /quos/ /u/rse/wrk/ossp/quos/
+ <Directory /u/hms/wrk/ossp/quos/>
+ Options +ExecCGI
+ </Directory>
+
|
|
ossp-pkg/quos/quos.cgi 1.1 -> 1.2
--- quos.cgi 2004/10/25 14:35:11 1.1
+++ quos.cgi 2004/10/25 15:42:43 1.2
@@ -28,16 +28,73 @@
require 5.008;
use CGI;
use String::Divert;
+use IO::File;
-# ...FIXME...
+# create objects
+my $cgi = new CGI;
+my $html = new String::Divert;
+$html->overload(1);
-my $html = '';
-$html .= "<div class=\"quos\">";
-$html .= "...";
-$html .= "<span class=titlebrowse>Browse</span>";
-$html .= "...";
-$html .= "</div>";
-print STDOUT $html;
+# generate outer canvas
+$html .= "<div class=\"quos\">\n";
+$html->fold("quos");
+$html .= "</div>\n";
+$html >> "quos";
+
+# generate browse part
+$html .= "<p>";
+$html .= "<span class=\"browse\">";
+$html .= "<span class=\"title\">Browse</span>\n";
+$html->fold("browse");
+$html .= "</span>\n";
+$html .= "</span>\n";
+
+# generate query part
+$html .= "<p>";
+$html .= "<span class=\"query\">";
+$html .= "<span class=\"title\">Query</span>\n";
+$html->fold("query");
+$html .= "</span>\n";
+$html .= "</span>\n";
+
+# generate view part
+$html .= "<p>";
+$html .= "<span class=\"view\">";
+$html .= "<span class=\"title\">View</span>\n";
+$html->fold("view");
+$html .= "</span>\n";
+$html .= "</span>\n";
+
+# generate result part
+$html .= "<p>";
+$html .= "<span class=\"result\">";
+$html .= "<span class=\"title\">Result</span>\n";
+$html->fold("result");
+$html .= "</span>\n";
+$html .= "</span>\n";
+
+# sample
+$html >> "query";
+$html .= "this is the query part";
+$html << 1;
+
+# read HTML skeleton
+my $io = new IO::File "<quos.html"
+ or die "unable to read HTML skeleton file \"quos.html\"";
+my $skel = '';
+$skel .= $_ while (<$io>);
+$io->close();
+$html->undivert(0);
+$skel =~ s|\%BODY\%|$html|s;
+$html = $skel;
+
+# create HTTP response
+my $http = $cgi->header(
+ -type => 'text/html',
+ -expires => '+10s'
+);
+$http .= $html;
+print STDOUT $http;
__END__
|
|
ossp-pkg/quos/quos.css 1.1 -> 1.2
--- quos.css 2004/10/25 14:35:11 1.1
+++ quos.css 2004/10/25 15:42:43 1.2
@@ -28,8 +28,26 @@
background: #f0f0f0;
}
-.quos SPAN.titlebrowse {
- color: #ffffff;
- background: #000000;
+.quos SPAN.browse {
+ background: #cccccc;
+}
+.quos SPAN.browse SPAN.title {
+ font-weight: bold;
+ font-size: 200%;
+ color: #ffffff;
+}
+.quos SPAN.query {
+ background: #cc3333;
+}
+.quos SPAN.query SPAN.title {
+ font-weight: bold;
+ font-size: 400%;
+ color: #cccc33;
+}
+.quos SPAN.view {
+ background: #33cc33;
+}
+.quos SPAN.result {
+ background: #3333cc;
}
|
|