Remove dead code: OpenILS::WWW::Web and OpenILS::WWW::Method modules
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Mar 2011 22:27:03 +0000 (22:27 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Mar 2011 22:27:03 +0000 (22:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19554 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/MANIFEST
Open-ILS/src/perlmods/lib/OpenILS/WWW/Method.pm.in [deleted file]
Open-ILS/src/perlmods/lib/OpenILS/WWW/Web.pm.in [deleted file]
Open-ILS/src/perlmods/t/15-OpenILS-WWW.t
configure.ac

index fc0ec78..3641b6f 100644 (file)
@@ -162,7 +162,6 @@ lib/OpenILS/WWW/BadDebt.pm
 lib/OpenILS/WWW/EGWeb.pm
 lib/OpenILS/WWW/Exporter.pm
 lib/OpenILS/WWW/IDL2js.pm
-lib/OpenILS/WWW/Method.pm
 lib/OpenILS/WWW/PasswordReset.pm
 lib/OpenILS/WWW/Proxy.pm
 lib/OpenILS/WWW/Redirect.pm
@@ -172,6 +171,5 @@ lib/OpenILS/WWW/SuperCat.pm
 lib/OpenILS/WWW/SuperCat/Feed.pm
 lib/OpenILS/WWW/TemplateBatchBibUpdate.pm
 lib/OpenILS/WWW/Vandelay.pm
-lib/OpenILS/WWW/Web.pm
 lib/OpenILS/WWW/XMLRPCGateway.pm
 MANIFEST                       This list of files
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Method.pm.in b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Method.pm.in
deleted file mode 100644 (file)
index 3bec97c..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-package OpenILS::WWW::Method;
-use strict; use warnings;
-
-use Apache2::Log;
-use Apache2::Const -compile => qw(OK REDIRECT :log);
-use APR::Const    -compile => qw(:error SUCCESS);
-use Apache2::RequestRec ();
-use Apache2::RequestIO ();
-use Apache2::RequestUtil;
-
-use OpenSRF::Utils::JSON;
-
-use CGI ();
-
-use OpenSRF::EX qw(:try);
-use OpenSRF::System;
-
-my %session_hash;
-
-use constant MAX_SESSION_REQUESTS => 20;
-
-sub handler {
-
-       use Data::Dumper;
-
-
-       my $apache = shift;
-       my $cgi = CGI->new( $apache );
-
-       print "Content-type: text/plain; charset=utf-8\n\n";
-       #print $cgi->header;
-
-       my @p = $cgi->param();
-       warn "Params: " . Dumper(\@p);
-
-       my $method = $cgi->param("method");
-       my $service = $cgi->param("service");
-
-       my $err = undef;
-
-       if( ! $service || ! $method ) {
-               $err = { 
-                       is_err  => 1, 
-                       err_msg => "Service name and method name required to fulfill request",
-               };
-       }
-
-       if($err) {
-               print  OpenSRF::Utils::JSON->perl2JSON($err);
-               return Apache2::Const::OK;
-       }
-
-       my @param_array;
-       my %param_hash;
-
-       warn "here\n";
-
-       if(defined($cgi->param("param"))) {
-               for my $param ( $cgi->param("param")) {
-                       push( @param_array, OpenSRF::Utils::JSON->JSON2perl( $param ));
-               }
-       } else {
-               for my $param ($cgi->param()) {
-                       $param_hash{$param} = OpenSRF::Utils::JSON->JSON2perl($cgi->param($param))
-                               unless( $param eq "method" or $param eq "service" );
-               }
-       }
-
-
-       if( @param_array ) {
-               perform_method($service, $method, @param_array);
-       } else {
-               perform_method($service, $method, %param_hash);
-       }
-
-       return Apache2::Const::OK;
-}
-
-sub child_init_handler {
-       OpenSRF::System->bootstrap_client( 
-               config_file => "@sysconfdir@/opensrf_core.xml" );
-}
-
-
-sub perform_method {
-
-       my ($service, $method, @params) = @_;
-
-       warn "performing method $method for service $service with params @params\n";
-
-       my $session;
-
-       if($session_hash{$service} ) {
-
-               $session = $session_hash{$service};
-               $session->{web_count} += 1;
-
-               if( $session->{web_count} > MAX_SESSION_REQUESTS) {
-                       $session->disconnect();
-                       $session->{web_count} = 1;
-               }
-
-       } else { 
-
-               $session = OpenSRF::AppSession->create($service); 
-               $session_hash{$service} = $session;
-               $session->{web_count} = 1;
-
-       }
-
-       my $request = $session->request( $method, @params );
-
-       my @results;
-       while( my $response = $request->recv(20) ) {
-               
-               if( UNIVERSAL::isa( $response, "Error" )) {
-                       warn "Received exception: " . $response->stringify . "\n";
-                       my $err = { 
-                               is_err  => 1, 
-                               err_msg => "Error Completing Request:\n " . 
-                                       "Service: $service \nMethod: $method \nParams: @params \n" .
-                                       $response->stringify() . "\n",
-                       };
-                       print OpenSRF::Utils::JSON->perl2JSON($err);
-                       $request->finish();
-                       return 0;
-               }
-
-               my $content = $response->content;
-               push @results, $content;
-       }
-
-
-       if(!$request->complete) { 
-               warn "ERROR Completing Request"; 
-               my $err = { 
-                       is_err  => 1, 
-                       err_msg => "Error Completing Request:\n ".
-                               "Service: $service \nMethod: $method \nParams: @params \n" .
-                               "request->complete test failed in OpenILS::Web::Method\n" 
-               };
-               print OpenSRF::Utils::JSON->perl2JSON($err); 
-               $request->finish();
-               return 0;
-       }
-
-       $request->finish();
-       $session->finish();
-
-       warn "Results: \n";
-       warn Dumper \@results;
-
-       print OpenSRF::Utils::JSON->perl2JSON( \@results );
-
-       return 1;
-}
-
-# This module appears unfinshed and/or obsolete with many unconditional warns/dumps.
-# File is not referenced elsewhere in the codebase.  Candidate for deletion.
-
-1;
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Web.pm.in b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Web.pm.in
deleted file mode 100644 (file)
index 4087b09..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-package OpenILS::WWW::Web;
-use strict;
-use warnings;
-
-use Apache2::Log;
-use Apache2::Const -compile => qw(OK REDIRECT :log);
-use APR::Const     -compile => qw(:error SUCCESS);
-use Apache2::RequestRec ();
-use Apache2::RequestIO  ();
-use Apache2::RequestUtil;
-
-#use CGI ();
-use Template;
-
-use OpenSRF::EX qw(:try);
-use OpenSRF::System;
-
-my $main_ttk       = "opac/logic/page_router.ttk";
-my $error_ttk      = "opac/pages/error.ttk";
-my $init_ttk       = "opac/logic/page_init.ttk";
-my $bootstrap      = "@sysconfdir@/opensrf_core.xml";
-my $child_init_ttk = "opac/logic/child_init.ttk";
-
-my $includes = [];    # [  '/pines/cvs/ILS/Open-ILS/src/templates' ];
-
-sub import {
-    my ( $self, $tdir ) = @_;
-    $includes = [$tdir];
-}
-
-my $plugin_base = 'OpenILS::Template::Plugin';
-
-sub handler {
-
-    my $apache = shift;
-    print "Content-type: text/html; charset=utf-8\n\n";
-
-    _process_template(
-        apache      => $apache,
-        template    => $main_ttk,
-        pre_process => $init_ttk
-    );
-
-    return Apache2::Const::OK;
-}
-
-sub child_init_handler {
-    _process_template( template => $child_init_ttk );
-}
-
-sub _process_template {
-
-    my %params      = @_;
-    my $ttk         = $params{template}    || return undef;
-    my $apache      = $params{apache}      || undef;
-    my $pre_process = $params{pre_process} || undef;
-    my $param_hash  = $params{params}      || {};
-
-    my $template;
-
-    $template = Template->new(
-        {
-            OUTPUT       => $apache,
-            ABSOLUTE     => 1,
-            RELATIVE     => 1,
-            PLUGIN_BASE  => $plugin_base,
-            PRE_PROCESS  => $pre_process,
-            INCLUDE_PATH => $includes,
-            PRE_CHOMP    => 1,
-            POST_CHOMP   => 1,
-        }
-    );
-
-    try {
-
-        if ( !$template->process( $ttk, $param_hash ) ) {
-            warn "Error Occured: " . $template->error();
-            my $err = $template->error();
-            $err =~ s/\n/\<br\/\>/g;
-            warn "Error processing template $ttk\n";
-            my $string =
-                "<br><b>Unable to process template:<br/><br/> " 
-              . $err
-              . "!!!</b>";
-            $template->process( $error_ttk, { error => $string } );
-        }
-
-    }
-    catch Error with {
-        my $e = shift;
-        warn "Error processing template $ttk:  $e - $@ \n";
-        print "<center><br/><br/><b>Error<br/><br/> $e <br/><br/> $@ </b><br/></center>";
-        return;
-    };
-
-}
-
-# This module appears obsolete (probably superceded by EGWeb.pm
-# The template files it references do not exist in the codebase.
-# File is not referenced elsewhere in the codebase.  Candidate for deletion.
-
-1;
index d22c3b0..355449b 100644 (file)
@@ -1,16 +1,14 @@
 #!perl -T
 
-use Test::More tests => 12;
+use Test::More tests => 10;
 
 use_ok( 'OpenILS::WWW::BadDebt' );
 use_ok( 'OpenILS::WWW::EGWeb' );
 use_ok( 'OpenILS::WWW::Exporter' );
 use_ok( 'OpenILS::WWW::IDL2js' );
-use_ok( 'OpenILS::WWW::Method' );
 use_ok( 'OpenILS::WWW::PasswordReset' );
 use_ok( 'OpenILS::WWW::Proxy' );
 use_ok( 'OpenILS::WWW::Redirect' );
 use_ok( 'OpenILS::WWW::TemplateBatchBibUpdate' );
 use_ok( 'OpenILS::WWW::Vandelay' );
-use_ok( 'OpenILS::WWW::Web' );
 use_ok( 'OpenILS::WWW::XMLRPCGateway' );
index 329203e..88a84dc 100644 (file)
@@ -375,8 +375,6 @@ AC_CONFIG_FILES([Makefile
          Open-ILS/src/extras/eg_config
          Open-ILS/src/extras/fast-extract
          Open-ILS/src/perlmods/Makefile
-         Open-ILS/src/perlmods/lib/OpenILS/WWW/Method.pm
-         Open-ILS/src/perlmods/lib/OpenILS/WWW/Web.pm
          Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm],
         [
             if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;