<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.bea.com/2003/03/controls/" xmlns="http://www.bea.com/2003/03/controls/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="jc-jar">
    <xs:annotation>
      <xs:documentation>Describes the contents of a control jar file.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="control" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>The configuration of a specific control</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence minOccurs="0">
              <xs:element name="description" type="xs:string">
                <xs:annotation>
                  <xs:documentation>Description of the control.  Will have version attribute concatenated if present.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="label" type="xs:string" use="required">
              <xs:annotation>
                <xs:documentation>The text displayed for this control in the palette (formerly "name").</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="interface-class" type="xs:string" use="required">
              <xs:annotation>
                <xs:documentation>The fully qualified class name of the control interface.
</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="implementation-class" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation>Fully qualified name of the control implementation class.  Only needed if the control implementation does not follow the convention of InterfaceImpl in the same package as the control interface.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="insert-wizard-class" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation>Fully qualified classname for a user provided insert wizard.  If no class is provided, the default insert wizard will be used.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="version" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation>A string representation of the control version.  The format and meaning of the version is implementation specific.  Will be appended to description in tool tip.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="icon-16" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation>Path to an icon to be used in the control palette.  If no icon is provided, only the label will be displayed in the palette.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="icon-32" type="xs:string" use="optional"/>
            <xs:attribute name="group-priority" type="xs:int" use="optional">
              <xs:annotation>
                <xs:documentation>Optional group priority that can be used to organize the order in which groups of controls appear on menus.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="group-name" type="ControlGroupNameType" use="optional"/>
            <xs:attribute name="palette-priority" type="PalettePriorityType" use="optional">
              <xs:annotation>
                <xs:documentation>Used as a hint to the IDE for ordering of controls within the palette.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="display-in-palette" type="xs:boolean" use="optional" default="true">
              <xs:annotation>
                <xs:documentation>Defines whether this control will be displayed in the control palette.</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="resource-file" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation>Optional name of resource file to load when the control author has provided localization strings.  Note that the only values that can be localized in jc-jar.xml are:
1. label
2. version
3. description</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="requires-extension" type="xs:boolean" use="optional" default="false"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="default-group-name" type="ControlGroupNameType" use="optional">
        <xs:annotation>
          <xs:documentation>Default group name for controls in this jar file.  If a control has its own group-name attribute, that value will be used for that control.
