diff _test/Resources/sample.xml @ 223:edf011437be8

updated resources schema
author sergey
date Tue, 28 Aug 2012 17:29:42 +0400
parents 84a6382b49c8
children e6c050db7d98
line wrap: on
line diff
--- a/_test/Resources/sample.xml	Mon Aug 27 17:28:32 2012 +0400
+++ b/_test/Resources/sample.xml	Tue Aug 28 17:29:42 2012 +0400
@@ -3,41 +3,56 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://implab.org/schemas/resources resources.xsd ">
 	<root>
-		<get>
-			<bind bind="model" />
-		</get>
+		<get expr="model" />
+
+		<resource>
+			<name>projects</name>
+			<model expr="model"/>
+			<get expr="model.projects" />
+
+			<post expr="model.CreateProject(project)">
+				<var name="project" expr="BindModel()"/>
+				<response xsi:type="RedirectResponse">
+					<locatorRef ref="projects-locator" />
+				</response>
+			</post>
 
-		<resource name="projects">
-		    <contract>
-		      <get>
-		          <bind bind="parent.model.projects" />
-		      </get>
-		      <post>
-		          <bind bind="parent.model.CreateProject($form)">
-		              <var name="form" bind="request"/>
-		          </bind>
-		          <response xsi:type="redirectResponse">
-		              <locatorRef ref="relative-locator"/>
-		          </response>
-		      </post>
-		    </contract>
-		    
-		    <resource match="(\w+)">
-		    
-		    </resource>
+			<resource>
+				<match>(\w+)</match>
+				<model expr="model.GetProject(resourceId)"/>
+				
+				<get expr="model"/>
+				<put expr="model.update(data)">
+				</put>
+				
+				<resource>
+				    <name>library</name>
+				    <model expr="model"/>
+				    <get expr="model"/>
+				</resource>
+				<resource>
+				    <name>sources</name>
+				    <model expr="model"/>
+				    <get expr="model"/>
+				</resource>
+			</resource>
 		</resource>
 	</root>
-	<typeMap>
-	</typeMap>
+	<contracts>
+	   <contract id="project-contract">
+	       <modelType>Benzin::Model::Project</modelType>
+	       <get/>
+	   </contract>
+	</contracts>
 	<locators>
 		<locator name="relative-locator">
-			<var name="id" bind="model.id" />
-			<var name="parent" bind="parent.location" />
+			<var name="id" expr="model.id" />
+			<var name="parent" expr="parent.location" />
 			<template>$parent/$id</template>
 		</locator>
 		<locator name="projects-locator">
-			<var name="id" bind="model.id" />
-			<var name="projects" bind="application.locate('projects')" />
+			<var name="id" expr="model.id" />
+			<var name="projects" expr="application.locate('projects')" />
 			<template>$projects/$id</template>
 		</locator>
 	</locators>