<?xml version="1.0" ?>
<xs:schema id="PublishingTasksSchema" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" 
>
<!--
    elementFormDefault="qualified" attributeFormDefault="unqualified"
    xmlns="http://www.microsoft.com/cmserver/ACSchema"
    targetNamespace="http://www.microsoft.com/cmserver/ACSchema"
-->
    <xs:annotation>
        <xs:documentation>
        schema for MCMS publishing task

        A publishing task contains name, description, channel and template. 
        Channel and template can be specified by path or guid.

        id: automatically generated, should not be specified in the publishing task xml file.
        name: display name of publishing task, should be unique.
        description: description of the publishing task.
        template: path of the template to use for this publishing task.
        templateGuid: guid of the template to use for this publishing task
        channel: path of the channel to use for this publishing task
        channelGuid: guid of the channel to use for this publishing task
       </xs:documentation>
    </xs:annotation>
    
    <xs:simpleType name="nameType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="132" />
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="descriptionType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="1024" />
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="pathType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="1024" />
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="guidType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="64" />
        </xs:restriction>
    </xs:simpleType>
    
    <xs:group name="templateGroup">
        <xs:choice>
            <xs:element name="template" type="pathType" />
            <xs:element name="templateGuid" type="guidType" />
        </xs:choice>
    </xs:group>
    
    <xs:group name="channelGroup">
        <xs:choice>
            <xs:element name="channel" type="pathType" />
            <xs:element name="channelGuid" type="guidType" />
        </xs:choice>
    </xs:group>
    
    <xs:complexType name="taskType">
        <xs:sequence>
            <xs:element name="id" type="xs:integer" maxOccurs="0" 
                msdata:AutoIncrement="true" msdata:AutoIncrementSeed="1" msdata:AutoIncrementStep="1" />
            <xs:element name="name" type="nameType" />
            <xs:element name="description" type="descriptionType" minOccurs="0" />
            <xs:group ref="templateGroup" />
            <xs:group ref="channelGroup" />
        </xs:sequence>
    </xs:complexType>
                    
   <xs:element name="tasks" msdata:IsDataSet="true">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="task" type="taskType" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
        <xs:key name="primaryKey" msdata:PrimaryKey="true">
            <xs:selector xpath="./task" />
            <xs:field xpath="name" />
        </xs:key>
    </xs:element>
</xs:schema>