</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="control-tags" type="ControlType">
    <xs:annotation>
      <xs:documentation>Describes the annotations for a specific control</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ControlType">
    <xs:annotation>
      <xs:documentation>Structure of a control.  Note that this structure has been re-factored in beta.  A tag is defined as either a control or method tag.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="control-tag" type="ControlTagType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A tag that applies to the control instance.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="method-tag" type="MethodTagType" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A tag that applies to a method within a JCX.  Javelin should verify that this type of tag only exists for a customized control (i.e. the control can support a JCX).</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="editor-class" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>Fully qualified class name of a user provided class (e.g. property builder)</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="control-validator" type="xs:string" use="optional"/>
    <xs:attribute name="method-validator" type="xs:string" use="optional"/>
  </xs:complexType>
  <xs:complexType name="BaseTagType">
    <xs:annotation>
      <xs:documentation>Structure of a tag that configures a control</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="description" type="xs:string"/>
      <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:complexContent>
            <xs:extension base="TagAttributeType">
              <xs:attribute name="required" type="xs:boolean" use="required"/>
            </xs:extension>
          </xs:complexContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="attribute-group" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="attribute" type="TagAttributeType" minOccurs="2" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:attribute name="group-type" type="AttributeGroupType" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation>the name of the tag.  does not include prefix.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="multiple" type="xs:boolean" use="optional" default="false">
      <xs:annotation>
        <xs:documentation>Whether the tag can have multiple occurrences.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="validator-class" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>Fully-qualified name (as string) of an optional user provided class.  The class provides custom validation logic over the entire tag.  This provides a mechanism for control authors to implement cross attribute validation for a specific tag instance.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="display-in-editor" type="xs:boolean" use="optional" default="true"/>
  </xs:complexType>
  <xs:simpleType name="PalettePriorityType">
    <xs:annotation>
      <xs:documentation>Range of priorities allowed for Palette Display</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:integer">
      <xs:minInclusive value="1"/>
      <xs:maxInclusive value="10"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TagAttributeType">
    <xs:sequence>
      <xs:element name="description" type="xs:string"/>
      <xs:element name="type">
        <xs:complexType>
          <xs:choice>
            <xs:element name="text">
              <xs:annotation>
                <xs:documentation>Simple text representation</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="max-length" type="xs:int" use="optional">
                  <xs:annotation>
                    <xs:documentation>Max length of the text value.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="long" type="xs:boolean" use="optional" default="false">
                  <xs:annotation>
                    <xs:documentation>An indication for the IDE as to whether the text value should be edited in place or if a text box should be opened.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="enumeration">
              <xs:annotation>
                <xs:documentation>A list of valid values</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="value" type="xs:string" maxOccurs="unbounded">
                    <xs:annotation>
                      <xs:documentation>A valid value as a string</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
            <xs:element name="boolean">
              <xs:annotation>
                <xs:documentation>true/false</xs:documentation>
              </xs:annotation>
              <xs:complexType/>
            </xs:element>
            <xs:element name="decimal">
              <xs:annotation>
                <xs:documentation>non-integral value</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="places" type="xs:int" use="optional">
                  <xs:annotation>
                    <xs:documentation>The number of decimal places</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="min-value" type="xs:decimal" use="optional">
                  <xs:annotation>
                    <xs:documentation>The minimum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="max-value" type="xs:decimal" use="optional">
                  <xs:annotation>
                    <xs:documentation>The maximum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="integer">
              <xs:annotation>
                <xs:documentation>Integral value</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="min-value" type="xs:long" use="optional">
                  <xs:annotation>
                    <xs:documentation>Minimum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="max-value" type="xs:long" use="optional">
                  <xs:annotation>
                    <xs:documentation>Maximum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="date">
              <xs:annotation>
                <xs:documentation>Date</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="min-value" type="xs:date" use="optional">
                  <xs:annotation>
                    <xs:documentation>Minimum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="max-value" type="xs:date" use="optional">
                  <xs:annotation>
                    <xs:documentation>Maximum value inclusive</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="URI" type="xs:string"/>
            <xs:element name="URN" type="xs:string"/>
            <xs:element name="URL" type="xs:string"/>
            <xs:element name="QNAME">
              <xs:annotation>
                <xs:documentation>An XML qualified name prefix:local part</xs:documentation>
              </xs:annotation>
              <xs:complexType/>
            </xs:element>
            <xs:element name="XML">
              <xs:annotation>
                <xs:documentation>Well-formed XML</xs:documentation>
              </xs:annotation>
              <xs:complexType/>
            </xs:element>
            <xs:element name="class-name" type="xs:string">
              <xs:annotation>
                <xs:documentation>Fully-qualified class name</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="class-names" type="xs:string">
              <xs:annotation>
                <xs:documentation>Space-separated list of fully qualified class names</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="file-path">
              <xs:annotation>
                <xs:documentation>Valid file path</xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="custom">
              <xs:annotation>
                <xs:documentation>A custom (user defined) type</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="name" type="xs:string" use="required">
                  <xs:annotation>
                    <xs:documentation>The name of the type</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
                <xs:attribute name="class-name" type="xs:string" use="required">
                  <xs:annotation>
                    <xs:documentation>The fully qualified name of the class that implements an interface for validation of a type.</xs:documentation>
                  </xs:annotation>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
      <xs:element name="default-value" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>Default value for the attribute.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation>Attribute name
</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="ControlTagType">
    <xs:complexContent>
      <xs:extension base="BaseTagType">
        <xs:attribute name="allow-declaration-override" type="xs:boolean" use="optional" default="true"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MethodTagType">
    <xs:complexContent>
      <xs:extension base="BaseTagType">
        <xs:attribute name="method-location" type="JbcxMethodType" use="optional" default="interface-method">
          <xs:annotation>
            <xs:documentation>Defines the types of methods where this tag can exist.  Javelin should verify that the methods match the control implementation (e.g. the control is extensible, there is a callback interface, etc).
</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="JbcxMethodType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="interface-method"/>
      <xs:enumeration value="callback-method"/>
      <xs:enumeration value="both"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ControlGroupNameType">
    <xs:annotation>
      <xs:documentation>Optional group name that can be used to organize the control palette.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <xs:simpleType name="AttributeGroupType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="at-most-one"/>
      <xs:enumeration value="exactly-one"/>
      <xs:enumeration value="at-least-one"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
