diff Lib/IMPL/Web/Handler/RestController.pm @ 202:5146e17a7b76

IMPL::Web::Application::RestResource fixes, documentation
author sergey
date Wed, 25 Apr 2012 02:49:23 +0400
parents e743a8481327
children c8fe3f84feba
line wrap: on
line diff
--- a/Lib/IMPL/Web/Handler/RestController.pm	Tue Apr 24 19:52:07 2012 +0400
+++ b/Lib/IMPL/Web/Handler/RestController.pm	Wed Apr 25 02:49:23 2012 +0400
@@ -47,6 +47,7 @@
 	shift @segments;
 	
 	my ($obj,$view) = (pop(@segments) =~ m/(.*?)(?:\.(\w+))?$/);
+	push @segments, $obj;
 	
 	if ($this->types and my $type = $this->types->{$view}) {
         $action->response->contentType($type);		
@@ -56,12 +57,13 @@
 	
 	while(@segments) {
 		my $id = shift @segments;
-		$res = $this->contract->Transform( $res->InvokeHttpMethod('GET',$id,$action), { parent => $res, id => $id } );
+		
+		$res = $res->FetchChildResource($id,$action);
 		
 		die NotFoundException->new() unless $res;
 	}
 	
-	$res = $res->InvokeHttpMethod($method,$obj,$action);
+	$res = $res->InvokeHttpMethod($method,$action);
 }
 
 1;