<?xml version="1.0" encoding="UTF-8"?>

<!-- static info abt the application -->   
<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
	targetNamespace="http://www.extreme.indiana.edu/AppFactoryWebService/"
	xmlns:app="http://www.extreme.indiana.edu/AppFactoryWebService/" 
    version="0.9">

<include schemaLocation="executionEnv.xsd"/>
<element name="application"> 
 <complexType>
  <all>
   <!-- Application Coordinator -->
   <element ref="appCoordinator"  minOccurs="1" maxOccurs="1"/>
   <!-- List of components -->
   <element ref="applicationComponents"  minOccurs="0" maxOccurs="1"/>
   <!-- List of connections -->
   <element ref="applicationConnections" minOccurs="0" maxOccurs="1"/>
   <!-- List of ports to export -->
   <element ref="exportPorts" minOccurs="0" maxOccurs="1"/>
  </all>
   <attribute name="appName" type=" string" use="required"/>
 </complexType> 
</element>

<!-- Info about the application cordinator component -->
<element name="appCoordinator">
 <complexType>
   <all>
  <element ref="component"  minOccurs="1" maxOccurs="1"/>
</all>
 </complexType>
</element>

<!-- Info about the components that make up the application  -->
<element name="applicationComponents">
 <complexType>
<all>
  <element ref="component"  minOccurs="1" maxOccurs="unbounded"/>
</all>
 </complexType>
</element>

<!-- Info about individual component -->
<element name="component">
 <complexType>
<all>
  <!-- Id used to reference information from the directory service -->
  <element name="compId" type="string" minOccurs="1" maxOccurs="1"/>
  <!-- Either directory service information or execution environment -->
  <element ref="creationInfo"  minOccurs="1" maxOccurs="1"/>
</all>
  <attribute name="compName" type=" string" use="required"/>
 </complexType>
</element>

<!-- For each comp,either directory service information or execution environment -->
<element name="creationInfo">
 <complexType>
<all>
  <!-- URL to access directory service example  -->
  <!-- http://linbox3.extreme.indiana.edu:8080/compBrowser/servlet/FileDisplay -->
  <element name="directoryService" type="string" minOccurs="0"  maxOccurs="1"/>
  <!-- Execution environment for this component  -->
  <element ref="app:executionEnv"  minOccurs="0" maxOccurs="unbounded"/>
</all>
 </complexType>
</element>

<!-- Info about the connections that make up the application  -->
<element name="applicationConnections">
 <complexType>
<all>
  <element ref="connection"  minOccurs="0" maxOccurs="unbounded"/>
</all>
 </complexType>
</element>

<!-- Info about individual connection. Uses Port,Provides port in that order-->
<element name="connection">
 <complexType>
<all>
  <element ref="portDescription" minOccurs="2" maxOccurs="2"/>
  <element name="timeout" type="string" minOcuurs="0" maxOccurs="1"/>
</all>
 </complexType>
</element> 


<!-- Info about port CompId and PortName uniquely identifies a port -->
<element name="portDescription">
 <complexType>
<all>
  <element name="portName" type="string" minOccurs="1" maxOccurs="1"/>


  <element name="compName" type="string" minOccurs="1" maxOccurs="1" />
</all>
 </complexType>
</element>

<!-- Info about set of ports (across the various components) that need to -->
<!-- be exported as ports of the application as a whole -->
<element name="exportPorts">
 <complexType>
<all>
  <element ref="portDetail"  minOccurs="0" maxOccurs="unbounded"/>
</all>
 </complexType>
</element>
<element name="portDetail">
 <complexType>
<all>
  <element name="newPortName" type="string" minOccurs="0" maxOccurs="1"/>
  <element ref="portDescription"  minOccurs="1" maxOccurs="1"/>
</all>
 </complexType>
</element> 
</schema>






