changeset 99:6dd659f6f66c

Minor changes, DOM schema is in development (in the aspect of a forms)
author wizard
date Wed, 05 May 2010 17:33:55 +0400
parents 00d88c5e8203
children df6b4f054957
files Lib/IMPL/Web/Application.pm _test/Resources/form.schema _test/Resources/form.xml _test/Resources/types.xml
diffstat 4 files changed, 23 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application.pm	Wed May 05 01:07:31 2010 +0400
+++ b/Lib/IMPL/Web/Application.pm	Wed May 05 17:33:55 2010 +0400
@@ -51,8 +51,9 @@
 	        $action->response->Complete;
         };
         if ($@) {
-        	my $e = $@; 
-        	eval { $this->handlerError()->($this,$action,$e); 1;} or warn "Error in handlerError: ",$@;
+        	my $e = $@;
+        	# we are expect that this method is safe otherwise we can trust nothing in this wolrd 
+        	$this->handlerError()->($this,$action,$e);
         }
     }
 }
--- a/_test/Resources/form.schema	Wed May 05 01:07:31 2010 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema>
-    <Include src="forms.schema"/>
-    <Form
-        type="Form"
-        dataPolicy="AddOrUpdate"
-        dataType="App::Data::User"
-        messageMin="Вы не заполнили %Node.formLabel_blame%"
-    >
-        <Name
-            formLabel="Имя"
-            formLabel_blame="имя"
-            formLabel_no="имени"
-            type="EditBox"
-        />
-        <!-- Опциональный элемент -->
-        <Nick
-            formLabel="Прозвище"
-            formLabel_no="прозвища"
-            minOccur="0"
-            type="EditBox"
-        >
-            <RegExp>\w{4,10}</RegExp>
-        </Nick>
-        <Role
-            dataType="App::Data::Role"
-            dataSource="roles"
-            formLabel="Роль"
-            formLabel_blame="роль"
-            type="MultiSelect"
-            maxOccur="unbounded"
-        />
-        <Contacts
-            minOccur="0"
-            maxOccur="unbounded"
-            formLabel="Контакты"
-            dataType="App::Data::Contacts"
-            type="Container"
-        >
-            <NodeSet>
-                <EMail
-                    type="EditBox"
-                    minOccur="0"
-                    formLabel="Эл. почта"
-                    formLabel_no="эл. почты"
-                />
-                <Phone
-                    type="EditBox"
-                    minOccur="0"
-                    formLabel="Телефон"
-                    formLabel_no="телефона"
-                />
-            </NodeSet>
-        </Contacts>
-    </Form>
-    
-</schema>
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_test/Resources/form.xml	Wed May 05 17:33:55 2010 +0400
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema>
+	<Include source="types.xml"/>
+    <ComplexNode name="user">
+    	<NodeSet>
+    		<Node name="name" type="scalar"/>
+    		<Node name="email" type="email"/>
+    		<Node name="fullName" type="scalar"/>
+    		<Node name="birthDate" type="date"/>
+    		<Node name="gender" type="scalar"/>
+    		<Node name="region" type="region"/>
+    	</NodeSet>
+    </ComplexNode>
+</schema>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_test/Resources/types.xml	Wed May 05 17:33:55 2010 +0400
@@ -0,0 +1,5 @@
+<schema>
+	<SimpleType name="email" nativeType="SCALAR"/>
+	<SimpleType name="scalar" nativeType="SCALAR"/>
+	<SimpleType name="date" nativeType="DateTime"/>
+</schema>
\ No newline at end of file