view _test/Resources/resources.xsd @ 219:c477f24f1980

sync
author sergey
date Tue, 21 Aug 2012 17:13:47 +0400
parents 358f867712b4
children 5c82c15b25b1
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://implab.org/schemas/resources" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://implab.org/schemas/resources">
    <element name="resources">
    	<complexType>
    		<sequence>
    			<element name="root" type="tns:restResource"></element>
    			<element name="typeMap" minOccurs="0">
    				<complexType>
    					<sequence>
    						<element name="item" maxOccurs="unbounded">
    							<complexType>
    								<complexContent>
    									<extension
    										base="tns:restResource">
    										<sequence></sequence>
    										<attribute
    											name="type" type="string">
    										</attribute>
    									</extension>
    								</complexContent>
    							</complexType></element>
    					</sequence>
    				</complexType></element>
    		</sequence>
    	</complexType>
    </element>
    
    <!-- abstract types  -->
    <complexType name="abstractBinding" abstract="true"/>
    <complexType name="abstractTransformation" abstract="true" />
    <complexType name="abstractResult" abstract="true" />
    
    <complexType name="restResource">
        <sequence>
    		<element name="get" type="tns:restOperation" minOccurs="0">
    		</element>
    		<element name="post" type="tns:restOperation" minOccurs="0">
    		</element>
    		<element name="put" type="tns:restOperation" minOccurs="0">
    		</element>
    		<element name="delete" type="tns:restOperation" minOccurs="0">
    		</element>
    		<element name="resource" type="string" maxOccurs="unbounded" minOccurs="0"></element>
    	</sequence>
    </complexType>
    
    <complexType name="restOperation">
    	<sequence>
    		<element ref="tns:abstractBinding"/>
    		<element name="parameters" type="string"></element>
    		<element ref="tns:abstractResult"/>
    	</sequence>
    </complexType>
    
    <complexType name="methodBinding" >
        <complexContent>
            <extension base="tns:abstractBinding">
                <attribute name="target" type="string" />
                <attribute name="invoke" type="string" use="required" />
            </extension>
        </complexContent>
    </complexType>
    
    <complexType name="transformation">
        <attribute name="class" type="string" />
    </complexType>
    
    <complexType name="resourceLocator">
        <sequence>
            <element ref="tns:abstractBinding" />
            <element name="template" type="string" />
        </sequence>
    </complexType>
    
    
    
    
    <!-- substitutions  -->
    
    <!-- abstract -->
    <element name="abstractBinding" type="tns:abstractBinding" abstract="true"/>
    <element name="abstractTransfomation" type="tns:abstractTransformation" />
    <element name="abstractResult" type="tns:abstractResult" abstract="true" />
    
    <!-- specific -->
    
    <!-- bindings -->
    <element name="bind" type="tns:methodBinding" substitutionGroup="tns:abstractBinding"/>
    
    <!-- transformation -->
    
    <!-- result handlers  -->
    <simpleType name="redirectCodes">
        <restriction base="string">
            <enumeration value="moved-permanently"/>
            <enumeration value="temporary-redirect"/>
            <enumeration value="see-other"/>
        </restriction>
    </simpleType>
    
    <complexType name="redirectResult">
        <complexContent>
            <extension base="tns:abstractResult">
                <sequence>
                    <element name="locator" type="tns:resourceLocator" />
                    <element name="status" type="tns:redirectCodes" minOccurs="0"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
    <element name="redirect" type="tns:redirectResult" substitutionGroup="tns:abstractResult" />    

</schema>