3 # First of all, let's load HELM configuration
5 my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"};
6 # this should be the only fixed constant
7 my $DEFAULT_HELM_LIB_DIR = "/projects/helm/on-line/local/lib/helm";
8 if (defined ($HELM_LIB_DIR)) {
9 $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl";
11 $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl";
14 # next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm
15 require $HELM_LIB_PATH;
21 my $cgi = new CGI($ENV{"REQUEST_URL"});
22 $uri = $cgi->param('cicuri');
23 $uri =~ s/(.*)\/$/$1/; # Remove a final slash if present
24 $uri .= "/"; # Put a final slash
27 $cont = ""; # modified by side-effect by &callback
28 my $ua = LWP::UserAgent->new;
29 my $request = HTTP::Request->new(GET => $getter_url."ls?format=txt&baseuri=".$uri);
30 my $response = $ua->request($request, \&callback);
32 @filenames = split(/\n/, $cont);
35 $uridotdot =~ s/(.*)\/.+/$1/;
36 if ($uri ne "cic:/") {
37 # Let's print the link to the parent directory
40 <td><img border="0" src="/icons/back.gif" alt="[BACK]"></td>
41 <td><a href="$myurl" onClick="top.frames[0].document.forms[0].hiddencicuri.value='$uridotdot'; refreshReload(); refreshCICHeader(); this.search='?cicuri=$uridotdot';" onMouseOver="window.status='$uridotdot'; return true">Parent Directory</a></td>
46 foreach $i (@filenames) {
47 my ($type,$name) = split(/,/, $i);
51 <td><img border="0" src="/icons/folder.gif" alt="[DIR]"></td>
52 <td><a href="$myurl" onClick="top.frames[0].document.forms[0].hiddencicuri.value='$uri$name'; refreshReload(); refreshCICHeader(); this.search='?cicuri=$uri$name';" onMouseOver="window.status='$uri$name'; return true">$name</a></td>
56 } elsif ($type eq "object") {
57 if ($name =~ /\.(con|var|ind)(\.types)?$/) {
61 <td><img border="0" src="/icons/generic.red.gif" alt="[DIR]"></td>
62 <td><a href="" target="cic" onClick="this.href=makeURL('cic','$uri$name','$processor_url','$getter_url')" onMouseOver="window.status='$uri$name'; return true">$name</a>
65 } elsif ($name =~ /\.(con|var|ind)\.ann$/) {
66 my $name_without_ann = $name;
67 $name_without_ann_and_xml =~ s/(.*)\.ann/$1/;
71 <td><img border="0" src="/icons/generic.red.gif" alt="[DIR]"></td>
72 <td><a href="" target="cic" onClick="this.href=makeURL('cic','$uri$name_without_ann&annuri=$uri$name','$processor_url','$getter_url')" onMouseOver="window.status='$uri$name'; return true">$name</a>
78 <td><img border="0" src="/icons/unknown.gif" alt="[DIR]"></td>
86 <td><img border="0" src="/icons/burst.gif" alt="[DIR]"></td>
94 Content-type: text/html
96 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
97 "http://www.w3.org/TR/REC-html40/loose.dtd">
100 <title>Index of $uri</title>
101 <script language="JavaScript" src="http://phd.cs.unibo.it/helm/library3/control.js">
104 <body bgcolor="#ffffff" text="#000000">
108 <hr noshade align="left" width="80%">
113 #================================