]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/cgi/webeqp.pl
This commit was manufactured by cvs2svn to create branch 'pacchetti'.
[helm.git] / helm / cgi / webeqp.pl
diff --git a/helm/cgi/webeqp.pl b/helm/cgi/webeqp.pl
deleted file mode 100755 (executable)
index b4891d3..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/perl
-
-my $HELM_CONFIGURATION_PREFIX = $ENV{"HELM_CONFIGURATION_PREFIX"};
-my $HELM_CONFIGURATION_PATH =
- $HELM_CONFIGURATION_PREFIX."/local/lib/helm/configuration.pl";
- # next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm
- require $HELM_CONFIGURATION_PATH;
-
-require HTTP::Request;
-require LWP::UserAgent;
-use CGI;
-
-$url = $ENV{"REQUEST_URI"};
-$url =~ s/.*mmlurl=(.*)/$1/;
-
-$content = "";
-
-$ua = LWP::UserAgent->new;
-$request = HTTP::Request->new(GET => "$url");
-$response = $ua->request($request, \&callback);
-
-$content =~ s/\r//sg;
-$content =~ s/\n/ /sg;
-$content =~ s/<!DOCTYPE[^>]*>//sg;
-$content =~ s/<\?xml[^?]*\?>//sg;
-$content =~ s/"/'/g;
-$content =~ s/&/&amp;/g;
-$content =~ s/<m:/</g;
-$content =~ s/<\/m:/<\//g;
-$content =~ s/<math[^>]*>/<math>/sg;
-$content =~ s/(<\/?semantics[^>]*>)/<!-- $1 -->/sg;
-$content =~ s/(<annotation-xml)/<!-- $1/sg;
-$content =~ s/(<\/annotation-xml>)/$1 -->/sg;
-$content =~ s/<mo helm:xref='[^']*' xlink:href='([^']*)'>([^<]*)<\/mo>/<maction actiontype='href' other='$use_webeqp_url?uri=$1'><mo>$2<\/mo><\/maction>/sg;
-$content =~ s/<mi helm:xref='[^']*' xlink:href='([^']*)'>([^<]*)<\/mi>/<maction actiontype='href' other='$use_webeqp_url?uri=$1'><mi>$2<\/mi><\/maction>/sg;
-$content =~ s/helm:xref='[^']*'//sg;
-$content =~ s/xmlns:helm='[^']*'//sg;
-$content =~ s/xlink:href='[^']*'//sg;
-$content =~ s/xmlns:xlink='[^']*'//sg;
-$content =~ s/<mchar name='([^']*)' \/>/&$1;/sg;
-
-print <<EOT;
-Content-type: text/html
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>Generato in automatico a partire da $url</title>
-</head>
-<body bgcolor="#ffffff" text="#000000">
-<applet codebase="http://www.webeq.com/WebEQ/2.2/classes" code="webeq.Main"
-+width=600 height=2000 align=middle>
-<param name=eq value="$content">
-<param name=color value="#cccccc">
-<param name=parser value="mathml">
-<param name=size value="14">
-</applet>
-</body>
-</html>
-EOT
-
-#=========================
-
-sub callback
-{ 
- my ($data) = @_;
- $content .= $data;
-}