/[webpac2]/Webpacus/lib/Webpacus/Model/WebPAC.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/lib/Webpacus/Model/WebPAC.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 92 by dpavlin, Tue Nov 22 12:57:09 2005 UTC revision 94 by dpavlin, Tue Nov 22 12:57:20 2005 UTC
# Line 3  package Webpacus::Model::WebPAC; Line 3  package Webpacus::Model::WebPAC;
3  use strict;  use strict;
4  use warnings;  use warnings;
5  use lib '/data/webpac2/lib';  use lib '/data/webpac2/lib';
6  use base qw/Catalyst::Model/;  use base qw/
7  use WebPAC::Search::Estraier;          Catalyst::Model
8            WebPAC::Search::Estraier
9    /;
10  use Data::Dumper;  use Data::Dumper;
11    
12  =head1 NAME  =head1 NAME
# Line 41  sub new { Line 43  sub new {
43          $self->config($config);          $self->config($config);
44    
45          my $log = $c->log;          my $log = $c->log;
46            $self->{log} = $log;
47    
48  #       if (! $c->stash->{est}) {          my $est_cfg = $c->config->{hyperestraier};
49            $est_cfg->{'log'} = $log;
50    
51                  my $est_cfg = $c->config->{hyperestraier};          $log->debug("using config:" . Dumper($est_cfg) );
                 $est_cfg->{'log'} = $log;  
52    
53                  $log->debug("using config:" . Dumper($est_cfg) );          $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } );
54    
55  #               $c->stash->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } );          return $self;
 #       }  
56    
57  #       $log->debug("param: " . Dumper($c->req->params));  }
58    
59  #       $c->stash->{est}->search(  sub search {
60  #               query => $c->req->params->{Title},          my ( $self, $query ) = @_;
 #               max => 100,  
 #       );  
61    
62          return $self;          $self->{log}->debug("search got query: $query<--");
63    
64            my @results = $self->{est}->search(
65                    query => $query,
66                    attr => [ '@uri' ],
67                    max => 100,
68            );
69    
70            return @results;
71  }  }
72    
73    
74            
75    
76  =head1 AUTHOR  =head1 AUTHOR
77    
78  Dobrica Pavlinusic  Dobrica Pavlinusic

Legend:
Removed from v.92  
changed lines
  Added in v.94

  ViewVC Help
Powered by ViewVC 1.1.26