<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
  <classes>
    <class id="Contract" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <comment><![CDATA[/**
 * Persistent classes for a CMDB
 *
 * @copyright   Copyright (C) 2010-2012 Combodo SARL
 * @license     http://opensource.org/licenses/AGPL-3.0
 */]]></comment>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>contract</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field>finalclass</db_final_class_field>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>contract.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="start_date" xsi:type="AttributeDateTime">
          <sql>start_date</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="end_date" xsi:type="AttributeDateTime">
          <sql>end_date</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="cost" xsi:type="AttributeInteger">
          <sql>cost</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="cost_currency" xsi:type="AttributeEnum">
          <values>
            <value>dollars</value>
            <value>euros</value>
          </values>
          <sql>cost_currency</sql>
          <default_value>euros</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="cost_unit" xsi:type="AttributeString">
          <sql>cost_unit</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="billing_frequency" xsi:type="AttributeString">
          <sql>billing_frequency</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="contact_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToContact</linked_class>
          <ext_key_to_me>contract_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>contact_id</ext_key_to_remote>
        </field>
        <field id="document_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToDoc</linked_class>
          <ext_key_to_me>contract_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>document_id</ext_key_to_remote>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToCI</linked_class>
          <ext_key_to_me>contract_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>ci_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="start_date">
              <rank>30</rank>
            </item>
            <item id="end_date">
              <rank>40</rank>
            </item>
            <item id="cost">
              <rank>50</rank>
            </item>
            <item id="cost_currency">
              <rank>60</rank>
            </item>
            <item id="cost_unit">
              <rank>70</rank>
            </item>
            <item id="billing_frequency">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="ci_list">
              <rank>110</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="start_date">
              <rank>30</rank>
            </item>
            <item id="end_date">
              <rank>40</rank>
            </item>
            <item id="cost">
              <rank>50</rank>
            </item>
            <item id="cost_currency">
              <rank>60</rank>
            </item>
            <item id="cost_unit">
              <rank>70</rank>
            </item>
            <item id="billing_frequency">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="description">
              <rank>10</rank>
            </item>
            <item id="start_date">
              <rank>20</rank>
            </item>
            <item id="end_date">
              <rank>30</rank>
            </item>
            <item id="cost">
              <rank>40</rank>
            </item>
            <item id="cost_currency">
              <rank>50</rank>
            </item>
            <item id="cost_unit">
              <rank>60</rank>
            </item>
            <item id="billing_frequency">
              <rank>70</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="ProviderContract" _delta="define">
      <parent>Contract</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>providercontract</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>contract.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="provider_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="provider_id" xsi:type="AttributeExternalKey">
          <sql>provider_id</sql>
          <target_class>Organization</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="provider_name" xsi:type="AttributeExternalField">
          <extkey_attcode>provider_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="sla" xsi:type="AttributeString">
          <sql>sla</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="coverage" xsi:type="AttributeString">
          <sql>coverage</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods>
        <method id="MapContextParam">
          <comment><![CDATA[/**
	 * Maps the given context parameter name to the appropriate filter/search code for this class
	 * @param string $sContextParam Name of the context parameter, e.g. 'org_id'
	 * @return string Filter code, e.g. 'customer_id'
	 */]]></comment>
          <static>true</static>
          <access>public</access>
          <type>Overload-iDisplay</type>
          <code><![CDATA[	public static function MapContextParam($sContextParam)
	{
		if ($sContextParam == 'org_id')
		{
			return 'provider_id';
		}
		else
		{
			return parent::MapContextParam($sContextParam); // Ask the parent what to do with other parameters...
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="start_date">
              <rank>30</rank>
            </item>
            <item id="end_date">
              <rank>40</rank>
            </item>
            <item id="cost">
              <rank>50</rank>
            </item>
            <item id="cost_currency">
              <rank>60</rank>
            </item>
            <item id="cost_unit">
              <rank>70</rank>
            </item>
            <item id="billing_frequency">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="ci_list">
              <rank>110</rank>
            </item>
            <item id="provider_id">
              <rank>120</rank>
            </item>
            <item id="sla">
              <rank>130</rank>
            </item>
            <item id="coverage">
              <rank>140</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="start_date">
              <rank>30</rank>
            </item>
            <item id="end_date">
              <rank>40</rank>
            </item>
            <item id="cost">
              <rank>50</rank>
            </item>
            <item id="cost_currency">
              <rank>60</rank>
            </item>
            <item id="cost_unit">
              <rank>70</rank>
            </item>
            <item id="billing_frequency">
              <rank>80</rank>
            </item>
            <item id="provider_id">
              <rank>90</rank>
            </item>
            <item id="sla">
              <rank>100</rank>
            </item>
            <item id="coverage">
              <rank>110</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="start_date">
              <rank>10</rank>
            </item>
            <item id="end_date">
              <rank>20</rank>
            </item>
            <item id="provider_id">
              <rank>30</rank>
            </item>
            <item id="sla">
              <rank>40</rank>
            </item>
            <item id="coverage">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="CustomerContract" _delta="define">
      <parent>Contract</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>customercontract</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>contract.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="provider_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="org_id" xsi:type="AttributeExternalKey">
          <sql>org_id</sql>
          <target_class>Organization</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="org_name" xsi:type="AttributeExternalField">
          <extkey_attcode>org_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="provider_id" xsi:type="AttributeExternalKey">
          <sql>provider_id</sql>
          <target_class>Organization</target_class>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="provider_name" xsi:type="AttributeExternalField">
          <extkey_attcode>provider_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="support_team_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Team WHERE Team.org_id = :this->provider_id]]></filter>
          <dependencies>
            <attribute id="provider_id"/>
          </dependencies>
          <sql>support_team_id</sql>
          <target_class>Team</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="support_team_name" xsi:type="AttributeExternalField">
          <extkey_attcode>support_team_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="sla_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToSLA</linked_class>
          <ext_key_to_me>contract_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>sla_id</ext_key_to_remote>
        </field>
        <field id="provider_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkCustomerContractToProviderContract</linked_class>
          <ext_key_to_me>customer_contract_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>provider_contract_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="description">
              <rank>30</rank>
            </item>
            <item id="start_date">
              <rank>40</rank>
            </item>
            <item id="end_date">
              <rank>50</rank>
            </item>
            <item id="cost">
              <rank>60</rank>
            </item>
            <item id="cost_currency">
              <rank>70</rank>
            </item>
            <item id="cost_unit">
              <rank>80</rank>
            </item>
            <item id="billing_frequency">
              <rank>90</rank>
            </item>
            <item id="contact_list">
              <rank>100</rank>
            </item>
            <item id="document_list">
              <rank>110</rank>
            </item>
            <item id="ci_list">
              <rank>120</rank>
            </item>
            <item id="provider_list">
              <rank>130</rank>
            </item>
            <item id="provider_id">
              <rank>140</rank>
            </item>
            <item id="support_team_id">
              <rank>150</rank>
            </item>
            <item id="sla_list">
              <rank>160</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="start_date">
              <rank>40</rank>
            </item>
            <item id="end_date">
              <rank>50</rank>
            </item>
            <item id="cost">
              <rank>60</rank>
            </item>
            <item id="cost_currency">
              <rank>70</rank>
            </item>
            <item id="cost_unit">
              <rank>80</rank>
            </item>
            <item id="billing_frequency">
              <rank>90</rank>
            </item>
            <item id="provider_id">
              <rank>100</rank>
            </item>
            <item id="support_team_id">
              <rank>110</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="start_date">
              <rank>20</rank>
            </item>
            <item id="end_date">
              <rank>30</rank>
            </item>
            <item id="provider_id">
              <rank>40</rank>
            </item>
            <item id="support_team_id">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkCustomerContractToProviderContract" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcustomercontracttoprovider</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="customer_contract_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="customer_contract_id"/>
            <attribute id="provider_contract_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="customer_contract_id" xsi:type="AttributeExternalKey">
          <sql>customer_contract_id</sql>
          <target_class>CustomerContract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="customer_contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>customer_contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="provider_contract_id" xsi:type="AttributeExternalKey">
          <sql>provider_contract_id</sql>
          <target_class>ProviderContract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="provider_contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>provider_contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="provider_sla" xsi:type="AttributeExternalField">
          <extkey_attcode>provider_contract_id</extkey_attcode>
          <target_attcode>sla</target_attcode>
        </field>
        <field id="provider_coverage" xsi:type="AttributeExternalField">
          <extkey_attcode>provider_contract_id</extkey_attcode>
          <target_attcode>coverage</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="customer_contract_id">
              <rank>10</rank>
            </item>
            <item id="provider_contract_id">
              <rank>20</rank>
            </item>
            <item id="provider_sla">
              <rank>30</rank>
            </item>
            <item id="provider_coverage">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="customer_contract_id">
              <rank>10</rank>
            </item>
            <item id="provider_contract_id">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="customer_contract_id">
              <rank>10</rank>
            </item>
            <item id="provider_contract_id">
              <rank>20</rank>
            </item>
            <item id="provider_sla">
              <rank>30</rank>
            </item>
            <item id="provider_coverage">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkContractToSLA" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcontracttosla</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="contract_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="contract_id"/>
            <attribute id="sla_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="contract_id" xsi:type="AttributeExternalKey">
          <sql>contract_id</sql>
          <target_class>CustomerContract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="sla_id" xsi:type="AttributeExternalKey">
          <sql>sla_id</sql>
          <target_class>SLA</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="sla_name" xsi:type="AttributeExternalField">
          <extkey_attcode>sla_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="sla_service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>sla_id</extkey_attcode>
          <target_attcode>service_name</target_attcode>
        </field>
        <field id="coverage" xsi:type="AttributeString">
          <sql>coverage</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="sla_id">
              <rank>20</rank>
            </item>
            <item id="sla_service_name">
              <rank>30</rank>
            </item>
            <item id="coverage">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="sla_id">
              <rank>20</rank>
            </item>
            <item id="coverage">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="sla_id">
              <rank>20</rank>
            </item>
            <item id="sla_service_name">
              <rank>30</rank>
            </item>
            <item id="coverage">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkContractToDoc" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcontracttodoc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="contract_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="contract_id"/>
            <attribute id="document_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="contract_id" xsi:type="AttributeExternalKey">
          <sql>contract_id</sql>
          <target_class>Contract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="document_id" xsi:type="AttributeExternalKey">
          <sql>document_id</sql>
          <target_class>Document</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="document_name" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="document_type" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>type</target_attcode>
        </field>
        <field id="document_status" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>status</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkContractToContact" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcontracttocontact</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="contract_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="contract_id"/>
            <attribute id="contact_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="contract_id" xsi:type="AttributeExternalKey">
          <sql>contract_id</sql>
          <target_class>Contract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contact_id" xsi:type="AttributeExternalKey">
          <sql>contact_id</sql>
          <target_class>Contact</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contact_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contact_email" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>email</target_attcode>
        </field>
        <field id="role" xsi:type="AttributeString">
          <sql>role</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkContractToCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcontracttoci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="contract_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="contract_id"/>
            <attribute id="ci_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="contract_id" xsi:type="AttributeExternalKey">
          <sql>contract_id</sql>
          <target_class>Contract</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contract_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contract_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_id" xsi:type="AttributeExternalKey">
          <sql>ci_id</sql>
          <target_class>FunctionalCI</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="ci_name" xsi:type="AttributeExternalField">
          <extkey_attcode>ci_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_status" xsi:type="AttributeExternalField">
          <extkey_attcode>ci_id</extkey_attcode>
          <target_attcode>status</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="contract_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Service" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>service</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>service.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="org_id" xsi:type="AttributeExternalKey">
          <sql>org_id</sql>
          <target_class>Organization</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="provider_name" xsi:type="AttributeExternalField">
          <extkey_attcode>org_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="type" xsi:type="AttributeEnum">
          <values>
            <value>RequestManagement</value>
            <value>IncidentManagement</value>
          </values>
          <sql>type</sql>
          <default_value>IncidentManagement</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="status" xsi:type="AttributeEnum">
          <values>
            <value>design</value>
            <value>production</value>
            <value>obsolete</value>
          </values>
          <sql>status</sql>
          <default_value>design</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="subcategory_list" xsi:type="AttributeLinkedSet">
          <linked_class>ServiceSubcategory</linked_class>
          <ext_key_to_me>service_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
        <field id="sla_list" xsi:type="AttributeLinkedSet">
          <linked_class>SLA</linked_class>
          <ext_key_to_me>service_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
        <field id="document_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkServiceToDoc</linked_class>
          <ext_key_to_me>service_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>document_id</ext_key_to_remote>
        </field>
        <field id="contact_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkServiceToContact</linked_class>
          <ext_key_to_me>service_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>contact_id</ext_key_to_remote>
        </field>
      </fields>
      <methods>
        <method id="DisplayBareRelations">
          <static>false</static>
          <access>public</access>
          <type>Overload-cmdbAbstractObject</type>
          <code><![CDATA[	function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
	{
		parent::DisplayBareRelations($oPage, $bEditMode);
		$aExtraParam = array ('menu' => false, 'block_id' => 'service');
		$ServiceID=$this->GetKey();
		if (!$bEditMode)
		{
			$oPage->SetCurrentTab(Dict::S('Class:Service/Tab:Related_Contracts'));
			$oCustomerContracts=new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT CustomerContract AS cc JOIN lnkContractToSLA AS ln ON ln.contract_id=cc.id JOIN SLA AS sla ON ln.sla_id=sla.id WHERE sla.service_id=$ServiceID"));
			self::DisplaySet($oPage,$oCustomerContracts,$aExtraParam);
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="subcategory_list">
              <rank>60</rank>
            </item>
            <item id="sla_list">
              <rank>70</rank>
            </item>
            <item id="document_list">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="description">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="type">
              <rank>30</rank>
            </item>
            <item id="status">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="ServiceSubcategory" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>servicesubcategory</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>sla.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="service_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="description" xsi:type="AttributeString">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="service_id" xsi:type="AttributeExternalKey">
          <sql>service_id</sql>
          <target_class>Service</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="org_id" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>org_id</target_attcode>
        </field>
        <field id="provider_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>provider_name</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="service_id">
              <rank>30</rank>
            </item>
            <item id="description">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="service_id">
              <rank>30</rank>
            </item>
            <item id="provider_name">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="SLA" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>sla</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>sla.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="service_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="service_id" xsi:type="AttributeExternalKey">
          <sql>service_id</sql>
          <target_class>Service</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="slt_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkSLTToSLA</linked_class>
          <ext_key_to_me>sla_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>slt_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="service_id">
              <rank>20</rank>
            </item>
            <item id="slt_list">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="service_id">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="SLT" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>slt</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>slt.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="metric" xsi:type="AttributeEnum">
          <values>
            <value>TTO</value>
            <value>TTR</value>
          </values>
          <sql>metric</sql>
          <default_value>TTO</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="ticket_priority" xsi:type="AttributeEnum">
          <values>
            <value>1</value>
            <value>2</value>
            <value>3</value>
          </values>
          <sql>ticket_priority</sql>
          <default_value>1</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="value" xsi:type="AttributeInteger">
          <sql>value</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="value_unit" xsi:type="AttributeEnum">
          <values>
            <value>days</value>
            <value>hours</value>
            <value>minutes</value>
          </values>
          <sql>value_unit</sql>
          <default_value>hours</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="sla_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkSLTToSLA</linked_class>
          <ext_key_to_me>slt_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>sla_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="metric">
              <rank>20</rank>
            </item>
            <item id="ticket_priority">
              <rank>30</rank>
            </item>
            <item id="value">
              <rank>40</rank>
            </item>
            <item id="value_unit">
              <rank>50</rank>
            </item>
            <item id="sla_list">
              <rank>60</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="metric">
              <rank>20</rank>
            </item>
            <item id="ticket_priority">
              <rank>30</rank>
            </item>
            <item id="value">
              <rank>40</rank>
            </item>
            <item id="value_unit">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="metric">
              <rank>10</rank>
            </item>
            <item id="ticket_priority">
              <rank>20</rank>
            </item>
            <item id="value">
              <rank>30</rank>
            </item>
            <item id="value_unit">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkSLTToSLA" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkslttosla</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="sla_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="sla_id"/>
            <attribute id="slt_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="sla_id" xsi:type="AttributeExternalKey">
          <sql>sla_id</sql>
          <target_class>SLA</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="sla_name" xsi:type="AttributeExternalField">
          <extkey_attcode>sla_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="slt_id" xsi:type="AttributeExternalKey">
          <sql>slt_id</sql>
          <target_class>SLT</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="slt_name" xsi:type="AttributeExternalField">
          <extkey_attcode>slt_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="slt_metric" xsi:type="AttributeExternalField">
          <extkey_attcode>slt_id</extkey_attcode>
          <target_attcode>metric</target_attcode>
        </field>
        <field id="slt_ticket_priority" xsi:type="AttributeExternalField">
          <extkey_attcode>slt_id</extkey_attcode>
          <target_attcode>ticket_priority</target_attcode>
        </field>
        <field id="slt_value" xsi:type="AttributeExternalField">
          <extkey_attcode>slt_id</extkey_attcode>
          <target_attcode>value</target_attcode>
        </field>
        <field id="slt_value_unit" xsi:type="AttributeExternalField">
          <extkey_attcode>slt_id</extkey_attcode>
          <target_attcode>value_unit</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="sla_id">
              <rank>10</rank>
            </item>
            <item id="slt_id">
              <rank>20</rank>
            </item>
            <item id="slt_metric">
              <rank>30</rank>
            </item>
            <item id="slt_ticket_priority">
              <rank>40</rank>
            </item>
            <item id="slt_value">
              <rank>50</rank>
            </item>
            <item id="slt_value_unit">
              <rank>60</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="sla_id">
              <rank>10</rank>
            </item>
            <item id="slt_id">
              <rank>20</rank>
            </item>
            <item id="slt_metric">
              <rank>30</rank>
            </item>
            <item id="slt_ticket_priority">
              <rank>40</rank>
            </item>
            <item id="slt_value">
              <rank>50</rank>
            </item>
            <item id="slt_value_unit">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="sla_id">
              <rank>10</rank>
            </item>
            <item id="slt_id">
              <rank>20</rank>
            </item>
            <item id="slt_metric">
              <rank>30</rank>
            </item>
            <item id="slt_ticket_priority">
              <rank>40</rank>
            </item>
            <item id="slt_value">
              <rank>50</rank>
            </item>
            <item id="slt_value_unit">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkServiceToDoc" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkservicetodoc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="service_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="service_id"/>
            <attribute id="document_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="service_id" xsi:type="AttributeExternalKey">
          <sql>service_id</sql>
          <target_class>Service</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="document_id" xsi:type="AttributeExternalKey">
          <sql>document_id</sql>
          <target_class>Document</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="document_name" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="document_type" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>type</target_attcode>
        </field>
        <field id="document_status" xsi:type="AttributeExternalField">
          <extkey_attcode>document_id</extkey_attcode>
          <target_attcode>status</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
            <item id="document_type">
              <rank>30</rank>
            </item>
            <item id="document_status">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkServiceToContact" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkservicetocontact</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="service_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="service_id"/>
            <attribute id="contact_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="service_id" xsi:type="AttributeExternalKey">
          <sql>service_id</sql>
          <target_class>Service</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contact_id" xsi:type="AttributeExternalKey">
          <sql>contact_id</sql>
          <target_class>Contact</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="contact_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contact_email" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>email</target_attcode>
        </field>
        <field id="role" xsi:type="AttributeString">
          <sql>role</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_email">
              <rank>30</rank>
            </item>
            <item id="role">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkServiceToCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,servicemgmt,lnkservice</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkservicetoci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="service_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="service_id"/>
            <attribute id="ci_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="service_id" xsi:type="AttributeExternalKey">
          <sql>service_id</sql>
          <target_class>Service</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="service_name" xsi:type="AttributeExternalField">
          <extkey_attcode>service_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_id" xsi:type="AttributeExternalKey">
          <sql>ci_id</sql>
          <target_class>FunctionalCI</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="ci_name" xsi:type="AttributeExternalField">
          <extkey_attcode>ci_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_status" xsi:type="AttributeExternalField">
          <extkey_attcode>ci_id</extkey_attcode>
          <target_attcode>status</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="service_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
  </classes>
  <menus>
    <menu id="ServiceManagement" xsi:type="MenuGroup" _delta="define">
      <rank>60</rank>
    </menu>
    <menu id="Service:Overview" xsi:type="DashboardMenuNode" _delta="define">
      <rank>0</rank>
      <parent>ServiceManagement</parent>
      <definition>
        <title>UI:ServiceMgmtMenuOverview:Title</title>
        <layout>DashboardLayoutTwoCols</layout>
        <cells>
          <cell id="1">
            <rank>1</rank>
            <dashlets>
              <dashlet id="1" xsi:type="DashletObjectList">
                <rank>1</rank>
                <title>UI-ServiceManagementOverview-CustomerContractToRenew</title>
                <query>SELECT CustomerContract AS c WHERE c.end_date &lt; DATE_ADD(NOW(), INTERVAL 30 DAY)</query>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="2">
            <rank>2</rank>
            <dashlets>
              <dashlet id="2" xsi:type="DashletObjectList">
                <rank>1</rank>
                <title>UI-ServiceManagementOverview-ProviderContractToRenew</title>
                <query>SELECT ProviderContract AS c WHERE c.end_date &lt; DATE_ADD(NOW(), INTERVAL 30 DAY)</query>
              </dashlet>
            </dashlets>
          </cell>
        </cells>
      </definition>
    </menu>
    <menu id="ProviderContract" xsi:type="OQLMenuNode" _delta="define">
      <rank>1</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT ProviderContract</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="CustomerContract" xsi:type="OQLMenuNode" _delta="define">
      <rank>2</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT CustomerContract</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="Service" xsi:type="OQLMenuNode" _delta="define">
      <rank>3</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT Service</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="ServiceSubcategory" xsi:type="OQLMenuNode" _delta="define">
      <rank>4</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT ServiceSubcategory</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="SLA" xsi:type="OQLMenuNode" _delta="define">
      <rank>5</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT SLA</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="SLT" xsi:type="OQLMenuNode" _delta="define">
      <rank>6</rank>
      <parent>ServiceManagement</parent>
      <oql>SELECT SLT</oql>
      <do_search>1</do_search>
    </menu>
  </menus>
</itop_design>
