Last change
on this file since 36 was
36,
checked in by nanardon, 14 years ago
|
command line parsing is done by the Model
|
File size:
1.1 KB
|
Rev | Line | |
---|
[35] | 1 | package Sophie::Controller::Chat; |
---|
| 2 | use Moose; |
---|
| 3 | use namespace::autoclean; |
---|
| 4 | |
---|
| 5 | BEGIN {extends 'Catalyst::Controller'; } |
---|
| 6 | |
---|
| 7 | =head1 NAME |
---|
| 8 | |
---|
| 9 | Sophie::Controller::Chat - 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 | |
---|
[36] | 27 | |
---|
[35] | 28 | } |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | sub message : XMLRPC { |
---|
| 32 | my ($self, $c, $contexts, $message) = @_; |
---|
| 33 | |
---|
| 34 | my $reqspec = {}; |
---|
| 35 | |
---|
| 36 | foreach my $co (ref $contexts ? @$contexts : $contexts) { |
---|
[36] | 37 | if (ref($co) eq 'HASH') { |
---|
[35] | 38 | foreach (keys %$co) { |
---|
| 39 | $reqspec->{$_} = $co->{$_}; |
---|
| 40 | } |
---|
| 41 | } else { |
---|
[36] | 42 | if (my $coo = $c->forward('/user/fetchdata', [ $co ])) { |
---|
[35] | 43 | foreach (keys %$coo) { |
---|
| 44 | $reqspec->{$_} = $coo->{$_}; |
---|
| 45 | } |
---|
| 46 | } |
---|
| 47 | } |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | $c->stash->{xmlrpc} = $c->forward($c->model('Chat'), [ $reqspec, $message ]); |
---|
| 51 | |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | =head1 AUTHOR |
---|
| 55 | |
---|
| 56 | Olivier Thauvin |
---|
| 57 | |
---|
| 58 | =head1 LICENSE |
---|
| 59 | |
---|
| 60 | This library is free software. You can redistribute it and/or modify |
---|
| 61 | it under the same terms as Perl itself. |
---|
| 62 | |
---|
| 63 | =cut |
---|
| 64 | |
---|
| 65 | __PACKAGE__->meta->make_immutable; |
---|
| 66 | |
---|
| 67 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.