<?xml version="1.0" encoding="utf-8"?>
<!--
        
        ** OAGIS® Revision: 9.1  **
        ** Date: 11 May 2007 **
        ** Copyright 1997-2007, All Rights Reserved **
        
        This is an OAGIS® BOD XML Schema (XSD) Definition.
        
       License information for this file is provided in the file **OAGi License Agreement.txt** that is provided with this download package.
        
        For support, more information, or to report implementation bugs, please contact the Open Applications Group at xml@openapplications.org.
        
        XML Schema 
        
-->
 
<!--
© Copyright 2007 Infor Global Solutions Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. The 
word and design marks set forth herein are trademarks and/or registered trademarks of Infor Global Solutions 
Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. All other trademarks listed herein 
are the property of their respective owners.
 
-->
 
<!--    *****     Update Log     *****
 
Date          By      Note
10 Apr 2008    JB      Added correct Copyright and update comments to schema.
 
        *****     Update End     *****
 
-->




<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schema.infor.com/InforOAGIS/2"
    targetNamespace="http://schema.infor.com/InforOAGIS/2" elementFormDefault="qualified"
    attributeFormDefault="unqualified">

    <xsd:include schemaLocation="../Components/Common/Components.xsd"/>

    <xsd:element name="Hierarchy" type="HierarchyType">
        <xsd:annotation>
            <xsd:documentation> Hierarchy used for accounting analysis. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="HierarchyType">
        <xsd:sequence>
            <xsd:element ref="HierarchyHeader" minOccurs="0"/>
            <xsd:element ref="HierarchyNode" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="HierarchyHeaderType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="CodeReference" minOccurs="0"/>
                    <xsd:element ref="CompleteIndicator" minOccurs="0"/>
                    <xsd:element ref="SecurityIndicator" minOccurs="0"/>
                    <xsd:element ref="PriceBookIndicator" minOccurs="0"/>
                    <xsd:element ref="EnterpriseHierarchyIndicator" minOccurs="0"/>
                    <xsd:element ref="LookupIndicator" minOccurs="0"/>
                    <xsd:element ref="EffectiveTimePeriod" minOccurs="0"/>
                    <xsd:element ref="Locale" minOccurs="0"/>
                    <xsd:element ref="Property" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="LayerDetail" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="HierarchyNodeType">
        <xsd:sequence>
            <xsd:element ref="NodeID" minOccurs="0"/>
            <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ParentNodeID" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation> When the ParentNodeID is omitted or null then the node is
                        the root node or the unassigned node. </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="RootIndicator" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation> The default is false. </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="DefaultIndicator" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation> The default is false. </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="NodeRule" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="SourceCode" minOccurs="0"/>
            <xsd:element ref="Property" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="CodeReferenceType">
        <xsd:sequence>
            <xsd:element ref="ListID" minOccurs="0"/>
            <xsd:element ref="CodeContext" minOccurs="0"/>
            <xsd:element ref="LeafField" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="NodeRuleType">
        <xsd:sequence>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:annotation>
                        <xsd:documentation> For individually selected members </xsd:documentation>
                    </xsd:annotation>
                    <xsd:element ref="EqualValue" minOccurs="0"/>
                </xsd:sequence>
                <xsd:sequence>
                    <xsd:annotation>
                        <xsd:documentation> When members are sleected by a range.
                        </xsd:documentation>
                    </xsd:annotation>
                    <xsd:element ref="MinValue" minOccurs="0"/>
                    <xsd:element ref="MaxValue" minOccurs="0"/>
                </xsd:sequence>
                <xsd:sequence>
                    <xsd:annotation>
                        <xsd:documentation> When members are sleected by wildcard.
                        </xsd:documentation>
                    </xsd:annotation>
                    <xsd:element ref="PatternValue" minOccurs="0"/>
                </xsd:sequence>
            </xsd:choice>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="LayerDetailType">
        <xsd:sequence>
            <xsd:element ref="Code" minOccurs="1"/>
            <xsd:element ref="FullyResolvedIndicator" minOccurs="0"/>
        </xsd:sequence>    
        <xsd:attribute name="sequence" type="PositiveIntegerNumericType"></xsd:attribute>
    </xsd:complexType>
    
    <xsd:element name="LayerDetail" type="LayerDetailType"/>
    
    <xsd:element name="CodeReference" type="CodeReferenceType">
        <xsd:annotation>
            <xsd:documentation> Reference to the type of the Code. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="SourceCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>When the node is created to represent a code which may not be
                included in the noun that is being mapped into the hierarchy, this is the code so
                that other applications can track back the meaningof the
            hierarchy.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="HierarchyHeader" type="HierarchyHeaderType"/>
    <xsd:element name="HierarchyNode" type="HierarchyNodeType"/>
    <xsd:element name="CodeContext" type="NormalizedStringType">
        <xsd:annotation>
            <xsd:documentation> Defines the context for the Code Type when the code type is for a
                calendar or chart of accounts. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="LeafField" type="NormalizedStringType">
        <xsd:annotation>
            <xsd:documentation> The name of the leaf being referenced. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="CompleteIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that all possible values must be represented in the
                hierarchy. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="FullyResolvedIndicator" type="IndicatorType"/>
    <xsd:element name="SecurityIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that the hierarchy is built for security.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="PriceBookIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that the hierarchy will be used for a price list.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="EnterpriseHierarchyIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that this hierarchy is the enterprise organizational
                hierarchy. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="LookupIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that this hierarchy will be used for lookups.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="ParentNodeID" type="IdentifierType">
        <xsd:annotation>
            <xsd:documentation> The NodeID of the node that is the parent of the current Node.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="RootIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation> Indicates that this node is the root node of the hierarchy.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="NodeRule" type="NodeRuleType"/>
    <xsd:element name="EqualValue" type="NormalizedStringType"/>
    <xsd:element name="MinValue" type="NormalizedStringType"/>
    <xsd:element name="MaxValue" type="NormalizedStringType"/>
    <xsd:element name="PatternValue" type="NormalizedStringType"/>
    <xsd:element name="Locale" type="NormalizedStringType">
        <xsd:annotation>
            <xsd:documentation> Values must conform to RFC 1766. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
</xsd:schema>
