source: server/trunk/web/lib/Sophie/Controller/Search/File.pm @ 147

Last change on this file since 147 was 147, checked in by nanardon, 14 years ago
  • split search function (will probably break something...)
File size: 1.3 KB
Line 
1package Sophie::Controller::Search::File;
2use Moose;
3use namespace::autoclean;
4
5BEGIN {extends 'Catalyst::Controller'; }
6
7=head1 NAME
8
9Sophie::Controller::Search::File - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19
20=head2 index
21
22=cut
23
24sub index :Path :Args(0) {
25    my ( $self, $c ) = @_;
26
27    $c->response->body('Matched Sophie::Controller::Search::File in Search::File.');
28}
29
30sub byname : Private {
31    my ( $self, $c, $searchspec, $file) = @_;
32    $searchspec ||= {};
33
34    my @col = qw(dirname basename md5 size pkgid count);
35    $c->stash->{column} = [ @col, qw(has_content perm user group) ];
36
37    $c->stash->{xmlrpc} = [
38       map { { $_->get_columns } }
39       $c->forward('/search/file_rs', [ $searchspec, $file ])->all
40    ];
41}
42
43sub byname_rpc : XMLRPCPath('byname') {
44    my ( $self, $c, $searchspec, $file) = @_;
45    $searchspec ||= {};
46
47    $c->stash->{rs} = $c->forward('/search/file_rs', [ $searchspec, $file ]);
48   
49    my @col = qw(dirname basename md5 size pkgid count);
50    $c->stash->{column} = [ @col, qw(has_content perm user group) ];
51   
52}
53
54
55=head1 AUTHOR
56
57Olivier Thauvin
58
59=head1 LICENSE
60
61This library is free software. You can redistribute it and/or modify
62it under the same terms as Perl itself.
63
64=cut
65
66__PACKAGE__->meta->make_immutable;
67
681;
Note: See TracBrowser for help on using the repository browser.