diff Lib/IMPL/Web/Handler/TTView.pm @ 266:89179bb8c388

*corrected TTView to handle plain (and undefined) values *added URL generating methods to Application::Action *fixed the compare validatior for schemas
author cin
date Mon, 14 Jan 2013 03:10:06 +0400
parents 32aceba4ee6d
children a8dbddf491dd
line wrap: on
line diff
--- a/Lib/IMPL/Web/Handler/TTView.pm	Thu Jan 10 03:25:02 2013 +0400
+++ b/Lib/IMPL/Web/Handler/TTView.pm	Mon Jan 14 03:10:06 2013 +0400
@@ -68,7 +68,7 @@
       $this->loader->document( eval { $view->template } || $this->SelectView( $action, ref $model ),
         $vars );
         
-    $doc->location($view->location);
+    $doc->location($action->context->{resourceLocation});
         
     my %responseParams = (
         type => $this->contentType,
@@ -89,26 +89,22 @@
     my ( $this, $action, $class ) = @_;
 
     my @path = split /\//, $action->query->path_info(), -1;
-
+    
     shift @path;    # remove always empty leading segment
 
-    my $last = pop @path;
-    $last =~ s/\.\w+$//;
-    $last ||= $this->indexResource;
-    push @path, $last;
-
     $this->BuildCache unless $this->_selectorsCache;
     my $cache = $this->_selectorsCache;
 
     @path = reverse @path;
 
     foreach
-      my $subclass ( $class ? ( _GetHierarchy($class), '-default' ) : '-plain' )
+      my $subclass ( $class ? ( _GetHierarchy($class), '-default' ) : '-default' )
     {
         my @results;
         push @results,
           { result => $this->_classTemplates->{$subclass}, level => 0 }
           if $this->_classTemplates->{$subclass};
+          
         if ( $cache->{$subclass} ) {
             my $alternatives =
               [ { selector => $cache->{$subclass}, immediate => 1 } ];
@@ -190,7 +186,7 @@
     my ( $this, $segment, $alternatives, $results ) = @_;
 
     my @next;
-
+    
     foreach my $alt (@$alternatives) {
         while ( my ( $selector, $match ) = each %{ $alt->{selector} } ) {