# HG changeset patch
# User Sergey
# Date 1254318232 -14400
# Node ID 716b287d479586b064602114e595e1ba8cc69147
# Parent da5bc24b3d3c7e8622e5a8843507f6b3a3db2a26# Parent fafe56cfcd69edf6d9b6cc35c5b074b280e98dc6
merge
diff -r da5bc24b3d3c -r 716b287d4795 Lib/IMPL/DOM/Node.pm
--- a/Lib/IMPL/DOM/Node.pm Wed Sep 30 17:41:32 2009 +0400
+++ b/Lib/IMPL/DOM/Node.pm Wed Sep 30 17:43:52 2009 +0400
@@ -234,7 +234,7 @@
join '', $this->nodeValue || '', map $_->nodeValue || '', @{$this->childNodes};
}
-sub Property {
+sub nodeProperty {
my $this = shift;
my $name = shift;
diff -r da5bc24b3d3c -r 716b287d4795 Lib/IMPL/DOM/Schema.pm
--- a/Lib/IMPL/DOM/Schema.pm Wed Sep 30 17:41:32 2009 +0400
+++ b/Lib/IMPL/DOM/Schema.pm Wed Sep 30 17:43:52 2009 +0400
@@ -79,24 +79,28 @@
IMPL::DOM::Schema::Node->new(name => 'NodeSet', minOccur => 0, type => 'NodeSet'),
IMPL::DOM::Schema::Node->new(name => 'NodeList', minOccur => 0, type => 'NodeSet'),
IMPL::DOM::Schema::SimpleNode->new(name => 'Node', minOccur => 0, maxOccur => 'unbounded')
- )
+ ),
+ new IMPL::DOM::Schema::Property(name => 'type')
),
IMPL::DOM::Schema::ComplexType->new(type => 'ComplexNode', nativeType => 'IMPL::DOM::Schema::ComplexNode')->appendRange(
IMPL::DOM::Schema::NodeList->new()->appendRange(
IMPL::DOM::Schema::Node->new(name => 'NodeSet', minOccur => 0, type => 'NodeSet'),
IMPL::DOM::Schema::Node->new(name => 'NodeList', minOccur => 0, type => 'NodeSet'),
IMPL::DOM::Schema::SimpleNode->new(name => 'Node', minOccur => 0, maxOccur => 'unbounded')
- )
+ ),
+ new IMPL::DOM::Schema::Property(name => 'name')
),
IMPL::DOM::Schema::ComplexType->new(type => 'SimpleType', nativeType => 'IMPL::DOM::Schema::SimpleType')->appendRange(
IMPL::DOM::Schema::NodeSet->new()->appendRange(
IMPL::DOM::Schema::AnyNode->new(maxOccur => 'unbounded', minOccur => 0)
- )
+ ),
+ new IMPL::DOM::Schema::Property(name => 'type')
),
IMPL::DOM::Schema::ComplexType->new(type => 'SimpleNode', nativeType => 'IMPL::DOM::Schema::SimpleNode')->appendRange(
IMPL::DOM::Schema::NodeSet->new()->appendRange(
IMPL::DOM::Schema::AnyNode->new(maxOccur => 'unbounded', minOccur => 0)
- )
+ ),
+ new IMPL::DOM::Schema::Property(name => 'name')
)
);
diff -r da5bc24b3d3c -r 716b287d4795 Lib/IMPL/DOM/Schema/Property.pm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/DOM/Schema/Property.pm Wed Sep 30 17:43:52 2009 +0400
@@ -0,0 +1,52 @@
+package IMPL::DOM::Schema::Property;
+use strict;
+use warnings;
+
+use base qw(IMPL::DOM::Schema::SimpleNode);
+require IMPL::DOM::Schema;
+require IMPL::DOM::Node;
+use IMPL::Class::Property;
+
+__PACKAGE__->PassThroughArgs;
+
+BEGIN {
+ public property RequiredMessage => prop_all;
+}
+
+our %CTOR = {
+ 'IMPL::DOM::Schema::SimleNode' => sub {
+ my %args = @_;
+
+ $args{maxOccur} = 1;
+ $args{minOccur} = delete $args{optional} ? 0 : 1;
+ $args{nodeName} ||= 'Property';
+
+ return %args;
+ }
+};
+
+sub CTOR {
+ my ($this,%args) = @_;
+
+ $this->RequiredMessage($args{RequiredMessage} || 'A property %Schema.name% is required');
+}
+
+sub Validate {
+ my ($this,$node) = @_;
+
+ if ($this->minOccur) {
+ my $prop = $this->name;
+ my $nodeProp = new IMPL::DOM::Node(nodeName => '::property', nodeValue => $node->$prop() || $node->nodePropety($prop));
+
+ if (! $nodeProp->nodeValue) {
+ return new IMPL::DOM::Schema::VaidationError(
+ Message =>
+ );
+ }
+ return $this->SUPER::Validate($nodeProp);
+ } else {
+ return ();
+ }
+}
+
+1;
diff -r da5bc24b3d3c -r 716b287d4795 Lib/IMPL/ORM/Object.pm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/ORM/Object.pm Wed Sep 30 17:43:52 2009 +0400
@@ -0,0 +1,8 @@
+package IMPL::ORM::Object;
+use strict;
+use warnings;
+
+use base qw(IMPL::Object::Abstract);
+
+
+1;
diff -r da5bc24b3d3c -r 716b287d4795 impl.kpf
--- a/impl.kpf Wed Sep 30 17:41:32 2009 +0400
+++ b/impl.kpf Wed Sep 30 17:43:52 2009 +0400
@@ -222,6 +222,32 @@
default
+
+
+
+
+
+ 9011
+
+
+ Lib/IMPL/DOM/Schema/Property.pm
+
+ Perl
+
+
+
+ application/x-www-form-urlencoded
+ GET
+ 1
+ 0
+ 0
+
+
+ enabled
+
+
+ default
+