Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/Metadata/FormProvider.pm @ 365:7c621bb95e53
working on the metadata model
author | sergey |
---|---|
date | Mon, 02 Dec 2013 02:13:12 +0400 |
parents | 82b6c967bcf1 |
children | 935629bf80df |
comparison
equal
deleted
inserted
replaced
364:82b6c967bcf1 | 365:7c621bb95e53 |
---|---|
1 package IMPL::Web::View::Metadata::FormProvider; | 1 package IMPL::Web::View::Metadata::FormProvider; |
2 use strict; | 2 use strict; |
3 | 3 |
4 use IMPL::declare { | 4 use IMPL::declare { |
5 require => { | |
6 Meta => 'IMPL::Web::View::Metadata::FormMeta' | |
7 }, | |
5 base => [ | 8 base => [ |
6 'IMPL::Object' => undef | 9 'IMPL::Object' => undef |
7 ] | 10 ] |
8 }; | 11 }; |
9 | 12 |
12 } | 15 } |
13 | 16 |
14 sub PopulateChildren { | 17 sub PopulateChildren { |
15 my ($this,$meta) = @_; | 18 my ($this,$meta) = @_; |
16 | 19 |
17 map { | 20 map Meta->new($this,), $meta->schema->content->childNodes; |
18 $_->name, | |
19 $_ | |
20 } $meta->schema->content->childNodes; | |
21 } | 21 } |
22 | 22 |
23 sub GetChild { | 23 sub GetChild { |
24 | 24 |
25 } | |
26 | |
27 sub _IsErrorRelates { | |
28 my ($node,$source,$err) = @_; | |
29 | |
30 # this is an own error | |
31 return 1 if ($node && $err->node && $err->node == $node) || (not($node) && $err->schema == $source ); | |
32 | |
33 # this error relates to the child control | |
34 | |
35 return 0 unless $node; | |
36 | |
37 for (my $n = $err->parent; $n ; $n = $n->parentNode) { | |
38 return 1 if $n == $node; | |
39 } | |
40 | |
41 return 0; | |
25 } | 42 } |
26 | 43 |
27 1; | 44 1; |