Mercurial > pub > Impl
comparison Lib/IMPL/Web/Application/Resource.pm @ 400:ef37ec102dab
redirection support while fetching child resources
| author | cin |
|---|---|
| date | Wed, 14 May 2014 17:27:32 +0400 |
| parents | 54b1dc9e808a |
| children |
comparison
equal
deleted
inserted
replaced
| 399:753e981782ce | 400:ef37ec102dab |
|---|---|
| 12 require => { | 12 require => { |
| 13 Exception => 'IMPL::Exception', | 13 Exception => 'IMPL::Exception', |
| 14 OpException => '-IMPL::InvalidOperationException', | 14 OpException => '-IMPL::InvalidOperationException', |
| 15 NotFoundException => 'IMPL::Web::NotFoundException', | 15 NotFoundException => 'IMPL::Web::NotFoundException', |
| 16 ResourceInterface => '-IMPL::Web::Application', | 16 ResourceInterface => '-IMPL::Web::Application', |
| 17 HttpResponse => 'IMPL::Web::HttpResponse', | |
| 18 HttpResponseResource => 'IMPL::Web::Application::HttpResponseResource', | |
| 17 Loader => 'IMPL::Code::Loader' | 19 Loader => 'IMPL::Code::Loader' |
| 18 }, | 20 }, |
| 19 base => [ | 21 base => [ |
| 20 'IMPL::Object' => undef, | |
| 21 'IMPL::Web::Application::ResourceBase' => '@_' | 22 'IMPL::Web::Application::ResourceBase' => '@_' |
| 22 ], | 23 ], |
| 23 props => [ | 24 props => [ |
| 24 access => PROP_RW, | 25 access => PROP_RW, |
| 25 verbs => PROP_RW, | 26 verbs => PROP_RW, |
| 108 | 109 |
| 109 my $info = $this->Fetch($childId); | 110 my $info = $this->Fetch($childId); |
| 110 | 111 |
| 111 return $info | 112 return $info |
| 112 if (is($info,ResourceInterface)); | 113 if (is($info,ResourceInterface)); |
| 114 | |
| 115 $info = { | |
| 116 response => $info, | |
| 117 class => HttpResponseResource | |
| 118 } | |
| 119 if is($info,HttpResponse); | |
| 113 | 120 |
| 114 return $this->CreateChildResource($info, $childId) | 121 return $this->CreateChildResource($info, $childId) |
| 115 if ref($info) eq 'HASH'; | 122 if ref($info) eq 'HASH'; |
| 116 | 123 |
| 117 die OpException->new("Invalid resource description", $childId, $info); | 124 die OpException->new("Invalid resource description", $childId, $info); |
