<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.ansys.com/ekm"
    xmlns:ekm="http://www.ansys.com/ekm">
    <xsd:annotation>
        <xsd:documentation>
            EKM Workspace Configuration Schema

            Copyright (c) 2013 SAS IP, Inc. All rights reserved.

            Defines the various workspace configuration settings for EKM
        </xsd:documentation>
    </xsd:annotation>

    <xsd:complexType name="DefaultExtensions">
        <xsd:annotation>
            <xsd:documentation>
                Defines the default extension preferences.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="extension" type="ekm:Extension"
                minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Extension">
        <xsd:annotation>
            <xsd:documentation>
                Defines prefered type for an extension.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="name" type="xsd:string" />
            <xsd:element name="type" type="xsd:string" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="TypeAttribute">
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="value" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="TypeSettings">
        <xsd:sequence>
            <xsd:element name="type" type="ekm:TypeSetting"
                minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="MimeEntry">
        <xsd:sequence>
            <xsd:element name="extension" type="xsd:string"></xsd:element>
            <xsd:element name="contentType" type="xsd:string"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="MimeTable">
        <xsd:sequence>
            <xsd:element name="mimeEntry" type="ekm:MimeEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="TypeSetting">
        <xsd:sequence>
            <xsd:element name="hidden" type="xsd:boolean" minOccurs="0" default="false" />
            <xsd:element name="modelObjectClass" type="xsd:string" minOccurs="0" />
            <xsd:element name="typeAttribute" type="ekm:TypeAttribute" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Gadget">
    	<xsd:all>
        	<xsd:element name="name" type="xsd:string" minOccurs="0"/>
        	<xsd:element name="path" type="xsd:string"/>
        	<xsd:element name="essential" type="xsd:boolean" default="false" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>
    
    <xsd:complexType name="Dashboard">
        <xsd:sequence>
            <xsd:element name="gadget" type="ekm:Gadget" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="Regression">
        <xsd:sequence>
            <xsd:element name="configFilePath" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="ScheduledTask">
        <xsd:sequence>
            <xsd:element name="scriptPath" />
            <xsd:element name="day">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="Any" />
                        <xsd:enumeration value="Sunday" />
                        <xsd:enumeration value="Monday" />
                        <xsd:enumeration value="Tuesday" />
                        <xsd:enumeration value="Wednesday" />
                        <xsd:enumeration value="Thursday" />
                        <xsd:enumeration value="Friday" />
                        <xsd:enumeration value="Saturday" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="hour">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:int">
                        <xsd:minInclusive value="0" />
                        <xsd:maxInclusive value="23" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="min" default="0" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:int">
                        <xsd:minInclusive value="0" />
                        <xsd:maxInclusive value="59" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="dayInterval">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:int">
                        <xsd:minInclusive value="0" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="hourInterval" default="0"
                minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:int">
                        <xsd:minInclusive value="0" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="minInterval" default="0"
                minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:int">
                        <xsd:minInclusive value="0" />
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="ScheduledTasks">
        <xsd:sequence>
            <xsd:element name="scheduledTask" type="ekm:ScheduledTask" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

	<xsd:complexType name="Preferences">
		<xsd:sequence>
			<xsd:element name="initialUri" type="xsd:string" default="/My Home"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="onSignInObject" type="xsd:string" default="lastAccessedObject"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="locale" type="xsd:string" default="en"  minOccurs="0" maxOccurs="1"/><!-- One of 'en', 'ja', 'fr', 'de'-->
			<xsd:element name="r12Labels" type="xsd:boolean" default="true"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="unitSystem" type="xsd:string" default="SI"  minOccurs="0" maxOccurs="1"/><!-- One of 'SI', '', '', '' or any User-defined-Custom-Unit-System  -->
			<xsd:element name="disableDataExtraction" type="xsd:boolean" default="false"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="theme" type="xsd:string" default="midnightblue"  minOccurs="0" maxOccurs="1" />
			<xsd:element name="typeColumnMap"  minOccurs="0" maxOccurs="1" >
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="typeColumnMapEntry" minOccurs="0" maxOccurs="unbounded">
							<xsd:complexType>
								<xsd:all>
									<xsd:element name="typeName" type="xsd:string"/>
									<xsd:element name="columnList" type="xsd:string"/>
								</xsd:all>
							</xsd:complexType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="recyclebinPolicy" default="cleanAfterSpecifiedTime"  minOccurs="0" maxOccurs="1">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:enumeration value="cleanAfterSpecifiedTime" />
						<xsd:enumeration value="cleanOnExit" />
						<xsd:enumeration value="cleanNever" />
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="recyclebinCleanupInterval" default="30"  minOccurs="0" maxOccurs="1">
				<xsd:simpleType>
					<xsd:restriction base="xsd:integer">
						<xsd:enumeration value="30" />
						<xsd:enumeration value="7" />
						<xsd:enumeration value="1" />
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="httpProxyServer" type="xsd:string"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="httpProxyServerAuth" type="xsd:boolean" default="false"  minOccurs="0" maxOccurs="1"/>
			<xsd:element name="compressArchives" type="xsd:boolean" default="true"  minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
    </xsd:complexType>	 
	
    <xsd:element name="workspace">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="defaultExtensions" type="ekm:DefaultExtensions"
                	minOccurs="0" /> 
                <xsd:element name="mimeTable"
                    type="ekm:MimeTable" minOccurs="0" />
                <xsd:element name="typeSettings" type="ekm:TypeSettings" minOccurs="0" />
                <xsd:element name="dashboard" type="ekm:Dashboard" minOccurs="0" />
                <xsd:element name="downloadConfirmation" type="xsd:string" minOccurs="0" />
                <xsd:element name="scheduledTasks" type="ekm:ScheduledTasks" minOccurs="0"/>
                <xsd:element name="regression" type="ekm:Regression" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="preferences" type="ekm:Preferences" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="createUsersAutomatically" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="true" />
                <xsd:element name="designatedRootUser" type="xsd:string" minOccurs="0" maxOccurs="1" />
                <xsd:element name="masterServerUrl" type="xsd:string" minOccurs="0" maxOccurs="1" />
                <xsd:element name="masterServerWorkspace" type="xsd:string" minOccurs="0" maxOccurs="1" />
				<xsd:element name="jobOnlyView" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="false" />
                <xsd:element name="defaultAccessTypeForAutoCreatedUsers" type="xsd:string" minOccurs="0" maxOccurs="1" />
            </xsd:all>
        </xsd:complexType>
    </xsd:element>	
</xsd:schema>
