<xs:schema 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:gen="http://xmlns.redhat.com/core/bebop/generator/1.0"
  xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
  xmlns="http://xmlns.redhat.com/core/search/1.0" 
  elementFormDefault="qualified" 
  targetNamespace="http://xmlns.redhat.com/core/search/1.0">

  <xs:element name="query" type="query"/>
  <xs:element name="results" type="results"/>

  <xs:complexType name="results">
    <xs:annotation>
      <xs:appinfo>
        <gen:class>com.arsdigita.search.ui.ResultsPane</gen:class>
      </xs:appinfo>
    </xs:annotation>

    <xs:sequence>
      <xs:element name="paginator">
        <xs:attribute name="param" type="xs:string"/>
        <xs:attribute name="baseURL" type="xs:anyURI"/>
        <xs:attribute name="pageNumber" type="xs:integer"/>
        <xs:attribute name="pageCount" type="xs:integer"/>
        <xs:attribute name="pageSize" type="xs:integer"/>
        <xs:attribute name="objectBegin" type="xs:long"/>
        <xs:attribute name="objectEnd" type="xs:long"/>
        <xs:attribute name="objectCount" type="xs:long"/>
      </xs:element>

      <xs:element name="documents">
        <xs:sequence>
          <xs:element name="object" minOccurs="0" maxOccurs="unbounded">
            <xs:attribute name="oid" type="xs:string"/>
            <xs:attribute name="url" type="xs:string"/>
            <xs:attribute name="score" type="xs:string"/>
            <xs:attribute name="title" type="xs:string"/>
            <xs:attribute name="summary" type="xs:string" use="optional"/>
            <xs:attribute name="locale" type="xs:string"/>
            <xs:attribute name="creationDate" type="xs:string" use="optional"/>
            <xs:attribute name="creationParty" type="xs:string" use="optional"/>
            <xs:attribute name="lastModifiedDate" type="xs:string" use="optional"/>
            <xs:attribute name="lastModifiedParty" type="xs:string" use="optional"/>
          </xs:element>
        </xs:sequence>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="query">
    <xs:annotation>
      <xs:appinfo>
        <gen:class>com.arsdigita.search.ui.BaseQueryComponent</gen:class>
      </xs:appinfo>
    </xs:annotation>

    <xs:sequence>
      <xs:element name="terms">
        <xs:sequence>
          <xs:element name="error" minOccurs="0" maxOccurs="unbounded">
        </xs:sequence>

        <xs:attribute name="param" type="xs:string"/>
        <xs:attribute name="value" type="xs:string"/>
      </xs:element>
      <xs:element name="filter" minOccurs="0" maxOccurs="unbounded">
        <xs:sequence>
          <xs:element name="error" minOccurs="0" maxOccurs="unbounded">

          <xs:choice>
            <xs:element name="category" type="category" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="objectType" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:choice>
        </xs:sequence>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="category">
    <xs:annotation>
      <xs:appinfo>
        <gen:class>com.arsdigita.search.ui.filters.CategoryFilterWidget</gen:class>
      </xs:appinfo>
    </xs:annotation>

    <xs:attribute name="oid" type="xs:string"/>
    <xs:attribute name="title" type="xs:string"/>
    <xs:attribute name="description" type="xs:string"/>
    <xs:attribute name="isSelected" type="xs:string" use="optional"/>
  </xs:complexType>

  <xs:complexType name="objectType">
    <xs:annotation>
      <xs:appinfo>
        <gen:class>com.arsdigita.search.ui.filters.ObjectTypeFilterWidget</gen:class>
      </xs:appinfo>
    </xs:annotation>

    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="isSelected" type="xs:string" use="optional"/>
  </xs:complexType>

</xs:schema>
