#!/cygdrive/c/strawberry/perl/bin/perl -w # Need to specify the full path of Perl above, e.g. for Windows something like #!C:\\Perl32\\bin\\perl -w use strict; my $iis6_mode = 0; if($iis6_mode){ #Change into cgi-bin directory chdir("cgi-bin"); } eval("require \"gsdlCGI.pm\""); if ($@) { print STDOUT "Content-type:text/plain\n\n"; print STDOUT "ERROR: $@\n"; exit 0; } sub display_output { my($docID,$c,$assocfilepath,$site) = @_; my $iframeURL = "library/collection/$c/document/$docID"."?p.showAssocFilePath=1"; #Render an html page to display and export item. my $html = < Export Document to Expeditee

Exporting following document to Expeditee...


EOT print "Content-type:text/html\n\n"; print $html; } sub main { my $gsdl_cgi = new gsdlCGI(); #Load needed GSDL modules $gsdl_cgi->setup_gsdl(); my $gsdlhome = $ENV{'GSDLHOME'}; $gsdl_cgi->checked_chdir($gsdlhome); require cgiactions::ExpediteeExportAction; $gsdl_cgi->parse_cgi_args(); $gsdl_cgi->{'xml'} = 0; my $fn = $gsdl_cgi->param("fn"); if(defined $fn){ my $site = $gsdl_cgi->clean_param("site"); my $c = $gsdl_cgi->clean_param("c"); my $a = $gsdl_cgi->clean_param("a"); #assocfilepath my $json = $gsdl_cgi->clean_param("json"); my $action = new ExpediteeExportAction($gsdl_cgi,$iis6_mode); $action->do_action(); }else{ my $docID = $gsdl_cgi->clean_param("docID"); my $c = $gsdl_cgi->clean_param("c"); my $assocfilepath = $gsdl_cgi->clean_param("assocfilepath"); my $site = $gsdl_cgi->clean_param("site"); if(!defined $site){ $gsdl_cgi->generate_error("No site specified."); } display_output($docID,$c,$assocfilepath,$site); } } &main();