Mercurial > pub > Impl
comparison Lib/IMPL/Web/Handler/RestController.pm @ 332:04a093f0a5a6
IMPL::Web::Application refactoring: resources are created per client request
author | cin |
---|---|
date | Sun, 09 Jun 2013 21:48:57 +0400 |
parents | 4abda21186cd |
children | 71221d79e6b4 |
comparison
equal
deleted
inserted
replaced
331:2ff1726c066c | 332:04a093f0a5a6 |
---|---|
47 return @segments; | 47 return @segments; |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 sub Invoke { | 51 sub Invoke { |
52 my ($this,$action) = @_; | 52 my ($this,$request) = @_; |
53 | 53 |
54 my $method = $action->requestMethod; | 54 my $method = $request->requestMethod; |
55 | 55 |
56 my @segments = $this->GetResourcePath($action); | 56 my @segments = $this->GetResourcePath($request); |
57 | 57 |
58 my $res = $this->resourceFactory->new( | 58 my $res = $this->resourceFactory->new( |
59 id => 'root', | 59 id => 'root', |
60 location => Locator->new(base => $action->application->baseUrl), | 60 request => $request, |
61 application => $action->application | 61 location => Locator->new(base => $request->application->baseUrl), |
62 ); | 62 ); |
63 | 63 |
64 while(@segments) { | 64 while(@segments) { |
65 my $id = shift @segments; | 65 my $id = shift @segments; |
66 | |
67 $res = $res->FetchChildResource($id); | 66 $res = $res->FetchChildResource($id); |
68 } | 67 } |
69 | 68 |
70 $res = $res->InvokeHttpVerb($method,$action); | 69 $res = $res->InvokeHttpVerb($method); |
71 } | 70 } |
72 | 71 |
73 1; | 72 1; |
74 | 73 |
75 __END__ | 74 __END__ |