<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by danas (exlibri) -->
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Guy (Exlibris) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ar="http://com/exlibris/digitool/repository/api/xmlbeans" targetNamespace="http://com/exlibris/digitool/repository/api/xmlbeans" elementFormDefault="unqualified">
  <xs:element name="access_right_md">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ar_copyrights" type="ar:ar_copyrights"/>
        <xs:element name="ar_conditions" type="ar:ar_conditions"/>
      </xs:sequence>
      <xs:attribute name="enabled" type="xs:boolean" default="true"/>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="ar_copyrights">
    <xs:annotation>
      <xs:documentation>Access Rights copyrights: the name of the file which contains the copyrights declaration.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="text_file" type="xs:string"/>
    </xs:sequence>
    <xs:attribute name="required" type="xs:boolean" default="false"/>
  </xs:complexType>
  <xs:complexType name="ar_conditions">
    <xs:annotation>
      <xs:documentation>Conditions: a set of access rights conditions. In case of several conditions, the operator "OR" is used between the conditions. </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ar_condition" type="ar:ar_condition" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ar_condition">
    <xs:annotation>
      <xs:documentation>Access Rights condition: each condition can contain one or more expressions. The condition element has one attribute called "negate". This attribute is used to indicate whether the condition is taken as is (negate=false) or as "NOT" condition (negate=true) </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ar_expressions" type="ar:ar_expressions"/>
    </xs:sequence>
    <xs:attribute name="negate" type="xs:boolean" default="false"/>
  </xs:complexType>
  <xs:complexType name="ar_expressions">
    <xs:annotation>
      <xs:documentation>Access Rights expressions: this element enables building the condition as a set of expressions. Each expression is composed of two elements: key and value/s. The key element specifies the type of permission, i.e., group, IP range, not guest, course enrollment, everyone etc. The expression has two attributes: "negate" and "ar_operation". The negate attribute is used as the logical opertaor "NOT". The operation is used to indicate the relation between the Key and the Value elements, i.e., "eqals" or "within".</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ar_expression" type="ar:ar_expression" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ar_expression">
    <xs:sequence>
      <xs:element name="key" type="ar:ar_key"/>
      <xs:element name="val1" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            Value: Holds the value/s of the key parameter.
            comment: In the case of Key=Custom (for simultaneous use), Value 1 will hold the full class name and Value 2 will hold parameters that passed to the checker
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="val2" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            Value: Holds the value/s of the key parameter.
            comment: In the case of Key=Custom (for simultaneous use), Value 1 will hold the full class name and Value 2 will hold parameters that passed to the checker
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="negate" type="xs:boolean" default="false"/>
    <xs:attribute name="ar_operation" type="ar:ar_operation" default="eq"/>
  </xs:complexType>
  <xs:simpleType name="ar_operation">
    <xs:restriction base="xs:string">
      <xs:enumeration value="eq"/>
      <xs:enumeration value="within"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ar_key">
    <xs:restriction base="xs:string">
      <xs:enumeration value="group"/>
      <xs:enumeration value="user_id"/>
      <xs:enumeration value="ip_range"/>
      <xs:enumeration value="not_guest"/>
      <xs:enumeration value="everyone"/>
      <xs:enumeration value="expiry_date"/>
      <xs:enumeration value="bor_group_m"/>
      <xs:enumeration value="bor_dept_m"/>
      <xs:enumeration value="bor_tuples_m"/>
      <xs:enumeration value="course_enrollment_m"/>
      <xs:enumeration value="custom"/>
      <!-- Expiry date in this "yyyy-MM-dd HH:mm:ss" format -->
      <!-- LDAP VALUE -->
      <!-- 
				custom checking class that implements the AccessChecker Interface
				val1 - hold the full class name 
				val2 - hold parameters that passed to the checker
			
				We already implement a SimultaneousUseAccessChecker checker.
				Usages:
				val1=com.exlibris.digitool.delivery
				val2=<number_of_simultaneous_use> <session lenght in seconds>
     		 -->
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
