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 | |
---|
1 | package Sophie::Controller::Search::File; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | |
---|
5 | BEGIN {extends 'Catalyst::Controller'; } |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | Sophie::Controller::Search::File - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | |
---|
20 | =head2 index |
---|
21 | |
---|
22 | =cut |
---|
23 | |
---|
24 | sub index :Path :Args(0) { |
---|
25 | my ( $self, $c ) = @_; |
---|
26 | |
---|
27 | $c->response->body('Matched Sophie::Controller::Search::File in Search::File.'); |
---|
28 | } |
---|
29 | |
---|
30 | sub 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 | |
---|
43 | sub 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 | |
---|
57 | Olivier Thauvin |
---|
58 | |
---|
59 | =head1 LICENSE |
---|
60 | |
---|
61 | This library is free software. You can redistribute it and/or modify |
---|
62 | it under the same terms as Perl itself. |
---|
63 | |
---|
64 | =cut |
---|
65 | |
---|
66 | __PACKAGE__->meta->make_immutable; |
---|
67 | |
---|
68 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.