<?xml version="1.0" encoding="UTF-8"?><!--  <?xml-stylesheet type="text/xsl" href="../../XMLPretty.xsl" ?>--><!-- $Id: VOCEA.xsd,v 1.4 2009/05/19 14:23:41 pah Exp $
Definition of CEA registry entries - inherits types from the CEABase.xsd schema.
 --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vs="http://www.ivoa.net/xml/VODataService/v1.1" xmlns:vm="http://www.ivoa.net/xml/VOMetadata/v0.1" xmlns:cea="http://www.ivoa.net/xml/CEA/v1.0" xmlns:ceab="http://www.ivoa.net/xml/CEA/base/v1.1" xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0" xmlns:va="http://www.ivoa.net/xml/VOApplication/v1.0rc1" targetNamespace="http://www.ivoa.net/xml/CEA/v1.0" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.0 RC$Revision: 1.4 $">
	<xs:annotation>
		<xs:documentation>this has been revised to be more v1.0 like - i.e. element definitions have been taken away and the types have the "type" suffix removed</xs:documentation>
	</xs:annotation>
	<xs:annotation>
		<xs:appinfo>
			<vm:SchemaName>VOCEA</vm:SchemaName>
			<vm:schemaPrefix>xs</vm:schemaPrefix>
			<vm:targetPrefix>cea</vm:targetPrefix>
		</xs:appinfo>
		<xs:documentation>
        An extension to the core resource metadata (VOResource) for 
      	describing applications and server within the Common Execution Architecture
      </xs:documentation>
	</xs:annotation>
