<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2004 The Apache Software Foundation

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. -->


<!-- @todo: need to remove the legacy-tag-support from this -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://beehive.apache.org/netui/2004/server/config"
            xmlns:netui="http://beehive.apache.org/netui/2004/server/config"
            elementFormDefault="qualified">

    <xsd:element name="netui-config">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="legacy-tag-support" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="false"/>
                <xsd:element name="expression-languages" type="netui:expression-languages" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="pageflow-action-interceptors" type="netui:pageflow-action-interceptors" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="pageflow-handlers" type="netui:pageflow-handlers" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="pageflow-config" type="netui:pageflow-config" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="type-converters" type="netui:type-converters" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="jsp-tag-config" type="netui:jsp-tag-config" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="iterator-factories" type="netui:iterator-factories" minOccurs="0" maxOccurs="1"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="action-interceptor">
        <xsd:sequence>
            <xsd:element name="interceptor-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="pageflow-action-interceptors">
        <xsd:sequence>
            <xsd:element name="global" minOccurs="0" maxOccurs="1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="before-action" minOccurs="0" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence>
                                    <xsd:element name="action-interceptor" type="netui:action-interceptor" minOccurs="1" maxOccurs="unbounded"/>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element>
                        <xsd:element name="after-action" minOccurs="0" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence>
                                    <xsd:element name="action-interceptor" type="netui:action-interceptor" minOccurs="1" maxOccurs="unbounded"/>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="pageflow-handlers">
        <xsd:sequence>
            <xsd:element name="login-handler-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="forward-redirect-handler-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="reloadable-class-handler-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="exceptions-handler-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="module-config-locators">
        <xsd:sequence>
            <xsd:element name="module-config-locator" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                        <xsd:element name="locator-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="pageflow-config">
        <xsd:sequence>
            <xsd:element name="enable-renesting" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="false"/>
            <xsd:element name="max-forwards-per-request" type="xsd:int" minOccurs="0" maxOccurs="1" default="25"/>
            <xsd:element name="max-nesting-stack-depth" type="xsd:int" minOccurs="0" maxOccurs="1" default="10"/>
            <xsd:element name="ensure-secure-forwards" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="false"/>
            <xsd:element name="throw-session-expired-exception" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="true"/>
            <xsd:element name="multipart-handler" minOccurs="0" maxOccurs="1" default="disabled">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="disabled"/>
                        <xsd:enumeration value="memory"/>
                        <xsd:enumeration value="disk"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="module-config-locators" type="netui:module-config-locators" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="jsp-tag-config">
        <xsd:sequence>
            <xsd:element name="doctype" type="xsd:string" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="id-javascript" minOccurs="0" maxOccurs="1" default="default">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="default"/>
                        <!-- This flag will turn on Legacy JavaScript support for id and name attributes.  When this is
                        set the default tag JavaScript will also be output. -->
                        <xsd:enumeration value="legacy"/>
                        <!-- This flag will make Legacy JavaScript support the only type of JavaScript output for id
                        and name attributes. -->
                        <xsd:enumeration value="legacyOnly"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="tree-image-location" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="type-converters">
        <xsd:sequence>
            <xsd:element name="type-converter" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="converter-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="iterator-factories">
        <xsd:sequence>
            <xsd:element name="iterator-factory" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="factory-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="expression-languages">
        <xsd:sequence>
            <xsd:element name="default-language" type="xsd:string" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="expression-language" minOccurs="1" maxOccurs="unbounded">
                <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="factory-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="binding-contexts" type="netui:binding-contexts" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="binding-contexts">
        <xsd:sequence>
            <xsd:element name="binding-context" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="factory-class" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>


