<?xml version="1.0" encoding="UTF-8"?>
<appendix id="schemas">
  <title>Schemas</title>

  <section id="bootstrap_xsd">
    <title>Bootstrap</title>

    <programlisting>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Bootstrap XML Schema
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="qualified"
            targetNamespace="http://jesperpedersen.github.com/fungal/schema"
            xmlns="http://jesperpedersen.github.com/fungal/schema">

   <xsd:complexType name="protocolsType">
     <xsd:sequence>
       <xsd:element name="protocol" type="protocolType" maxOccurs="unbounded" minOccurs="1"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="protocolType">
     <xsd:sequence>
       <xsd:element name="property" type="propertyType" maxOccurs="unbounded" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="id" type="xsd:token"/>
     <xsd:attribute name="class-name" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="propertyType" mixed="true">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
         <xsd:attribute name="name" type="xsd:token"/>
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="serversType">
     <xsd:sequence>
       <xsd:element name="server" type="serverType" maxOccurs="unbounded" minOccurs="1"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="serverType" mixed="true">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
         <xsd:attribute name="protocol" type="xsd:token"/>
         <xsd:attribute name="pattern" type="xsd:token"/>
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="dependenciesType">
     <xsd:sequence>
       <xsd:element name="dependency" type="dependencyType" maxOccurs="unbounded" minOccurs="1"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="dependencyType">
     <xsd:sequence>
       <xsd:element name="organisation" type="xsd:token"/>
       <xsd:element name="module" type="xsd:token" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="artifact" type="xsd:token"/>
       <xsd:element name="revision" type="xsd:token"/>
       <xsd:element name="classifier" type="xsd:token" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="ext" type="xsd:token" default="jar" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="target" type="xsd:token" default="lib"/>
   </xsd:complexType>

   <xsd:element name="bootstrap">
     <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="url" type="xsd:token" maxOccurs="unbounded" minOccurs="0"/>
         <xsd:element name="protocols" type="protocolsType" maxOccurs="1" minOccurs="0"/>
         <xsd:element name="servers" type="serversType" maxOccurs="1" minOccurs="0"/>
         <xsd:element name="dependencies" type="dependenciesType" maxOccurs="1" minOccurs="0"/>
       </xsd:sequence>
     </xsd:complexType>
   </xsd:element>

</xsd:schema>
 ]]>
    </programlisting>

  </section>

  <section id="deployment_xsd">
    <title>Deployment</title>

    <programlisting>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Deployment XML Schema
-->
<xsd:schema xmlns:deployment="http://jesperpedersen.github.com/fungal/schema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <xsd:complexType name="beanType">
     <xsd:sequence>
       <xsd:element name="constructor" type="constructorType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="property" type="propertyType" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="depends" type="dependsType" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="install" type="installType" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="uninstall" type="uninstallType" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="create" type="createType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="start" type="startType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="stop" type="stopType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="destroy" type="destroyType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="ignoreCreate" type="ignoreCreateType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="ignoreStart" type="ignoreStartType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="ignoreStop" type="ignoreStopType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="ignoreDestroy" type="ignoreDestroyType" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="name" type="xsd:token" use="required"/>
     <xsd:attribute name="interface" type="xsd:token"/>
     <xsd:attribute name="class" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="propertyType" mixed="true">
     <xsd:sequence>
       <xsd:element name="inject" type="injectType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="list" type="listType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="set" type="setType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="map" type="mapType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="value" type="valueType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="null" type="nullType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="this" type="thisType" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="name" type="xsd:token" use="required"/>
     <xsd:attribute name="class" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="injectType">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
         <xsd:attribute name="bean" type="xsd:token" use="required"/>
         <xsd:attribute name="property" type="xsd:token"/>
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="constructorType">
     <xsd:sequence>
       <xsd:element name="parameter" type="parameterType" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="factory" type="factoryType" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="factoryMethod" type="xsd:token"/>
     <xsd:attribute name="factoryClass" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="factoryType">
     <xsd:attribute name="bean" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="mapType">
     <xsd:sequence>
       <xsd:element name="entry" type="entryType" maxOccurs="unbounded" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="class" type="xsd:token"/>
     <xsd:attribute name="keyClass" type="xsd:token" use="required"/>
     <xsd:attribute name="valueClass" type="xsd:token" use="required"/>
   </xsd:complexType>

   <xsd:complexType name="entryType">
     <xsd:sequence>
       <xsd:element name="key" type="keyType"/>
       <xsd:element name="value" type="valueType"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="setType">
     <xsd:sequence>
       <xsd:element name="value" type="valueType" maxOccurs="unbounded" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="class" type="xsd:token"/>
     <xsd:attribute name="elementClass" type="xsd:token" use="required"/>
   </xsd:complexType>

   <xsd:complexType name="listType">
     <xsd:sequence>
       <xsd:element name="value" type="valueType" maxOccurs="unbounded" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="class" type="xsd:token"/>
     <xsd:attribute name="elementClass" type="xsd:token" use="required"/>
   </xsd:complexType>

   <xsd:complexType name="parameterType" mixed="true">
     <xsd:sequence>
       <xsd:element name="inject" type="injectType" maxOccurs="1" minOccurs="0"/>
       <xsd:element name="null" type="nullType" maxOccurs="1" minOccurs="0"/>
     </xsd:sequence>
     <xsd:attribute name="class" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="dependsType">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="keyType">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="valueType">
     <xsd:simpleContent>
       <xsd:extension base="xsd:token">
       </xsd:extension>
     </xsd:simpleContent>
   </xsd:complexType>

   <xsd:complexType name="thisType"/>

   <xsd:complexType name="nullType"/>

   <xsd:complexType name="installType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="uninstallType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="incallbackType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="uncallbackType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="createType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="startType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="stopType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="destroyType">
     <xsd:attribute name="method" type="xsd:token"/>
   </xsd:complexType>

   <xsd:complexType name="ignoreCreateType"/>

   <xsd:complexType name="ignoreStartType"/>

   <xsd:complexType name="ignoreStopType"/>

   <xsd:complexType name="ignoreDestroyType"/>

   <xsd:element name="deployment">
     <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="bean" type="beanType" maxOccurs="unbounded" minOccurs="0"/>
       </xsd:sequence>
     </xsd:complexType>
   </xsd:element>

</xsd:schema>

 ]]>
    </programlisting>

  </section>
</appendix>
