comparison Lib/IMPL/Web/TT/Document.pm @ 109:ddf0f037d460

IMPL::DOM::Node updated to support TT, (added childNodesRef and selectNodesRef for using from TT) Some fixes to the web document model. (beta version)
author wizard
date Mon, 17 May 2010 05:12:08 +0400
parents c6fb6964de4c
children 0475eb382085
comparison
equal deleted inserted replaced
108:c6fb6964de4c 109:ddf0f037d460
8 use IMPL::Class::Property; 8 use IMPL::Class::Property;
9 use File::Spec; 9 use File::Spec;
10 use Scalar::Util qw(blessed); 10 use Scalar::Util qw(blessed);
11 use IMPL::Web::TT::Collection; 11 use IMPL::Web::TT::Collection;
12 use IMPL::Web::TT::Control; 12 use IMPL::Web::TT::Control;
13 use Carp;
13 14
14 BEGIN { 15 BEGIN {
15 private property _provider => prop_all; 16 private property _provider => prop_all;
16 private property _context => prop_all; 17 private property _context => prop_all;
17 public property template => prop_get | owner_set; 18 public property template => prop_get | owner_set;
98 type => $type, 99 type => $type,
99 args => ref $args eq 'HASH' ? $args : {} 100 args => ref $args eq 'HASH' ? $args : {}
100 }; 101 };
101 } 102 }
102 103
104 sub isControlClass {
105 my ($this,$name) = @_;
106 return $this->_controlClassMap->{$name} ? 1 : 0;
107 }
108
103 sub _getControls { 109 sub _getControls {
104 my ($this) = @_; 110 my ($this) = @_;
105 111
106 my ($node) = $this->selectNodes('controls'); 112 my ($node) = $this->selectNodes('controls');
107 return $node; 113 return $node;
188 } 194 }
189 195
190 my @result = $this->selectNodes($method); 196 my @result = $this->selectNodes($method);
191 197
192 return $result[0] if @result; 198 return $result[0] if @result;
199 carp "Looks like you have a mistake, document doesn't have a such property or child: $method";
193 return; 200 return;
194 } 201 }
195 202
196 sub as_list { 203 sub as_list {
197 $_[0]->childNodes; 204 $_[0]->childNodes;