/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92 - (hide annotations)
Tue Nov 22 12:57:09 2005 UTC (18 years, 5 months ago) by dpavlin
File size: 1346 byte(s)
 r9013@llin:  dpavlin | 2005-11-21 23:16:42 +0100
 first try at model

1 dpavlin 92 package Webpacus::Model::WebPAC;
2    
3     use strict;
4     use warnings;
5     use lib '/data/webpac2/lib';
6     use base qw/Catalyst::Model/;
7     use WebPAC::Search::Estraier;
8     use Data::Dumper;
9    
10     =head1 NAME
11    
12     Webpacus::Model::WebPAC - Catalyst Model
13    
14     =head1 SYNOPSIS
15    
16     See L<Webpacus> and L<WebPAC>.
17    
18     =head1 DESCRIPTION
19    
20     Catalyst Model for access to WebPAC data.
21    
22     =head2 new
23    
24     Configuration for hyperestraier in C<config.yaml> like this:
25    
26     --- #YAML:1.0
27     # DO NOT USE TABS FOR INDENTATION OR label/value SEPARATION!!!
28    
29     # configuration for hyper estraier full text search engine
30     hyperestraier:
31     url: 'http://localhost:1978/node/webpac2'
32     user: 'admin'
33     passwd: 'admin'
34    
35     =cut
36    
37     sub new {
38     my ( $self, $c, $config ) = @_;
39    
40     $self = $self->NEXT::new($c, $config);
41     $self->config($config);
42    
43     my $log = $c->log;
44    
45     # if (! $c->stash->{est}) {
46    
47     my $est_cfg = $c->config->{hyperestraier};
48     $est_cfg->{'log'} = $log;
49    
50     $log->debug("using config:" . Dumper($est_cfg) );
51    
52     # $c->stash->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } );
53     # }
54    
55     # $log->debug("param: " . Dumper($c->req->params));
56    
57     # $c->stash->{est}->search(
58     # query => $c->req->params->{Title},
59     # max => 100,
60     # );
61    
62     return $self;
63    
64     }
65    
66     =head1 AUTHOR
67    
68     Dobrica Pavlinusic
69    
70     =head1 LICENSE
71    
72     This library is free software, you can redistribute it and/or modify
73     it under the same terms as Perl itself.
74    
75     =cut
76    
77     1;

  ViewVC Help
Powered by ViewVC 1.1.26