<?xml version="1.0" encoding="UTF-8"?>
<!--
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - OW2 Util
   - Copyright (C) 2008 SERLI
   - Contact: easybeans@objectweb.org
   -
   - This library is free software; you can redistribute it and/or
   - modify it under the terms of the GNU Lesser General Public
   - License as published by the Free Software Foundation; either
   - version 2.1 of the License, or (at your option) any later version.
   -
   - This library is distributed in the hope that it will be useful,
   - but WITHOUT ANY WARRANTY; without even the implied warranty of
   - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   - Lesser General Public License for more details.
   -
   - You should have received a copy of the GNU Lesser General Public
   - License along with this library; if not, write to the Free Software
   - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
   -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - $Id: deployment-plan-1.0.xsd $
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->

<xsd:schema
    targetNamespace="http://jonas.ow2.org/ns/deployment-plan/1.0"
    xmlns="http://jonas.ow2.org/ns/deployment-plan/1.0"
    xmlns:plan="http://jonas.ow2.org/ns/deployment-plan/1.0"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"


    elementFormDefault="qualified">


    <xsd:element name="deployment-plan" type="deployment-planType" />

    <xsd:complexType name="deployment-planType">
        <xsd:sequence>
            <xsd:element name="deployment-plan" type="deployment-planType"
                minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="deployment" type="deploymentType"
                maxOccurs="unbounded" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" />
        <xsd:attribute name="atomic" type="xsd:boolean" use="optional"
            default="false" />
    </xsd:complexType>

    <xsd:complexType name="deploymentType" abstract="true">
        <xsd:sequence>
            <xsd:element name="id" type="xsd:string" minOccurs="0" />
            <xsd:element name="reloadable" type="xsd:boolean" minOccurs="0"
                default="false" />
            <xsd:element name="repository-ref" type="xsd:string"
                maxOccurs="1" minOccurs="0">
            </xsd:element>
            <xsd:element name="start" type="xsd:boolean" minOccurs="0"
                default="false" />
            <!-- default value will not be used by jaxb -->
            <xsd:element name="targets" type="plan:targetsType"
                maxOccurs="1" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="optional" />
        <xsd:attribute name="reloadable" type="xsd:boolean" use="optional"
            default="false" />
        <xsd:attribute name="repository-ref" type="xsd:string"
            use="optional" />
        <xsd:attribute name="start" type="xsd:boolean" use="optional"
            default="true" />    
    </xsd:complexType>

    <xsd:complexType name="targetsType">
        <xsd:sequence>
            <xsd:element name="target" maxOccurs="unbounded">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:whiteSpace value="collapse" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>
