<?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/remotewmts" elementFormDefault="qualified"
  xmlns:r="http://www.deegree.org/datasource/tile/remotewmts" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">

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

  <element name="RemoteWMTSTileStore">
    <annotation>
      <documentation>TileStore that is backed by a remote WMTS instance.
      </documentation>
      <appinfo>
        <jaxb:class name="RemoteWMTSTileStoreJAXB" />
      </appinfo>
    </annotation>
    <complexType>
      <sequence>
        <element name="RemoteWMTSId" type="string">
          <annotation>
            <documentation>Id of the remote WMTS to connect to</documentation>
          </annotation>
        </element>
        <element name="TileDataSet" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="Identifier" type="string" minOccurs="0">
                <annotation>
                  <documentation>Identifier for the tile data set, defaults to
                    the value of the Layer request parameter
                    below
                  </documentation>
                </annotation>
              </element>
              <element name="OutputFormat" type="string" minOccurs="0">
                <annotation>
                  <documentation>Mime type of the desired output format, defaults
                    to the value of the Format request
                    parameter below
                  </documentation>
                </annotation>
              </element>
              <element name="TileMatrixSetId" type="string" minOccurs="0">
                <annotation>
                  <documentation>Identifier of the local tile matrix set,
                    defaults to the value of the TileMatrixSet
                    request parameter below
                  </documentation>
                </annotation>
              </element>
              <element name="RequestParams">
                <annotation>
                  <documentation>WMTS request parameters</documentation>
                </annotation>
                <complexType>
                  <sequence>
                    <element name="Layer" type="string">
                      <annotation>
                        <documentation>Layer name</documentation>
                      </annotation>
                    </element>
                    <element name="Style" type="string">
                      <annotation>
                        <documentation>Style identifier</documentation>
                      </annotation>
                    </element>
                    <element name="Format" type="string">
                      <annotation>
                        <documentation>Image format</documentation>
                      </annotation>
                    </element>
                    <element name="TileMatrixSet" type="string">
                      <annotation>
                        <documentation>Identifier of the remote tile matrix set
                        </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="GetTile" />
      <enumeration value="GetFeatureInfo" />
      <enumeration value="All" />
    </restriction>
  </simpleType>

</schema>
