<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.deegree.org/datasource/tile/remotewms" elementFormDefault="qualified"
  xmlns:r="http://www.deegree.org/datasource/tile/remotewms" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">

  <annotation>
    <appinfo>
      <jaxb:schemaBindings>
        <jaxb:package name="org.deegree.tile.persistence.remotewms.jaxb" />
      </jaxb:schemaBindings>
    </appinfo>
  </annotation>

  <element name="RemoteWMSTileStore">
    <annotation>
      <documentation>TileStore that is backed by a remote WMS instance.</documentation>
      <appinfo>
        <jaxb:class name="RemoteWMSTileStoreJAXB" />
      </appinfo>
    </annotation>
    <complexType>
      <sequence>
        <element name="RemoteWMSId" type="string">
          <annotation>
            <documentation>Id of the remote OWS to connect to (must be a WMS instance)</documentation>
          </annotation>
        </element>
        <element name="TileDataSet" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="Identifier" type="string">
                <annotation>
                  <documentation>Identifier for the tile data set</documentation>
                </annotation>
              </element>
              <element name="TileMatrixSetId" type="string">
                <annotation>
                  <documentation>Identifier of the tile matrix set id to use</documentation>
                </annotation>
              </element>
              <element name="OutputFormat" type="string">
                <annotation>
                  <documentation>Mime type of the desired output format</documentation>
                </annotation>
              </element>
              <element name="RequestParams">
                <annotation>
                  <documentation>WMS request parameters</documentation>
                </annotation>
                <complexType>
                  <sequence>
                    <element name="Layers" type="string">
                      <annotation>
                        <documentation>Comma-separated list of layer names</documentation>
                      </annotation>
                    </element>
                    <element name="Styles" type="string" minOccurs="0">
                      <annotation>
                        <documentation>Comma-separated list of styles</documentation>
                      </annotation>
                    </element>
                    <element name="Format" type="string">
                      <annotation>
                        <documentation>Image format</documentation>
                      </annotation>
                    </element>
                    <element name="CRS" type="string">
                      <annotation>
                        <documentation>CRS to use for remote requests</documentation>
                      </annotation>
                    </element>
                    <element name="Parameter" minOccurs="0" maxOccurs="unbounded">
                      <complexType>
                        <simpleContent>
                          <extension base="string">
                            <attribute name="name" type="string" use="required" />
                            <attribute name="use" type="r:ParameterUseType" use="optional" default="allowOverride" />
                            <attribute name="scope" type="r:ParameterScopeType" use="optional" default="All" />
                          </extension>
                        </simpleContent>
                      </complexType>
                    </element>
                  </sequence>
                </complexType>
              </element>
            </sequence>
          </complexType>
        </element>
      </sequence>
      <attribute name="configVersion" type="string" use="optional"/>
    </complexType>
  </element>

  <simpleType name="ParameterUseType">
    <restriction base="string">
      <enumeration value="allowOverride" />
      <enumeration value="fixed" />
    </restriction>
  </simpleType>

  <simpleType name="ParameterScopeType">
    <restriction base="string">
      <enumeration value="GetMap" />
      <enumeration value="GetFeatureInfo" />
      <enumeration value="All" />
    </restriction>
  </simpleType>

</schema>