<?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
    03 Nov 2009    NO      Initial submission by LMA team (Marco Rutgers) JIRA BOD-1153
    
    *****     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="ExtendLicenseUsage" type="ExtendLicenseUsageType">
        <xsd:annotation>
            <xsd:documentation/>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="ExtendLicenseUsageType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="SoftwareID"/>
                    <xsd:element ref="SoftwareInstanceID" minOccurs="0"/>
                    <xsd:element ref="DefaultValues" minOccurs="0"/>
                    <xsd:element ref="LicenseEvents" minOccurs="0"/>
                    <xsd:element ref="Checksum"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
    <!--
        The default values can be used to reduce the size of the transmitted BOD.
        Fields that are known to have a 'constant' value in the context of one BOD or even an environment
            can be put in this section. They don't need to be put in the individual Event entries anymore.
            If they are however mentioned in an individual event, that value will overrule the default.
            To say it otherwise: each value in the 'Defaults' section is considered to be part of each
            of the Event entries, unless it is explicitly specified in the Event itself.
        
        Explanation of the individual fields:
        DistinguishedName: contains the name that identifies a user. This is for example the SSO user ID
                               like 'jdoe'. It is not the full name or description (like "John Doe").
        Tenant: this field is not explicitly in the noun part of the BOD. The BOD itself is transmitted
                in the context of a Tenant, which is part of the Application Area of the BOD. Only if
                an event is to be transmitted that carries information for an user that is in another Tenant
                than the Tenant of the BOD context, it must be mentioned as part of the DistinguishedName.
                The format in that case is: userName@tenant
        SessionID: Together with the userID and the Tenant, this uniquely defines a concurrent user.
                   This can be e.g. an identifier for the browser session of the user or an identifier
                   of the desktop of the user.
        AggregateTimeout: contains a time in seconds. If individual event records are not further apart
                           than this distance, they can be aggregated to one time interval.
                           For now, only events of SoftwareID "ERP LN" and CountingType "UserRequest" are
                           aggregated if they are close enough.
                           Note that for every 'SoftwareID', the LMA Fortress has a default AggregateDistance
                           value built in. For ERP LN this is 900 seconds (15 minutes). Only if the actual
                           value at a customer site differs, this needs to be supplied in the BOD.
        ExtendProperties: zero or more 'SoftwareID' specific properties.
        MergeDiscriminator : The field is to be filled in by the Extend products and indicates which Requests
                            and "Release events" really belong together. The LMA Fortress will use this information
                            to determine whether incoming events can be merged with existing records already in the database.
                            This merge will reduce the amount of records we need to store.
        
    -->
    <xsd:complexType name="DefaultValuesType">
        <xsd:sequence>
            <xsd:element ref="DistinguishedName" minOccurs="0"/>
            <xsd:element ref="SessionID" minOccurs="0"/>
            <xsd:element ref="AggregateTimeout" minOccurs="0"/>
            <xsd:element ref="ExtendProperties" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="DefaultValues" type="DefaultValuesType"/>
    
    <xsd:complexType name="LicenseEventsType">
        <xsd:sequence>
            <xsd:element ref="LicenseEvent" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="LicenseEvents" type="LicenseEventsType"/>
    
    <xsd:complexType name="LicenseEventType">
        <xsd:sequence>
            <xsd:element ref="ProductID"/>
            <xsd:element ref="CountingType"/>
            <xsd:element ref="DistinguishedName" minOccurs="0"/>
            <xsd:element ref="SessionID" minOccurs="0"/>
            <xsd:element ref="AggregateTimeout" minOccurs="0"/>
            <xsd:element ref="EventDateTime"/>
            <xsd:element ref="MergeDiscriminator" minOccurs="0"/>
            <xsd:element ref="ExtendProperties" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="LicenseEvent" type="LicenseEventType"/>
    
    <xsd:complexType name="ExtendPropertiesType">
        <xsd:sequence>
            <xsd:element ref="ExtendProperty" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="ExtendProperties" type="ExtendPropertiesType"/>
    
    <xsd:complexType name="ExtendPropertyType">
        <xsd:simpleContent>
            <xsd:extension base="StringType">
                <xsd:attribute name="name" type="NormalizedStringType" use="required"/>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>
    
    <xsd:element name="ExtendProperty" type="ExtendPropertyType"/>
    
    <xsd:element name="SoftwareID" type="IdentifierType"/>
    <xsd:element name="SoftwareInstanceID" type="URIType"/>
    <xsd:element name="AggregateTimeout" type="NumericType"/>
    <xsd:element name="CountingType" type="StringType"/>
    <xsd:element name="EventDateTime" type="DateTimeType"/>
    <xsd:element name="MergeDiscriminator" type="StringType"/>
    
</xsd:schema>
