<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:envelope_1_0="http://agavi.org/agavi/config/global/envelope/1.0"
	xmlns:types_1_0="http://agavi.org/agavi/config/global/types/1.0"
	xmlns="http://agavi.org/agavi/config/parts/factories/1.0"
	targetNamespace="http://agavi.org/agavi/config/parts/factories/1.0"
	elementFormDefault="qualified"
	version="$Id: factories.xsd 4502 2010-04-23 13:39:31Z david $">

	<xs:import namespace="http://agavi.org/agavi/config/global/types/1.0"
	           schemaLocation="../_types.xsd" />
	<xs:import namespace="http://agavi.org/agavi/config/global/envelope/1.0"
	           schemaLocation="../_envelope.xsd" />

	<xs:complexType name="factory">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="envelope_1_0:parameters" />
		</xs:sequence>
		<xs:attribute name="class" type="types_1_0:php_class" use="required" />
	</xs:complexType>

	<xs:group name="configuration">
		<xs:all>
			<!-- These factories are required, but they may be defined in another
			     environment/context so we're quite lax about validating them. A
			     Schematron document could potentially test absolute validity of
			     these factories once contexts have been matched by the parser. -->
			<xs:element type="factory" minOccurs="0" name="controller" />
			<xs:element type="factory" minOccurs="0" name="dispatch_filter" />
			<xs:element type="factory" minOccurs="0" name="execution_container" />
			<xs:element type="factory" minOccurs="0" name="execution_filter" />
			<xs:element type="factory" minOccurs="0" name="filter_chain" />
			<xs:element type="factory" minOccurs="0" name="request" />
			<xs:element type="factory" minOccurs="0" name="response" />
			<xs:element type="factory" minOccurs="0" name="routing" />
			<xs:element type="factory" minOccurs="0" name="storage" />
			<xs:element type="factory" minOccurs="0" name="user" />
			<xs:element type="factory" minOccurs="0" name="validation_manager" />

			<!-- Optional factories -->
			<xs:element type="factory" minOccurs="0" name="database_manager" />
			<xs:element type="factory" minOccurs="0" name="logger_manager" />
			<xs:element type="factory" minOccurs="0" name="security_filter" />
			<xs:element type="factory" minOccurs="0" name="translation_manager" />
		</xs:all>
	</xs:group>

</xs:schema>
