X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Fcgi%2Fmkindextheory.pl;fp=helm%2Fcgi%2Fmkindextheory.pl;h=0000000000000000000000000000000000000000;hp=424f688ff0bd747ddbbaac458310fb4c6d869809;hb=869549224eef6278a48c16ae27dd786376082b38;hpb=89262281b6e83bd2321150f81f1a0583645eb0c8 diff --git a/helm/cgi/mkindextheory.pl b/helm/cgi/mkindextheory.pl deleted file mode 100755 index 424f688ff..000000000 --- a/helm/cgi/mkindextheory.pl +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/perl - -# First of all, let's load HELM configuration -use Env; -my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"}; -# this should be the only fixed constant -my $DEFAULT_HELM_LIB_DIR = "/projects/helm/on-line/local/lib/helm"; -if (defined ($HELM_LIB_DIR)) { - $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl"; -} else { - $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl"; -} - -# next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm -require $HELM_LIB_PATH; - -use URI::Escape; -use LWP::UserAgent; -use CGI; - -my $cgi = new CGI($ENV{"REQUEST_URL"}); -$uri = $cgi->param('theoryuri'); -$getterURL = $cgi->param('getterURL'); -$uri =~ s/(.*)\/$/$1/; # Remove a final slash if present -$uri .= "/"; # Put a final slash -$myurl = $cgi->url(); - -$cont = ""; # modified by side-effect by &callback -my $ua = LWP::UserAgent->new; -my $request = HTTP::Request->new(GET => $getterURL."ls?format=txt&baseuri=".$uri); -my $response = $ua->request($request, \&callback); - -@filenames = split(/\n/, $cont); - -my $uridotdot = $uri; -$uridotdot =~ s/(.*)\/.+/$1/; -if ($uri ne "theory:/") { - # Let's print the link to the parent directory - $output = < -[BACK] -Parent Directory - -EOT -} - -foreach $i (@filenames) { - my ($type,$name,$flags) = split(/, /, $i); - my ($flagscic, $flagstypes) = split(/,/, $flags); - $flagscic =~ s/^<(.*)/$1/; - $flagstypes =~ s/(.*)>$/$1/; - if ($type eq "dir") { - $output .= < -[DIR] -$name - -EOT - } elsif ($type eq "object") { - if ($name =~ /\.theory$/) { - # theory file - $output .= < -[DIR] -$name - -EOT - } else { - $output .= < -[DIR] -$name - -EOT - } - } else { - $output .= < -[DIR] -$name - -EOT - } -} - -print < - - -Index of $uri - - - - -$output -
-
- - -EOT - -#================================ - -sub callback -{ - my ($data) = @_; - $cont .= $data; -}