+
+ # "/register" does not work with rdf uris
+ } elsif ($http_method eq 'GET' and $http_path eq "/register") {
+ my $inputurl = $cgi->param('url');
+ print "Register requested...\n";
+ $map{$inputuri}=$inputurl;
+
+ # Now let's clean the cache
+ my $cicfilename = $inputuri;
+ $cicfilename =~ s/cic:(.*)/$1/;
+ $cicfilename =~ s/theory:(.*)/$1/;
+
+ print "Unlinking ".$helm_dir.$cicfilename.".xml[.gz]\n";
+ unlink ($helm_dir.$cicfilename.".xml");
+ unlink ($helm_dir.$cicfilename.".xml.gz");
+
+ kill(USR1,getppid()); # signal changes to parent
+ untie %map;
+ print "done.\n";
+ html_nice_answer($c,"Register done");
+
+ # "/resolve" works with rdf uri
+ } elsif ($http_method eq 'GET' and $http_path eq "/resolve") {
+ #my $outputurl = $map{$inputuri};
+ my $outputurl = resolve($inputuri);
+ $outputurl = "" if (not defined($outputurl));
+ $cont = "<?xml version=\"1.0\" ?>\n\n";
+ if ($outputurl eq "") {
+ $cont .= "<unresolved />\n";
+ } else {
+ $cont .= "<url value=\"$outputurl\" />\n";
+ }
+ answer($c,$cont,"text/xml","");
+
+ } elsif ($http_method eq 'GET' and $http_path eq "/getdtd") {
+
+# my $filename = $inputuri;
+# $filename = $dtd_dir."/".$filename;
+# print "DTD: $inputuri ==> ($filename)\n";
+# if (stat($filename)) {
+# print "Using local copy\n";
+# open(FD, $filename) or die "Cannot open $filename\n";
+# $cont = "";
+# while(<FD>) {
+# # Vary bad heuristic for substituion of absolute URLs
+# # for relative ones
+# s/ENTITY (.*) SYSTEM\s+"/ENTITY $1 SYSTEM "$myownurl\/getdtd?uri=/g;
+# $cont .= $_;
+# }
+# close(FD);
+# answer($c,$cont,"text/xml","");
+# } else {
+# die "Could not find DTD!";
+# }
+