#!@FULL_PERL_PATH@ -w # Need to specify the full path of Perl above, e.g. for Windows something like #!C:\\Perl32\\bin\\perl -w use strict; # Set this to 1 to work around IIS 6 craziness my $iis6_mode = 0; # IIS 6: for some reason, IIS runs this script with the working directory set to the Greenstone # directory rather than the cgi-bin directory, causing lots of stuff to fail if ($iis6_mode) { # Change into cgi-bin directory chdir("cgi-bin"); } # We use require and an eval here (instead of "use") to catch any errors loading the module (for IIS) eval("require \"gsdlCGI.pm\""); if ($@) { print STDOUT "Content-type:text/plain\n\n"; print STDOUT "ERROR: $@\n"; exit 0; } sub main { # $ENV{'QUERY_STRING'} = "a=set-import-metadata&c=espresso-music&d=HASH012d6f72cde5dc48162f4a1d.1&metaname=annotation&metapos=0&metavalue=adfadfad"; # $ENV{'QUERYSTRING'} = "a=set-import-metadata&c=espresso-music&d=HASH012d6f72cde5dc48162f4a1d.1&metaname=annotation&metapos=0&metavalue=adfadfad"; # $ENV{'REQUEST_METHOD'} = "GET"; my $gsdl_cgi = new gsdlCGI(); # Load the Greenstone modules that we need to use $gsdl_cgi->setup_gsdl(); my $gsdlhome = $ENV{'GSDLHOME'}; $gsdl_cgi->checked_chdir($gsdlhome); ## require cgiactions::metadataaction; # Useful debug statement for seeing what packages have been included #### printf("%-45s%-s\n",$_,$INC{$_}) foreach (sort keys %INC); $gsdl_cgi->parse_cgi_args(); # We don't want the gsdlCGI module to return errors and warnings in XML $gsdl_cgi->{'xml'} = 0; my $fn = $gsdl_cgi->clean_param("fn"); # frame number if (defined $fn) { my $json_str = $gsdl_cgi->param("json"); my $output_dir = &util::filename_cat("C:","cygwin","tmp"); # my $output_dir = &filename_cat($gsdlhome,"collect",$collect,"export"); my $frame_filename = &util::filename_cat($output_dir,"$fn.exp"); if (open(FOUT,">$frame_filename")) { print FOUT $json_str; close(FOUT); # write out next free frame num $gsdl_cgi->generate_message("html-to-expeditee saved frame $fn"); } else { $gsdl_cgi->generate_error("Failed to open $frame_filename for output"); } } else { my $html_form = < HTML to Expeditee Frames
Convert the collection to Expeditee frames by traversing the classifier

EOT print "Content-type:text/html\n\n"; print $html_form; } } &main();