<?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.
5 Aug  2015    LA      Added Communication to ReportDetailType. Note - When Local.ly wants to use this for 
                       the original purpose, it would be good to have an indicator at the header level
                       to determine if this is just metadata for the report or actually the report format.
9 Nov 2015 	   LA	   Cardinality of REference element on ReportHeader changed from 0 to unbounded, BOD-3094
12 Apr 2016    LA      ReportData added to ReportBodyType, BOD-3187
28 Mar 2017    LA      ReportParameter and OutputParameter added to ReportBody, BOD-3295, BOD-3296
5 Apr 2017     LA      ReportParameter@inclusive added, BOD-3296
        *****     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/System/Components.xsd"/>
	
	<xsd:element name="Report" type="ReportType">
		<xsd:annotation>
			<xsd:documentation > Report used for
				exporting preformatted data from a fortress. </xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:complexType name="ReportType">
		<xsd:sequence>
			<xsd:element ref="ReportHeader" minOccurs="0"/>
			<xsd:element ref="ReportBody" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:element name="ReportHeader" type="ReportHeaderType"/>
	<xsd:element name="ReportBody" type="ReportBodyType"/>
	
	
	<xsd:complexType name="ReportHeaderType">
		<xsd:sequence>
			<xsd:element ref="DocumentID" minOccurs="0"/>
			<xsd:element ref="EffectiveDateTime" minOccurs="0"/>
			<xsd:element ref="ReportType" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:group ref="FreeFormTextGroup"/>
			<xsd:element ref="CustomerParty" minOccurs="0"/>
			<xsd:element ref="SupplierParty" minOccurs="0"/>
			<xsd:element ref="ReportPerson" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="ReportContact" minOccurs="0" maxOccurs="unbounded"/>	
			<xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="ReportParameterType">
		<xsd:sequence>
			<xsd:element ref="Name" minOccurs="0"/>
			<xsd:element ref="Type" minOccurs="0"/>
			<xsd:element ref="ParameterValue" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="inclusive " type ="IndicatorType" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					When set to 'true', specifies whether or not the result set is 
					inclusive of the parameter value(s) specified. When set at this level, 
					the value set here is applicable for all the ParameterValue elements.
					It could be overwridden again at the lower level if needed.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:element name="ReportParameter" type="ReportParameterType">
		<xsd:annotation>
			<xsd:documentation>
				Report Parameters are optional values that are provided as 
				INPUT into the generation of the report. They may be values used to filter the 
				report data, or values to display on the report such as a report heading, etc.
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:complexType name="ParameterValueType">
		<xsd:sequence>
			<xsd:element ref="Value" minOccurs="0"/>
			<xsd:element ref="Display" minOccurs="0"/>
		</xsd:sequence>
		<xsd:attribute name="boundRangeType" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					Specifies whether the ParameterValue is the start range value or 
					end range value for this bound range. Used only for a ReportParameter Type 
					of BoundRangeParmValueItem.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="inclusive" type ="IndicatorType" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					When set to 'true', specifies whether or not the result set is 
					inclusive of the parameter value(s) specified.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:element name="ParameterValue" type="ParameterValueType"/>
	<xsd:element name="Display" type="StringType"/>
	
	<xsd:complexType name="OutputParameterType">
		<xsd:sequence>
			<xsd:element ref="Name" minOccurs="0"/>
			<xsd:element ref="Value" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="OutputParameter" type="OutputParameterType">
		<xsd:annotation>
			<xsd:documentation>
				Output Parameters dictate formatting and language info to be used in the report output
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:complexType name="ReportBodyType">
		<xsd:annotation>
			<xsd:documentation>Each instance of ReportBody type represents a report line.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="LineNumber" minOccurs="0"/>
			<xsd:element ref="ReportParameter" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="OutputParameter" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="Type" minOccurs="0"/>
			<xsd:group ref="FreeFormTextGroup"/>
			<xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="ReportData" minOccurs="0" />
			<xsd:element ref="ReportDetail" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="ReportDetailType">
		<xsd:annotation>
			<xsd:documentation>Each instance of ReportDetail type represents a sub-line</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="LineNumber" minOccurs="0"/>
			<xsd:element ref="Type" minOccurs="0"/>
			<xsd:element ref="Communication" minOccurs="0" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>
						To specify the URL, fax machine. e-mail address etc where the report must be 
						sent to. 
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ReportDetail" type="ReportDetailType"/>
	
	<xsd:element name="ReportType" type="CodeType"/>
	
	<xsd:complexType name="ReportPersonType">
		<xsd:complexContent>
			<xsd:extension base="PersonReferenceType">
				<xsd:attribute name="role" type="NormalizedStringType"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="ReportPerson" type="ReportPersonType"/>
	
	<xsd:complexType name="ReportContactType">
		<xsd:complexContent>
			<xsd:extension base="ContactType">
				<xsd:attribute name="role" type="NormalizedStringType"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="ReportContact" type="ReportContactType"/>
	<xsd:element name="ReportData" type="StringType">
		<xsd:annotation>
			<xsd:documentation>
				To contain the XML data that is used to populate the report. Additional documentation
				available with BDS documentation. 
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
</xsd:schema>