]> matita.cs.unibo.it Git - helm.git/commitdiff
styles_dir is now style_dir
authorLuca Padovani <luca.padovani@unito.it>
Thu, 8 Feb 2001 10:35:15 +0000 (10:35 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Thu, 8 Feb 2001 10:35:15 +0000 (10:35 +0000)
the getter now recognize one further command, getstyleconf, to retrieve
the stylesheet configuration file (and possibly its dtd)

helm/http_getter/http_getter.pl.in

index 89f1a521e218c8ddb3c81218182cf3bf4a67c1a7..fd72b75094014106160cd3a8ecae90176e8eb2ce 100755 (executable)
@@ -35,7 +35,7 @@ if (defined ($HELM_LIB_DIR)) {
 }
 
 # Let's override the configuration file
-$styles_dir = $ENV{"HELM_STYLE_DIR"} if (defined ($ENV{"HELM_STYLE_DIR"}));
+$style_dir = $ENV{"HELM_STYLE_DIR"} if (defined ($ENV{"HELM_STYLE_DIR"}));
 $dtd_dir = $ENV{"HELM_DTD_DIR"} if (defined ($ENV{"HELM_DTD_DIR"}));
 
 # <ZACK>: TODO temporary, move this setting to configuration file
@@ -75,7 +75,7 @@ $myownurl = "http://".$myownurl.":".$myownport;
 tie(%map, 'DB_File', $uris_dbm.".db", O_RDONLY, 0664);
 print "Please contact me at: <URL:", $myownurl."/", ">\n";
 print "helm_dir: $helm_dir\n";
-print "styles_dir: $styles_dir\n";
+print "style_dir: $style_dir\n";
 print "dtd_dir: $dtd_dir\n";
 print "urls_of_uris.db: $uris_dbm.db\n";
 print "cache mode: $cachemode\n";
@@ -243,12 +243,13 @@ EOT
                die "Could not find DTD!";
             }
         } elsif ($http_method eq 'GET' and $http_path eq "/getstyleconf") {
-            $filename = $styles_dir."/config/style-configuration.xml";
-            print "Style Configuration: $filename\n";
+            my $filename = $inputuri;
+            $filename = $style_dir."/config/".$filename;
             if (stat($filename)) {
                open(FD, $filename) or die "Cannot open $filename\n";
                $cont = "";
                while(<FD>) {
+               s/DOCTYPE (.*) SYSTEM\s+"/DOCTYPE $1 SYSTEM "$myownurl\/getstyleconf?uri=/g;
                $cont .= $_;
               }
                close(FD);
@@ -258,7 +259,7 @@ EOT
             }
         } elsif ($http_method eq 'GET' and $http_path eq "/getxslt") {
             my $filename = $inputuri;
-            $filename = $styles_dir."/".$filename;
+            $filename = $style_dir."/".$filename;
             print "XSLT: $inputuri ==> ($filename)\n";
             if (stat($filename)) {
                print "Using local copy\n";