<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.infor.com/ICM/1"
    targetNamespace="http://schema.infor.com/ICM/1" elementFormDefault="qualified"
    attributeFormDefault="unqualified" version="1.0">
    <xs:include schemaLocation="./ICM_Common.xsd"/>
    <xs:element name="Product">
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="CollectionType">
                    <xs:choice>
                        <xs:element name="NamedUsers" type="NamedUserType" minOccurs="1"/>
                        <xs:element name="ConcurrentUsers" type="ConcurrentUserType" minOccurs="1"/>
                        <xs:element name="SessionEvents" type="TrueUpEventType"> </xs:element>
                        <xs:element name="SecurityUpdates" type="SecurityUpdateType" minOccurs="1"/>
                    </xs:choice>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="EnvironmentUserType">
        <xs:sequence>
            <xs:element name="EnvironmentUserID" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Environment User ID used to access the application:
UNIX/iSeries - User Profile
Windows - Windows User Name and Domain </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="EnvironmentUserDescription" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Environment User Description:
UNIX/iSeries - User Profile text description
Windows - Windows User description 
</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" name="Domain" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The domain where the user account is registered</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ApplicationUserType">
        <xs:sequence>
            <xs:element name="UserID" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Named User ID for the application</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="UserDescription" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Named User Description for the application</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Permissions" type="PermissionsType" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NamedUserType">
        <xs:annotation>
            <xs:documentation>Type Definition for data collection of Named User Data</xs:documentation>
        </xs:annotation>
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="NamedUser">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="EnvironmentUser" type="EnvironmentUserType" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>For systems that have different operating system users than applicaiton user. </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="ApplicationUser" type="ApplicationUserType">
                            <xs:annotation>
                                <xs:documentation>The user that connect to the Infor system.  </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="Enabled" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Is the user enabled to use the application.
Are there any restrictions elsewhere in the application which would prevent the user being considered "Enabled"</xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="LastLogon" type="xs:dateTime">
                            <xs:annotation>
                                <xs:documentation>Timestamp for the last time user accessed the application</xs:documentation>
                            </xs:annotation>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ConcurrentUserType">
        <xs:annotation>
            <xs:documentation>Type Definition for data collection of Concurrent User Data</xs:documentation>
        </xs:annotation>
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="ConcurrentUser" type="UserActionType"> </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="UserActionType">
        <xs:sequence>
            <xs:element ref="TimeStamp"/>
            <xs:element name="EnvironmentUser" type="EnvironmentUserType" minOccurs="0"/>
            <xs:element name="ApplicationUser" type="ApplicationUserType"/>
            <xs:element ref="Event">
                <xs:annotation>
                    <xs:documentation>Enumerated element which indicates the action being shown for the user, e.g. Logon, Logoff (see enumations).</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" ref="DeviceID">
                <xs:annotation>
                    <xs:documentation>Optional - should only be used for the following ActionTypes:
Logon
Logoff
SessionTimeOut</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="ProcessID" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Optional - should only be used with the following ActionTypes:
Logon
Logoff
SessionTimeOut</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="SessionID" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Optional - should only be used with the following ActionTypes:
Logon
Logoff
SessionTimeOut</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" ref="FunctionalityAccessed">
                <xs:annotation>
                    <xs:documentation>Optional - should only be used with following ActionTypes:
Logon
KeepAlive</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" name="PermissionChange" type="PermissionsType">
                <xs:annotation>
                    <xs:documentation>Optional - should only be used with the following ActionTypes:
ModifyUser</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SecurityUpdateType">
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="NamedUser" type="UserActionType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PermissionsType">
        <xs:sequence>
            <xs:element maxOccurs="unbounded" name="Permission" type="xs:string">
                <xs:annotation>
                    <xs:documentation>User application permissions:
+Application Level Access (if applicable)
+Module Level Access (if applicable)
+Program Level Access (if applicable) </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TrueUpEventType">
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="SessionEvent">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element ref="TimeStamp"/>
                        <xs:element ref="FunctionalityAccessed">
                            <xs:annotation>
                                <xs:documentation>For ERP LN this is the equivelent of session</xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element ref="Event"/>
                        <xs:element name="ApplicationUser" type="ApplicationUserType"/>
                        <xs:element ref="DeviceID"/>
                    </xs:sequence>
                    <xs:attribute name="checkSumCode" type="xs:integer"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="FunctionalityAccessed" type="xs:string"/>
    <xs:element name="TimeStamp" type="xs:dateTime"/>
    <xs:element name="Event">
        <xs:annotation>
            <xs:documentation>Enumerated element which indicates the action being shown for the user.
Valid True Up Events:
START (session)
EXIT (session)
-- The Following values are recorded when business data is changed --
INSERT
UPDATE
DELETE
</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="Logon"/>
                <xs:enumeration value="START"/>
                <xs:enumeration value="Logoff"/>
                <xs:enumeration value="EXIT"/>
                <xs:enumeration value="SessionTimeOut"/>
                <xs:enumeration value="RemoveUser"/>
                <xs:enumeration value="AddUser"/>
                <xs:enumeration value="ModifyUser"/>
                <xs:enumeration value="KeepAlive"/>
                <xs:enumeration value="INSERT"/>
                <xs:enumeration value="UPDATE"/>
                <xs:enumeration value="DELETE"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="DeviceID" type="xs:string">
        <xs:annotation>
            <xs:documentation>Optional - should only be used for the following ActionTypes:
Logon
Logoff
SessionTimeOut</xs:documentation>
        </xs:annotation>
    </xs:element>
</xs:schema>
