view _test/Resources/sample.xml @ 284:f2a6bc5f3184

+IMPL::Object::InlineFactory: implement object factory as subroutine
author sergey
date Thu, 14 Feb 2013 19:14:02 +0400
parents b6cde007a175
children
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns="http://implab.org/schemas/resources"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://implab.org/schemas/resources resources.xsd ">
	<root>
		<get>
			<bind expr="$model" />
		</get>

		<resource>
			<name>projects</name>
			<bind expr="$model" />

			<get>
				<bind expr="$model" />
			</get>

			<post>
				<bind expr="$model->CreateProject($project)">
					<var name="project">
						<transform class="IMPL::Web::Transform::BindModel" />
					</var>
				</bind>
				<response>
					<redirect>
						<location locator="projects-locator" />
					</redirect>
				</response>
			</post>

			<resource>
				<match vars="id">(\w+)</match>
				<bind expr="$model->GetProject($id)" />

				<get>
					<bind expr="$model" />
				</get>

				<put>
					<bind expr="$model->update(data)">
						<var name="data">
							<transform class="IMPL::Web::Transform::BindModel"/>
						</var>
					</bind>
				</put>

				<resource>
					<name>library</name>
					<bind expr="$model" />
					<get>
						<bind expr="$model" />
					</get>
				</resource>
				<resource>
					<name>sources</name>
					<bind expr="$model" />
					<get>
						<bind expr="$model" />
					</get>
				</resource>
			</resource>
		</resource>
	</root>
	<contracts>
		<contract id="project-contract" modelType="IMPL::Web::Model::Project">
			<get>
				<bind expr="$model" />
			</get>
		</contract>
	</contracts>
</resources>