Last change
on this file since 1570 was
1570,
checked in by nanardon, 8 years ago
|
Add Remote/ tree for distant quering
|
File size:
953 bytes
|
Line | |
---|
1 | package LATMOS::Accounts::Web::Controller::Remote::Search; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | |
---|
5 | BEGIN { extends 'Catalyst::Controller'; } |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | LATMOS::Accounts::Web::Controller::Remote::Search - 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 | my $otype = $c->req->param('otype'); |
---|
28 | my @search = $c->req->param('q'); |
---|
29 | |
---|
30 | my $base = $c->model('Accounts')->db; |
---|
31 | |
---|
32 | if (!$base->is_supported_object($otype)) { |
---|
33 | $c->res->status('404'); |
---|
34 | return; |
---|
35 | } |
---|
36 | |
---|
37 | $c->stash->{data} = [ |
---|
38 | $c->model('Accounts')->db->search_objects($otype, @search) |
---|
39 | ] |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | =encoding utf8 |
---|
45 | |
---|
46 | =head1 AUTHOR |
---|
47 | |
---|
48 | Olivier Thauvin,Guyancourt - B1428,+33 1 80285052, |
---|
49 | |
---|
50 | =head1 LICENSE |
---|
51 | |
---|
52 | This library is free software. You can redistribute it and/or modify |
---|
53 | it under the same terms as Perl itself. |
---|
54 | |
---|
55 | =cut |
---|
56 | |
---|
57 | __PACKAGE__->meta->make_immutable; |
---|
58 | |
---|
59 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.