/[webpac2]/Webpacus/lib/Webpacus/Controller/Results.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

Contents of /Webpacus/lib/Webpacus/Controller/Results.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 117 - (show annotations)
Wed Nov 23 21:52:25 2005 UTC (18 years, 5 months ago) by dpavlin
File size: 1154 byte(s)
 r9075@llin:  dpavlin | 2005-11-23 22:26:53 +0100
 - added filter to search with search words in ISTRINC on selected field.
 - added new form field to search over all results (with magic name "all"

1 package Webpacus::Controller::Results;
2
3 use strict;
4 use warnings;
5 use base qw/Catalyst::Controller/;
6
7 =head1 NAME
8
9 Webpacus::Controller::Results - Display results from WebPAC
10
11 =head1 SYNOPSIS
12
13 See L<Webpacus>
14
15 =head1 DESCRIPTION
16
17 Catalyst Controller.
18
19 =head1 METHODS
20
21 =over 4
22
23 =item default
24
25 =cut
26
27 sub default : Private {
28 my ( $self, $c ) = @_;
29
30 my $webpac = $c->comp('Model::WebPAC');
31 my $params = $c->req->params;
32 my $log = $c->log;
33
34 use Data::Dumper;
35 $log->debug("results got params: " . Dumper( $params ) );
36
37 my $q;
38 my @attr;
39
40 foreach my $f (keys %{ $params }) {
41
42 next if ($f =~ m/^_/o);
43
44 my $v = $params->{$f} || next;
45
46 push @attr, "$f ISTRINC $v";
47 $q .= "$v ";
48 }
49
50 $c->stash->{html_results} = sub {
51 my $res = $webpac->search( $q, $params->{'_template'}, @attr );
52 # $log->debug("controller got " . ( $#{$res} + 1 ) . " results for '$q' " . Dumper( $res ));
53 return $res;
54 };
55
56 $c->stash->{template} = 'results.tt';
57 }
58
59 =back
60
61
62 =head1 AUTHOR
63
64 Dobrica Pavlinusic,,,
65
66 =head1 LICENSE
67
68 This library is free software, you can redistribute it and/or modify
69 it under the same terms as Perl itself.
70
71 =cut
72
73 1;

  ViewVC Help
Powered by ViewVC 1.1.26