From: Mike G. v. a. <we...@ma...> - 2010-05-31 23:46:24
|
Log Message: ----------- attempted fix for finding applets automatically. Modified Files: -------------- pg/lib: PGalias.pm Revision Data ------------- Index: PGalias.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/PGalias.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/PGalias.pm -Llib/PGalias.pm -u -r1.6 -r1.7 --- lib/PGalias.pm +++ lib/PGalias.pm @@ -111,6 +111,8 @@ $self->{displayMode} = $envir->{displayMode}; $self->{externalGif2EpsPath} = $envir->{externalGif2EpsPath}; $self->{externalPng2EpsPath} = $envir->{externalPng2EpsPath}; + + $self->{appletPath} = $self->{envir}->{pgDirectories}->{appletPath}; # # Find auxiliary files even when the main file is in tempates/tmpEdit # @@ -757,22 +759,23 @@ sub findAppletCodebase { my $self = shift; my $fileName = shift; # probably the name of a jar file - return $appletCodebaseLocations{$fileName} #check cache first + #check cache first + return $appletCodebaseLocations{$fileName} if defined($appletCodebaseLocations{$fileName}) and $appletCodebaseLocations{$fileName} =~/\S/; - + my $appletPath = $self->{appletPath}; foreach my $appletLocation (@{$appletPath}) { if ($appletLocation =~ m|^/|) { $appletLocation = "$server_root_url$appletLocation"; } return $appletLocation; # --hack workaround -- just pick the first location and use that -- no checks -#hack to workaround conflict between lwp-request and apache2 +# hack to workaround conflict between lwp-request and apache2 # comment out the check_url block -# my $url = "$appletLocation/$fileName"; -# if ($self->check_url($url)) { -# $appletCodebaseLocations{$fileName} = $appletLocation; #update cache -# return $appletLocation # return codebase part of url -# } + my $url = "$appletLocation/$fileName"; + if ($self->check_url($url)) { + $appletCodebaseLocations{$fileName} = $appletLocation; #update cache + return $appletLocation # return codebase part of url + } } return "Error: $fileName not found at ". join(", ", @{$appletPath} ); # no file found } |