<!-- 	
	<xs:import namespace="http://www.ivoa.net/xml/VODataService/v1.0" schemaLocation="./VODataService-v1.0.xsd"/>
    -->
   <xs:import namespace="http://www.ivoa.net/xml/VOResource/v1.0" schemaLocation="http://software.astrogrid.org/schema/vo-resource-types/VOResource/v1.0/VOResource.xsd"/> 
   <xs:import namespace="http://www.ivoa.net/xml/VOApplication/v1.0rc1" schemaLocation="http://software.astrogrid.org/schema/vo-resource-types/VOApplication/v1.0rc1/VOApplication.xsd"/>
   <xs:import namespace="http://www.ivoa.net/xml/CEA/base/v1.1" schemaLocation="http://software.astrogrid.org/schema/cea/CEABase/v1.1/CEABase.xsd"/>

	<xs:complexType name="CeaApplication">
	   <xs:annotation>
	      <xs:documentation>
	         The definition of a CEA compliant application
	      </xs:documentation>
	   </xs:annotation>
	   <xs:complexContent>
	      <xs:extension base="va:Application">
	         <xs:sequence>
	            <xs:element name="applicationDefinition" type="ceab:ApplicationBase">
	               <!-- constraints on parameter references to ensure that there are no trivial mistakes in the interface definitions -->
	              <xs:unique name="parameternameunique">
                  <xs:annotation><xs:documentation> ensures that the parameter identifiers are not duplicated for a particular application</xs:documentation></xs:annotation>
	                  <xs:selector xpath="./parameters/parameterDefinition"/>
	                  <xs:field xpath="@id"/>
	               </xs:unique>
	               <xs:unique name="interfacenameunique">
                   <xs:annotation><xs:documentation> ensures that the interface identifiers are not duplicated for a particular application</xs:documentation></xs:annotation>
 	                  <xs:selector xpath="./interfaces/interfaceDefinition"/>
	                  <xs:field xpath="@id"/>
	               </xs:unique>
	               <xs:keyref name="interfaceParameterReference" refer="cea:parameternameunique">
	                  <xs:annotation>
	                     <xs:documentation>
	                        ensures that the parameter references do point to a parameter id
	                     </xs:documentation>
	                  </xs:annotation>
	                  <xs:selector xpath=".//pref|.//cgroupHead"/>
	                  <xs:field xpath="@ref"/>
	               </xs:keyref>
	               <xs:keyref name="constantReference" refer="cea:parameternameunique">
	                  <xs:annotation>
	                     <xs:documentation>
	                        ensures that the constants also point to valid parameter ids
	                     </xs:documentation>
	                  </xs:annotation>
	                  <xs:selector xpath=".//pval"/>
	                  <xs:field xpath="@id"/>
	               </xs:keyref>
	            </xs:element>
	         </xs:sequence>
	      </xs:extension>
	   </xs:complexContent>
	   <!-- This would benefit from some sort of indication as to what type of application - datacentre/cmdline/webapp etc.... -->
	</xs:complexType>
	<xs:complexType name="CeaCapability">
   <!-- editor's note - CEA is really only an interface definition in itself, so it is slightly unfortunate to have the 'CEAness' indicated by a capability, as this precludes doing something like directly declaring that a SIA server has a CEA interface for instance -
        however the it seems that there is no desire to allow CEA to be a service description metalanguage (parameters, calling interface pattern etc), so it probably does not matter - schade! -->
	   <xs:annotation>
	      <xs:documentation>
	         The definition of a capability conforming to the CEA
	         specification, capable of running one or more
	         CeaApplications
	      </xs:documentation>
	   </xs:annotation>
	   <xs:complexContent>
	      <xs:extension base="vr:Capability">
	         <xs:choice>
	            <xs:element name="managedApplications" type="cea:ManagedApplications" maxOccurs="1" minOccurs="1">
	            </xs:element>
	            <xs:element name="applicationDefinition" type="ceab:ApplicationBase" maxOccurs="1" minOccurs="1"/>
	         </xs:choice>
	      </xs:extension>
	   </xs:complexContent>
	</xs:complexType>
	<xs:complexType name="ManagedApplications">
        <xs:annotation>
           <xs:documentation>A reference to an application description of type CeaApplication that can be invoked via this interface.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
	      <xs:element maxOccurs="unbounded" name="applicationReference" type="vr:IdentifierURI">
	         <xs:annotation><xs:documentation>Reference to a CeaApplication resource entry
            </xs:documentation></xs:annotation>
	      </xs:element>
	   </xs:sequence>
	</xs:complexType>

	<xs:complexType name="DerivedApplicationDefinition">
        <xs:annotation>
           <xs:documentation>
              A derived application definition that has the following
              semantics; the parameter and interface definition lists
              are assumed extend the existing lists that are defined in
              the CeaApplication that is pointed to by the extends
              attribute. Redefinition or deletion of existing parameter
              and interface definions is not allowed.
              
              
           </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
	      <xs:extension base="ceab:ApplicationBase">
	         <xs:attribute name="extends" type="vr:IdentifierURI">
	            <xs:annotation>
	               <xs:documentation>
	                  point to the ApplicationDefinition to extend
	               </xs:documentation>
	            </xs:annotation></xs:attribute>
	      </xs:extension>
	   </xs:complexContent>
	</xs:complexType>
	<xs:complexType name="CeaApplicationExtension">
	   <xs:annotation>
	      <xs:documentation>
	         The definition of a CEA compliant application that is made
	         by extending an existing CeaApplication.
            
            Note that the more strict parameter name checking that is done for the CeaApplication is not done for this type as it would be beyound the scope of the xmlparser to be able to check the extra semantics inherent in the Derived application definition.
	      </xs:documentation>
	   </xs:annotation>
	   <xs:complexContent>
	      <xs:extension base="va:Application">
	         <xs:sequence>
	            <xs:element name="applicationDefinitionExtension" type="cea:DerivedApplicationDefinition"/>
	         </xs:sequence>
	      </xs:extension>
	   </xs:complexContent>
	</xs:complexType>

    <xs:complexType name="CECInterface">
       <xs:annotation>
          <xs:documentation>
             this is an interface that implements the
             CommonExecutionConnector SOAP web service It has no special
             elements of its own
          </xs:documentation>
       </xs:annotation>
       <xs:complexContent><xs:extension base="vr:Interface"/></xs:complexContent></xs:complexType>
    <xs:complexType name="UWS-PA">
       <xs:annotation>
          <xs:documentation>
             an interface that implements the
             UWS-PA pattern. It has no special
             elements of its own
          </xs:documentation>
       </xs:annotation>
       <xs:complexContent><xs:extension base="vr:Interface"/></xs:complexContent></xs:complexType>
</xs:schema>