<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
  <classes>
    <class id="Organization" _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,structure</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>organization</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <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="code" xsi:type="AttributeString">
          <sql>code</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="status" xsi:type="AttributeEnum">
          <values>
            <value>active</value>
            <value>inactive</value>
          </values>
          <sql>status</sql>
          <default_value>active</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="parent_id" xsi:type="AttributeHierarchicalKey">
          <sql>parent_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="parent_name" xsi:type="AttributeExternalField">
          <extkey_attcode>parent_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="code">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="parent_id">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="code">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="parent_id">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="parent_id">
              <rank>20</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Location" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,structure</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>location</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/location.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_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="status" xsi:type="AttributeEnum">
          <values>
            <value>active</value>
            <value>inactive</value>
          </values>
          <sql>status</sql>
          <default_value>active</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <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_MANUAL</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="address" xsi:type="AttributeText">
          <sql>address</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="postal_code" xsi:type="AttributeString">
          <sql>postal_code</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="city" xsi:type="AttributeString">
          <sql>city</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="country" xsi:type="AttributeString">
          <sql>country</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="parent_id" xsi:type="AttributeHierarchicalKey">
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>parent_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <filter><![CDATA[SELECT Location AS L WHERE L.org_id = :this->org_id]]></filter>
        </field>
        <field id="parent_name" xsi:type="AttributeExternalField">
          <extkey_attcode>parent_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contact_list" xsi:type="AttributeLinkedSet">
          <linked_class>Contact</linked_class>
          <ext_key_to_me>location_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
        <field id="infra_list" xsi:type="AttributeLinkedSet">
          <linked_class>InfrastructureCI</linked_class>
          <ext_key_to_me>location_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="address">
              <rank>40</rank>
            </item>
            <item id="postal_code">
              <rank>50</rank>
            </item>
            <item id="city">
              <rank>60</rank>
            </item>
            <item id="country">
              <rank>70</rank>
            </item>
            <item id="parent_id">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="infra_list">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="city">
              <rank>40</rank>
            </item>
            <item id="country">
              <rank>50</rank>
            </item>
            <item id="parent_id">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="city">
              <rank>30</rank>
            </item>
            <item id="country">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Contact" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,structure</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>contact</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>images/team.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
            <attribute id="email"/>
          </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="status" xsi:type="AttributeEnum">
          <values>
            <value>active</value>
            <value>inactive</value>
          </values>
          <sql>status</sql>
          <default_value>active</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <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_MANUAL</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="email" xsi:type="AttributeEmailAddress">
          <sql>email</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="phone" xsi:type="AttributeString">
          <sql>phone</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="location_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Location AS L WHERE L.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>location_id</sql>
          <target_class>Location</target_class>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="location_name" xsi:type="AttributeExternalField">
          <extkey_attcode>location_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="contract_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToContact</linked_class>
          <ext_key_to_me>contact_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>contract_id</ext_key_to_remote>
        </field>
        <field id="service_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkServiceToContact</linked_class>
          <ext_key_to_me>contact_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>service_id</ext_key_to_remote>
        </field>
        <field id="ticket_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkTicketToContact</linked_class>
          <ext_key_to_me>contact_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>ticket_id</ext_key_to_remote>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkCIToContact</linked_class>
          <ext_key_to_me>contact_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>
        <field id="team_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkTeamToContact</linked_class>
          <ext_key_to_me>contact_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>team_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="email">
              <rank>40</rank>
            </item>
            <item id="phone">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
            <item id="contract_list">
              <rank>70</rank>
            </item>
            <item id="service_list">
              <rank>80</rank>
            </item>
            <item id="ticket_list">
              <rank>90</rank>
            </item>
            <item id="ci_list">
              <rank>100</rank>
            </item>
            <item id="team_list">
              <rank>110</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="email">
              <rank>40</rank>
            </item>
            <item id="phone">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="finalclass">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="email">
              <rank>40</rank>
            </item>
            <item id="phone">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Person" _delta="define">
      <parent>Contact</parent>
      <properties>
        <category>bizmodel,searchable,structure</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>person</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="first_name"/>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/person.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="first_name"/>
            <attribute id="org_id"/>
            <attribute id="email"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="first_name" xsi:type="AttributeString">
          <sql>first_name</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="employee_id" xsi:type="AttributeString">
          <sql>employee_id</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="first_name">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="status">
              <rank>40</rank>
            </item>
            <item id="location_id">
              <rank>50</rank>
            </item>
            <item id="email">
              <rank>60</rank>
            </item>
            <item id="phone">
              <rank>70</rank>
            </item>
            <item id="employee_id">
              <rank>80</rank>
            </item>
            <item id="team_list">
              <rank>90</rank>
            </item>
            <item id="contract_list">
              <rank>100</rank>
            </item>
            <item id="service_list">
              <rank>110</rank>
            </item>
            <item id="ticket_list">
              <rank>120</rank>
            </item>
            <item id="ci_list">
              <rank>130</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="email">
              <rank>40</rank>
            </item>
            <item id="phone">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
            <item id="first_name">
              <rank>70</rank>
            </item>
            <item id="employee_id">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="first_name">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="org_id">
              <rank>40</rank>
            </item>
            <item id="email">
              <rank>50</rank>
            </item>
            <item id="phone">
              <rank>60</rank>
            </item>
            <item id="location_id">
              <rank>70</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Team" _delta="define">
      <parent>Contact</parent>
      <properties>
        <category>bizmodel,searchable,structure</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>team</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/team.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="member_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkTeamToContact</linked_class>
          <ext_key_to_me>team_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/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="location_id">
              <rank>40</rank>
            </item>
            <item id="email">
              <rank>50</rank>
            </item>
            <item id="phone">
              <rank>60</rank>
            </item>
            <item id="member_list">
              <rank>70</rank>
            </item>
            <item id="contract_list">
              <rank>80</rank>
            </item>
            <item id="service_list">
              <rank>90</rank>
            </item>
            <item id="ticket_list">
              <rank>100</rank>
            </item>
            <item id="ci_list">
              <rank>110</rank>
            </item>
            <item id="team_list">
              <rank>120</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="email">
              <rank>40</rank>
            </item>
            <item id="phone">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="email">
              <rank>30</rank>
            </item>
            <item id="phone">
              <rank>40</rank>
            </item>
            <item id="location_id">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkTeamToContact" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,searchable,structure</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkteamtocontact</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="team_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id=""/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="team_id" xsi:type="AttributeExternalKey">
          <sql>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="team_name" xsi:type="AttributeExternalField">
          <extkey_attcode>team_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_location_id" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>location_id</target_attcode>
        </field>
        <field id="contact_location_name" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>location_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="contact_phone" xsi:type="AttributeExternalField">
          <extkey_attcode>contact_id</extkey_attcode>
          <target_attcode>phone</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="team_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="role">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="team_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="role">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="team_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="contact_location_id">
              <rank>30</rank>
            </item>
            <item id="contact_email">
              <rank>40</rank>
            </item>
            <item id="contact_phone">
              <rank>50</rank>
            </item>
            <item id="role">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Document" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,documentation</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>document</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>images/document.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_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="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_MANUAL</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="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>contract</value>
            <value>networkmap</value>
            <value>presentation</value>
            <value>training</value>
            <value>whitePaper</value>
            <value>workinginstructions</value>
          </values>
          <sql>type</sql>
          <default_value>presentation</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="status" xsi:type="AttributeEnum">
          <values>
            <value>draft</value>
            <value>published</value>
            <value>obsolete</value>
          </values>
          <sql>status</sql>
          <default_value>draft</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="contract_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToDoc</linked_class>
          <ext_key_to_me>document_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>contract_id</ext_key_to_remote>
        </field>
        <field id="service_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkServiceToDoc</linked_class>
          <ext_key_to_me>document_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>service_id</ext_key_to_remote>
        </field>
        <field id="ticket_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkTicketToDoc</linked_class>
          <ext_key_to_me>document_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>ticket_id</ext_key_to_remote>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkCIToDoc</linked_class>
          <ext_key_to_me>document_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="org_id">
              <rank>20</rank>
            </item>
            <item id="description">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="contract_list">
              <rank>60</rank>
            </item>
            <item id="service_list">
              <rank>70</rank>
            </item>
            <item id="ticket_list">
              <rank>80</rank>
            </item>
            <item id="ci_list">
              <rank>90</rank>
            </item>
          </items>
        </details>
        <search>
          <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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="type">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="WebDoc" _delta="define">
      <parent>Document</parent>
      <properties>
        <category>bizmodel,searchable,documentation</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>externaldoc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/document.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="url" xsi:type="AttributeURL">
          <sql>url</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
          <target>_blank</target>
        </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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="contract_list">
              <rank>60</rank>
            </item>
            <item id="service_list">
              <rank>70</rank>
            </item>
            <item id="ticket_list">
              <rank>80</rank>
            </item>
            <item id="ci_list">
              <rank>90</rank>
            </item>
            <item id="url">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="url">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="type">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="url">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Note" _delta="define">
      <parent>Document</parent>
      <properties>
        <category>bizmodel,searchable,documentation</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>note</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/document.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="note" xsi:type="AttributeText">
          <sql>note</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="contract_list">
              <rank>60</rank>
            </item>
            <item id="service_list">
              <rank>70</rank>
            </item>
            <item id="ticket_list">
              <rank>80</rank>
            </item>
            <item id="ci_list">
              <rank>90</rank>
            </item>
            <item id="note">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="note">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="type">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="note">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="FileDoc" _delta="define">
      <parent>Document</parent>
      <properties>
        <category>bizmodel,searchable,documentation</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>filedoc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/document.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="contents" xsi:type="AttributeBlob"/>
      </fields>
      <methods>
        <method id="DisplayBareProperties">
          <comment>/**
	 * Overload the display of the properties to add a tab (the first one)
	 * with the preview of the document
	 */</comment>
          <static>false</static>
          <access>public</access>
          <type>Overload-cmdbAbstractObject</type>
          <code><![CDATA[	public function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
	{
		$aFieldsMap = parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
		if (!$bEditMode)
		{
			$oPage->add('<fieldset>');
			$oPage->add('<legend>'.Dict::S('Class:Document:PreviewTab').'</legend>');
			$oPage->add($this->DisplayDocumentInline($oPage, 'contents'));
			$oPage->add('</fieldset>');
		}
		return $aFieldsMap;
	}]]></code>
        </method>
      </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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
            <item id="contract_list">
              <rank>60</rank>
            </item>
            <item id="service_list">
              <rank>70</rank>
            </item>
            <item id="ticket_list">
              <rank>80</rank>
            </item>
            <item id="ci_list">
              <rank>90</rank>
            </item>
            <item id="contents">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <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="type">
              <rank>40</rank>
            </item>
            <item id="status">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="type">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
            <item id="contents">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Licence" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>licence</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/licence.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="provider" xsi:type="AttributeString">
          <sql>provider</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <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_MANUAL</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="product" xsi:type="AttributeString">
          <sql>product</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="name" xsi:type="AttributeString">
          <sql>name</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="start" xsi:type="AttributeDate">
          <sql>start</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="end" xsi:type="AttributeDate">
          <sql>end</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="licence_key" xsi:type="AttributeString">
          <sql>licence_key</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="scope" xsi:type="AttributeText">
          <sql>scope</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="usage_limit" xsi:type="AttributeInteger">
          <sql>usage_limit</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="usage_list" xsi:type="AttributeLinkedSet">
          <linked_class>SoftwareInstance</linked_class>
          <ext_key_to_me>licence_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="provider">
              <rank>30</rank>
            </item>
            <item id="product">
              <rank>40</rank>
            </item>
            <item id="start">
              <rank>50</rank>
            </item>
            <item id="end">
              <rank>60</rank>
            </item>
            <item id="licence_key">
              <rank>70</rank>
            </item>
            <item id="scope">
              <rank>80</rank>
            </item>
            <item id="usage_limit">
              <rank>90</rank>
            </item>
            <item id="usage_list">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="provider">
              <rank>20</rank>
            </item>
            <item id="product">
              <rank>30</rank>
            </item>
            <item id="name">
              <rank>40</rank>
            </item>
            <item id="start">
              <rank>50</rank>
            </item>
            <item id="end">
              <rank>60</rank>
            </item>
            <item id="licence_key">
              <rank>70</rank>
            </item>
            <item id="scope">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="provider">
              <rank>20</rank>
            </item>
            <item id="product">
              <rank>30</rank>
            </item>
            <item id="start">
              <rank>40</rank>
            </item>
            <item id="end">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Subnet" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>subnet</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="ip"/>
            <attribute id="ip_mask"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/subnet.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="ip"/>
            <attribute id="ip_mask"/>
            <attribute id="org_id"/>
            <attribute id="org_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <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_MANUAL</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="ip" xsi:type="AttributeIPAddress">
          <sql>ip</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="ip_mask" xsi:type="AttributeIPAddress">
          <sql>ip_mask</sql>
          <default_value/>
          <is_null_allowed>false</is_null_allowed>
        </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);

		if (!$bEditMode)
		{
			$oPage->SetCurrentTab(Dict::S('Class:Subnet/Tab:IPUsage'));
	
			$bit_ip = ip2long($this->Get('ip'));
			$bit_mask = ip2long($this->Get('ip_mask'));
	
			$iIPMin = sprintf('%u', ($bit_ip & $bit_mask) | 1); // exclude the first one: identifies the subnet itself
			$iIPMax = sprintf('%u', (($bit_ip | (~$bit_mask))) & 0xfffffffe); // exclude the last one : broadcast address
			
			$sIPMin = long2ip($iIPMin);
			$sIPMax = long2ip($iIPMax);
	
			$oPage->p(Dict::Format('Class:Subnet/Tab:IPUsage-explain', $sIPMin, $sIPMax));
			
			$oIfFilter = DBObjectSearch::FromOQL("SELECT NetworkInterface AS if WHERE INET_ATON(if.ip_address) >= INET_ATON('$sIPMin') AND INET_ATON(if.ip_address) <= INET_ATON('$sIPMax')");
			$oIfSet = new CMDBObjectSet($oIfFilter);
			$oBlock = new DisplayBlock($oIfFilter, 'list', false);
			$oBlock->Display($oPage, 'nwif', array('menu' => false));
	
			$iCountUsed = $oIfSet->Count();
			$iCountRange = $iIPMax - $iIPMin; // On 32-bit systems the substraction will be computed using floats for values greater than PHP_MAX_INT;
			$iFreeCount =  $iCountRange - $iCountUsed;
	
			$oPage->SetCurrentTab(Dict::S('Class:Subnet/Tab:FreeIPs'));
			$oPage->p(Dict::Format('Class:Subnet/Tab:FreeIPs-count', $iFreeCount));
			$oPage->p(Dict::S('Class:Subnet/Tab:FreeIPs-explain'));
	
			$aUsedIPs = $oIfSet->GetColumnAsArray('ip_address', false);
			$iAnIP = $iIPMin;
			$iFound = 0;
			while (($iFound < min($iFreeCount, 10)) && ($iAnIP <= $iIPMax))
			{
				$sAnIP = long2ip($iAnIP);
				if (!in_array($sAnIP, $aUsedIPs))
				{
					$iFound++;
					$oPage->p($sAnIP);
				}
				else
				{
				}
				$iAnIP++;
			}
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="ip">
              <rank>10</rank>
            </item>
            <item id="ip_mask">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="description">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="ip">
              <rank>10</rank>
            </item>
            <item id="ip_mask">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="description">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="ip">
              <rank>10</rank>
            </item>
            <item id="ip_mask">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Patch" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>patch</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/patch.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="target_sw" xsi:type="AttributeString">
          <sql>target_sw</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="version" xsi:type="AttributeString">
          <sql>version</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="type" xsi:type="AttributeEnum">
          <values>
            <value>application</value>
            <value>os</value>
            <value>security</value>
            <value>servicepack</value>
          </values>
          <sql>type</sql>
          <default_value>security</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkPatchToCI</linked_class>
          <ext_key_to_me>patch_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="target_sw">
              <rank>30</rank>
            </item>
            <item id="version">
              <rank>40</rank>
            </item>
            <item id="type">
              <rank>50</rank>
            </item>
            <item id="ci_list">
              <rank>60</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="target_sw">
              <rank>20</rank>
            </item>
            <item id="version">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
            <item id="description">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="target_sw">
              <rank>10</rank>
            </item>
            <item id="version">
              <rank>20</rank>
            </item>
            <item id="type">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Software" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>software</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>images/software.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>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="description">
              <rank>10</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Application" _delta="define">
      <parent>Software</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>software_app</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/software.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="instance_list" xsi:type="AttributeLinkedSet">
          <linked_class>ApplicationInstance</linked_class>
          <ext_key_to_me>software_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="instance_list">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="description">
              <rank>10</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="DBServer" _delta="define">
      <parent>Software</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>software_db</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/software.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="instance_list" xsi:type="AttributeLinkedSet">
          <linked_class>DBServerInstance</linked_class>
          <ext_key_to_me>software_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="instance_list">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="description">
              <rank>10</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkPatchToCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkpatchtoci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="patch_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="patch_id"/>
            <attribute id="ci_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="patch_id" xsi:type="AttributeExternalKey">
          <sql>patch_id</sql>
          <target_class>Patch</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="patch_name" xsi:type="AttributeExternalField">
          <extkey_attcode>patch_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_id" xsi:type="AttributeExternalKey">
          <sql>ci_id</sql>
          <target_class>Device</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="patch_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="patch_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="patch_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="FunctionalCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>functionalci</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>images/server.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="finalclass"/>
          </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="status" xsi:type="AttributeEnum">
          <values>
            <value>implementation</value>
            <value>production</value>
            <value>obsolete</value>
          </values>
          <sql>status</sql>
          <default_value>implementation</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <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_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="owner_name" xsi:type="AttributeExternalField">
          <extkey_attcode>org_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="importance" xsi:type="AttributeEnum">
          <values>
            <value>low</value>
            <value>medium</value>
            <value>high</value>
          </values>
          <sql>importance</sql>
          <default_value>medium</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="contact_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkCIToContact</linked_class>
          <ext_key_to_me>ci_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>lnkCIToDoc</linked_class>
          <ext_key_to_me>ci_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="solution_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkSolutionToCI</linked_class>
          <ext_key_to_me>ci_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>solution_id</ext_key_to_remote>
        </field>
        <field id="contract_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkContractToCI</linked_class>
          <ext_key_to_me>ci_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>contract_id</ext_key_to_remote>
        </field>
        <field id="ticket_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkTicketToCI</linked_class>
          <ext_key_to_me>ci_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>ticket_id</ext_key_to_remote>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
		case "impacts":
			$aRels = array(
				"contact" => array("sQuery"=>"SELECT Contact AS c JOIN lnkCIToContact AS l1 ON l1.contact_id = c.id WHERE l1.ci_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
				"solution" => array("sQuery"=>"SELECT ApplicationSolution AS s JOIN lnkSolutionToCI AS l1 ON l1.solution_id = s.id WHERE l1.ci_id = :this->id", "bPropagate"=>true, "iDistance"=>2),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
		default:
			return parent::GetRelationQueries($sRelCode);
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="contact_list">
              <rank>50</rank>
            </item>
            <item id="document_list">
              <rank>60</rank>
            </item>
            <item id="solution_list">
              <rank>70</rank>
            </item>
            <item id="contract_list">
              <rank>80</rank>
            </item>
            <item id="ticket_list">
              <rank>90</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="finalclass">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="SoftwareInstance" _delta="define">
      <parent>FunctionalCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>softwareinstance</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
            <attribute id="device_id_friendlyname"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/application.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="device_id"/>
            <attribute id="device_name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="finalclass"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="device_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Device WHERE org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>device_id</sql>
          <target_class>Device</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="device_name" xsi:type="AttributeExternalField">
          <extkey_attcode>device_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="licence_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Licence WHERE org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>licence_id</sql>
          <target_class>Licence</target_class>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="licence_name" xsi:type="AttributeExternalField">
          <extkey_attcode>licence_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="version" xsi:type="AttributeString">
          <sql>version</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>
      </fields>
      <methods>
        <method id="ComputeValues">
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code>	public function ComputeValues()
	{
	}</code>
        </method>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "impacts":
			$aRels = array(
				// Actually this should be limited to the Software instances based on a DBServer Application type...
				"db_instances" => array("sQuery"=>"SELECT DatabaseInstance AS db WHERE db.db_server_instance_id = :this->id", "bPropagate"=>true, "iDistance"=>5),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			case 'depends on':
			$aRels = array(
				"applications" => array("sQuery"=>"SELECT Device JOIN SoftwareInstance AS app ON app.device_id = Device.id WHERE app.id = :this->id", "bPropagate"=>true, "iDistance"=>5),			
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="device_id">
              <rank>50</rank>
            </item>
            <item id="licence_id">
              <rank>60</rank>
            </item>
            <item id="version">
              <rank>70</rank>
            </item>
            <item id="description">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="solution_list">
              <rank>110</rank>
            </item>
            <item id="contract_list">
              <rank>120</rank>
            </item>
            <item id="ticket_list">
              <rank>130</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="licence_id">
              <rank>50</rank>
            </item>
            <item id="version">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="finalclass">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="device_id">
              <rank>50</rank>
            </item>
            <item id="version">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="DBServerInstance" _delta="define">
      <parent>SoftwareInstance</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>softwareinstance_dbserver</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
            <attribute id="device_id_friendlyname"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/database.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="software_id"/>
            <attribute id="software_name"/>
            <attribute id="device_id"/>
            <attribute id="device_name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="software_id" xsi:type="AttributeExternalKey">
          <sql>software_id</sql>
          <target_class>DBServer</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="software_name" xsi:type="AttributeExternalField">
          <extkey_attcode>software_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="dbinstance_list" xsi:type="AttributeLinkedSet">
          <linked_class>DatabaseInstance</linked_class>
          <ext_key_to_me>db_server_instance_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="device_id">
              <rank>50</rank>
            </item>
            <item id="licence_id">
              <rank>60</rank>
            </item>
            <item id="software_id">
              <rank>70</rank>
            </item>
            <item id="version">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="contact_list">
              <rank>100</rank>
            </item>
            <item id="document_list">
              <rank>110</rank>
            </item>
            <item id="solution_list">
              <rank>120</rank>
            </item>
            <item id="contract_list">
              <rank>130</rank>
            </item>
            <item id="ticket_list">
              <rank>140</rank>
            </item>
            <item id="dbinstance_list">
              <rank>150</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="licence_id">
              <rank>50</rank>
            </item>
            <item id="software_id">
              <rank>60</rank>
            </item>
            <item id="version">
              <rank>70</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="software_id">
              <rank>50</rank>
            </item>
            <item id="version">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="ApplicationInstance" _delta="define">
      <parent>SoftwareInstance</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>softwareinstance_application</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
            <attribute id="device_id_friendlyname"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/application.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="software_id"/>
            <attribute id="software_name"/>
            <attribute id="device_id"/>
            <attribute id="device_name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="software_id" xsi:type="AttributeExternalKey">
          <sql>software_id</sql>
          <target_class>Application</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="software_name" xsi:type="AttributeExternalField">
          <extkey_attcode>software_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="device_id">
              <rank>50</rank>
            </item>
            <item id="licence_id">
              <rank>60</rank>
            </item>
            <item id="software_id">
              <rank>70</rank>
            </item>
            <item id="version">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="contact_list">
              <rank>100</rank>
            </item>
            <item id="document_list">
              <rank>110</rank>
            </item>
            <item id="solution_list">
              <rank>120</rank>
            </item>
            <item id="contract_list">
              <rank>130</rank>
            </item>
            <item id="ticket_list">
              <rank>140</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="licence_id">
              <rank>50</rank>
            </item>
            <item id="software_id">
              <rank>60</rank>
            </item>
            <item id="version">
              <rank>70</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="software_id">
              <rank>50</rank>
            </item>
            <item id="version">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="DatabaseInstance" _delta="define">
      <parent>FunctionalCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>databaseinstance</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
            <attribute id="db_server_instance_id_friendlyname"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/database-instance.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="db_server_instance_id"/>
            <attribute id="db_server_instance_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="db_server_instance_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT DBServerInstance WHERE org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>db_server_instance_id</sql>
          <target_class>DBServerInstance</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="db_server_instance_name" xsi:type="AttributeExternalField">
          <extkey_attcode>db_server_instance_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="db_server_instance_version" xsi:type="AttributeExternalField">
          <extkey_attcode>db_server_instance_id</extkey_attcode>
          <target_attcode>version</target_attcode>
        </field>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "depends on":
			$aRels = array(
				"db_instances" => array("sQuery"=>"SELECT DBServerInstance AS db_server_inst JOIN DatabaseInstance AS db ON  db.db_server_instance_id = db_server_inst.id WHERE db.id = :this->id", "bPropagate"=>true, "iDistance"=>5),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
						
			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="db_server_instance_id">
              <rank>50</rank>
            </item>
            <item id="db_server_instance_version">
              <rank>60</rank>
            </item>
            <item id="description">
              <rank>70</rank>
            </item>
            <item id="contact_list">
              <rank>80</rank>
            </item>
            <item id="document_list">
              <rank>90</rank>
            </item>
            <item id="solution_list">
              <rank>100</rank>
            </item>
            <item id="contract_list">
              <rank>110</rank>
            </item>
            <item id="ticket_list">
              <rank>120</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="db_server_instance_id">
              <rank>50</rank>
            </item>
            <item id="db_server_instance_version">
              <rank>60</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="db_server_instance_id">
              <rank>40</rank>
            </item>
            <item id="db_server_instance_version">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="ApplicationSolution" _delta="define">
      <parent>FunctionalCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>applicationsolution</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/solution.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkSolutionToCI</linked_class>
          <ext_key_to_me>solution_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>
        <field id="process_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkProcessToSolution</linked_class>
          <ext_key_to_me>solution_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>process_id</ext_key_to_remote>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "impacts":
			$aRels = array(
				"process" => array("sQuery"=>"SELECT BusinessProcess AS p JOIN lnkProcessToSolution AS l1 ON l1.process_id = p.id WHERE l1.solution_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			case "depends on":
			$aRels = array(
				"solution" => array("sQuery"=>"SELECT FunctionalCI AS ci JOIN lnkSolutionToCI AS l1 ON l1.ci_id = ci.id WHERE l1.solution_id = :this->id", "bPropagate"=>true, "iDistance"=>2),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
						
			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="description">
              <rank>50</rank>
            </item>
            <item id="contact_list">
              <rank>60</rank>
            </item>
            <item id="document_list">
              <rank>70</rank>
            </item>
            <item id="solution_list">
              <rank>80</rank>
            </item>
            <item id="contract_list">
              <rank>90</rank>
            </item>
            <item id="ticket_list">
              <rank>100</rank>
            </item>
            <item id="ci_list">
              <rank>110</rank>
            </item>
            <item id="process_list">
              <rank>120</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="BusinessProcess" _delta="define">
      <parent>FunctionalCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>businessprocess</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/business-process.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="used_solution_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkProcessToSolution</linked_class>
          <ext_key_to_me>process_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>solution_id</ext_key_to_remote>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "depends on":
			$aRels = array(
				"solution" => array("sQuery"=>"SELECT ApplicationSolution AS app JOIN lnkProcessToSolution AS l1 ON l1.solution_id = app.id WHERE l1.process_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="description">
              <rank>50</rank>
            </item>
            <item id="contact_list">
              <rank>60</rank>
            </item>
            <item id="document_list">
              <rank>70</rank>
            </item>
            <item id="contract_list">
              <rank>80</rank>
            </item>
            <item id="ticket_list">
              <rank>90</rank>
            </item>
            <item id="used_solution_list">
              <rank>100</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="description">
              <rank>50</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="ConnectableCI" _delta="define">
      <parent>FunctionalCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>connectableci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/server.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="finalclass"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="brand" xsi:type="AttributeString">
          <sql>brand</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="model" xsi:type="AttributeString">
          <sql>model</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="serial_number" xsi:type="AttributeString">
          <sql>serial_number</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="asset_ref" xsi:type="AttributeString">
          <sql>asset_ref</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="solution_list">
              <rank>110</rank>
            </item>
            <item id="contract_list">
              <rank>120</rank>
            </item>
            <item id="ticket_list">
              <rank>130</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="finalclass">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="NetworkInterface" _delta="define">
      <parent>ConnectableCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>networkinterface</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="device_id_friendlyname"/>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/interface.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="device_id"/>
            <attribute id="device_name"/>
            <attribute id="org_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="device_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Device WHERE org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>device_id</sql>
          <target_class>Device</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="device_name" xsi:type="AttributeExternalField">
          <extkey_attcode>device_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="logical_type" xsi:type="AttributeEnum">
          <values>
            <value>backup</value>
            <value>logical</value>
            <value>port</value>
            <value>primary</value>
            <value>secondary</value>
          </values>
          <sql>logical_type</sql>
          <default_value>primary</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="physical_type" xsi:type="AttributeEnum">
          <values>
            <value>atm</value>
            <value>ethernet</value>
            <value>framerelay</value>
            <value>vlan</value>
          </values>
          <sql>physical_type</sql>
          <default_value>ethernet</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="ip_address" xsi:type="AttributeIPAddress">
          <sql>ip_address</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ip_mask" xsi:type="AttributeIPAddress">
          <sql>ip_mask</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="mac_address" xsi:type="AttributeString">
          <sql>mac_address</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="speed" xsi:type="AttributeInteger">
          <sql>speed</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="duplex" xsi:type="AttributeEnum">
          <values>
            <value>full</value>
            <value>half</value>
            <value>auto</value>
            <value>unknown</value>
          </values>
          <sql>duplex</sql>
          <default_value>full</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="connected_if" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT NetworkInterface WHERE org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>connected_if</sql>
          <target_class>NetworkInterface</target_class>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="connected_name" xsi:type="AttributeExternalField">
          <extkey_attcode>connected_if</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="connected_if_device_id" xsi:type="AttributeExternalField">
          <extkey_attcode>connected_if</extkey_attcode>
          <target_attcode>device_id</target_attcode>
        </field>
        <field id="connected_if_device_id_name" xsi:type="AttributeExternalField">
          <extkey_attcode>connected_if</extkey_attcode>
          <target_attcode>device_name</target_attcode>
        </field>
        <field id="link_type" xsi:type="AttributeEnum">
          <values>
            <value>uplink</value>
            <value>downlink</value>
          </values>
          <sql>link_type</sql>
          <default_value>uplink</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <field id="connected_if_device_id_friendlyname" xsi:type="AttributeExternalField">
          <extkey_attcode>connected_if</extkey_attcode>
          <target_attcode>device_id_friendlyname</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "impacts":
			$aRels = array(
				"connected_devices" => array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.id = :this->id AND if2.link_type='downlink'", "bPropagate"=>true, "iDistance"=>5),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
        <method id="UpdateConnectedInterface">
          <static>false</static>
          <access>protected</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	protected function UpdateConnectedInterface()
	{
		$iPrevTargetIf = $this->m_aOrigValues['connected_if']; // The interface this interface was connected to
		if ($iPrevTargetIf == $this->Get('connected_if'))
		{
			return;
		}
 			
		if ($iPrevTargetIf != 0)
		{
			// The interface was previosuly connected to another interface. Make sure that we reset this 'previously connected interface'
			$oPrevConnectedIf = MetaModel::GetObject('NetworkInterface', $iPrevTargetIf, false);
			if (!is_null($oPrevConnectedIf))
			{
				if ($oPrevConnectedIf->Get('connected_if') == $this->GetKey()) // protection against reentrance
				{
					$oPrevConnectedIf->Set('connected_if', 0);			
					$oPrevConnectedIf->DBUpdate();
				}
			}
		}

		$oConnIf = MetaModel::GetObject('NetworkInterface', $this->Get('connected_if'), false /* no exception if not found */);
		if (!is_null($oConnIf))
		{
			$sLink = $this->Get('link_type');
			$sConnLink = ($sLink == 'uplink') ? 'downlink' : 'uplink';
  
 			if (($oConnIf->Get('connected_if') != $this->GetKey()) || ($sConnLink != $oConnIf->Get('link_type')))
			{
				// Connect the remote interface to the current one
				$oConnIf->Set('connected_if', $this->GetKey());
				$oConnIf->Set('link_type', $sConnLink);

				// Need to backup the current change, because it is reset when DBUpdateTracked is complete
				$oConnIf->DBUpdate();
			}
		}
	}]]></code>
        </method>
        <method id="AfterInsert">
          <static>false</static>
          <access>protected</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	protected function AfterInsert()
	{
		$this->UpdateConnectedInterface();
		parent::AfterInsert();
	}]]></code>
        </method>
        <method id="AfterUpdate">
          <static>false</static>
          <access>protected</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	protected function AfterUpdate()
	{
		$this->UpdateConnectedInterface();
		parent::AfterUpdate();
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="device_id">
              <rank>90</rank>
            </item>
            <item id="logical_type">
              <rank>100</rank>
            </item>
            <item id="physical_type">
              <rank>110</rank>
            </item>
            <item id="ip_address">
              <rank>120</rank>
            </item>
            <item id="ip_mask">
              <rank>130</rank>
            </item>
            <item id="mac_address">
              <rank>140</rank>
            </item>
            <item id="speed">
              <rank>150</rank>
            </item>
            <item id="duplex">
              <rank>160</rank>
            </item>
            <item id="link_type">
              <rank>170</rank>
            </item>
            <item id="connected_if">
              <rank>180</rank>
            </item>
            <item id="connected_if_device_id">
              <rank>190</rank>
            </item>
            <item id="contact_list">
              <rank>200</rank>
            </item>
            <item id="document_list">
              <rank>210</rank>
            </item>
            <item id="solution_list">
              <rank>220</rank>
            </item>
            <item id="contract_list">
              <rank>230</rank>
            </item>
            <item id="ticket_list">
              <rank>240</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="device_id">
              <rank>50</rank>
            </item>
            <item id="logical_type">
              <rank>60</rank>
            </item>
            <item id="physical_type">
              <rank>70</rank>
            </item>
            <item id="ip_address">
              <rank>80</rank>
            </item>
            <item id="ip_mask">
              <rank>90</rank>
            </item>
            <item id="mac_address">
              <rank>100</rank>
            </item>
            <item id="connected_if_device_id">
              <rank>110</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="ip_address">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="device_id">
              <rank>40</rank>
            </item>
            <item id="logical_type">
              <rank>50</rank>
            </item>
            <item id="physical_type">
              <rank>60</rank>
            </item>
            <item id="link_type">
              <rank>70</rank>
            </item>
            <item id="connected_if_device_id">
              <rank>80</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Device" _delta="define">
      <parent>ConnectableCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>device</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/server.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="nwinterface_list" xsi:type="AttributeLinkedSet">
          <linked_class>NetworkInterface</linked_class>
          <ext_key_to_me>device_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
      </fields>
      <methods>
        <method id="GetRelationQueries">
          <static>true</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public static function GetRelationQueries($sRelCode)
	{
		switch ($sRelCode)
		{
			case "impacts":
			$aRels = array(
				"applications" => array("sQuery"=>"SELECT SoftwareInstance AS app WHERE app.device_id = :this->id", "bPropagate"=>true, "iDistance"=>5),
				"connected_devices" => array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='downlink'", "bPropagate"=>true, "iDistance"=>5),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;
			
			case "depends on":
			$aRels = array(
				"connected_devices" => array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='uplink'", "bPropagate"=>true, "iDistance"=>5),
			);
			return array_merge($aRels, parent::GetRelationQueries($sRelCode));
			break;

			default:
			return parent::GetRelationQueries($sRelCode);			
		}
	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="solution_list">
              <rank>110</rank>
            </item>
            <item id="contract_list">
              <rank>120</rank>
            </item>
            <item id="ticket_list">
              <rank>130</rank>
            </item>
            <item id="nwinterface_list">
              <rank>140</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="finalclass">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="PC" _delta="define">
      <parent>Device</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>pc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/laptop.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="cpu" xsi:type="AttributeString">
          <sql>cpu</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ram" xsi:type="AttributeString">
          <sql>ram</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="hdd" xsi:type="AttributeString">
          <sql>hdd</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="os_family" xsi:type="AttributeString">
          <sql>os_family</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="os_version" xsi:type="AttributeString">
          <sql>os_version</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="application_list" xsi:type="AttributeLinkedSet">
          <linked_class>SoftwareInstance</linked_class>
          <ext_key_to_me>device_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
        <field id="patch_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkPatchToCI</linked_class>
          <ext_key_to_me>ci_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>patch_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="cpu">
              <rank>90</rank>
            </item>
            <item id="ram">
              <rank>100</rank>
            </item>
            <item id="hdd">
              <rank>110</rank>
            </item>
            <item id="os_family">
              <rank>120</rank>
            </item>
            <item id="os_version">
              <rank>130</rank>
            </item>
            <item id="contact_list">
              <rank>140</rank>
            </item>
            <item id="document_list">
              <rank>150</rank>
            </item>
            <item id="solution_list">
              <rank>160</rank>
            </item>
            <item id="contract_list">
              <rank>170</rank>
            </item>
            <item id="ticket_list">
              <rank>180</rank>
            </item>
            <item id="nwinterface_list">
              <rank>190</rank>
            </item>
            <item id="application_list">
              <rank>200</rank>
            </item>
            <item id="patch_list">
              <rank>210</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="os_family">
              <rank>90</rank>
            </item>
            <item id="os_version">
              <rank>100</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
            <item id="os_family">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="MobileCI" _delta="define">
      <parent>Device</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>mobileci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/mobile-phone.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields/>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="contact_list">
              <rank>90</rank>
            </item>
            <item id="document_list">
              <rank>100</rank>
            </item>
            <item id="solution_list">
              <rank>110</rank>
            </item>
            <item id="contract_list">
              <rank>120</rank>
            </item>
            <item id="ticket_list">
              <rank>130</rank>
            </item>
            <item id="nwinterface_list">
              <rank>140</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="MobilePhone" _delta="define">
      <parent>MobileCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>mobilephone</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/mobile-phone.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="number" xsi:type="AttributeString">
          <sql>number</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="imei" xsi:type="AttributeString">
          <sql>IMIE</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="hw_pin" xsi:type="AttributeString">
          <sql>hw_pin</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="number">
              <rank>90</rank>
            </item>
            <item id="imei">
              <rank>100</rank>
            </item>
            <item id="hw_pin">
              <rank>110</rank>
            </item>
            <item id="contact_list">
              <rank>120</rank>
            </item>
            <item id="document_list">
              <rank>130</rank>
            </item>
            <item id="solution_list">
              <rank>140</rank>
            </item>
            <item id="contract_list">
              <rank>150</rank>
            </item>
            <item id="ticket_list">
              <rank>160</rank>
            </item>
            <item id="nwinterface_list">
              <rank>170</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="number">
              <rank>90</rank>
            </item>
            <item id="imei">
              <rank>100</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="InfrastructureCI" _delta="define">
      <parent>Device</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>infrastructureci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/server.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="location_id"/>
            <attribute id="location_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="description" xsi:type="AttributeText">
          <sql>description</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="location_id" xsi:type="AttributeExternalKey">
          <filter><![CDATA[SELECT Location AS l WHERE l.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>location_id</sql>
          <target_class>Location</target_class>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="location_name" xsi:type="AttributeExternalField">
          <extkey_attcode>location_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="location_details" xsi:type="AttributeText">
          <sql>location_details</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="management_ip" xsi:type="AttributeIPAddress">
          <sql>management_ip</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="default_gateway" xsi:type="AttributeString">
          <sql>default_gateway</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="location_id">
              <rank>100</rank>
            </item>
            <item id="location_details">
              <rank>110</rank>
            </item>
            <item id="management_ip">
              <rank>120</rank>
            </item>
            <item id="default_gateway">
              <rank>130</rank>
            </item>
            <item id="contact_list">
              <rank>140</rank>
            </item>
            <item id="document_list">
              <rank>150</rank>
            </item>
            <item id="solution_list">
              <rank>160</rank>
            </item>
            <item id="contract_list">
              <rank>170</rank>
            </item>
            <item id="ticket_list">
              <rank>180</rank>
            </item>
            <item id="nwinterface_list">
              <rank>190</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="location_id">
              <rank>90</rank>
            </item>
            <item id="management_ip">
              <rank>100</rank>
            </item>
            <item id="default_gateway">
              <rank>110</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="NetworkDevice" _delta="define">
      <parent>InfrastructureCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>networkdevice</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/switch.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="location_id"/>
            <attribute id="location_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="type" xsi:type="AttributeEnum">
          <values>
            <value>wanaccelerator</value>
            <value>firewall</value>
            <value>hub</value>
            <value>loadbalancer</value>
            <value>router</value>
            <value>switch</value>
          </values>
          <sql>type</sql>
          <default_value>switch</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ios_version" xsi:type="AttributeString">
          <sql>ios_version</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ram" xsi:type="AttributeString">
          <sql>ram</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="snmp_read" xsi:type="AttributeString">
          <sql>snmp_read</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="snmp_write" xsi:type="AttributeString">
          <sql>snmp_write</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="location_id">
              <rank>100</rank>
            </item>
            <item id="location_details">
              <rank>110</rank>
            </item>
            <item id="management_ip">
              <rank>120</rank>
            </item>
            <item id="default_gateway">
              <rank>130</rank>
            </item>
            <item id="type">
              <rank>140</rank>
            </item>
            <item id="ios_version">
              <rank>150</rank>
            </item>
            <item id="ram">
              <rank>160</rank>
            </item>
            <item id="snmp_read">
              <rank>170</rank>
            </item>
            <item id="snmp_write">
              <rank>180</rank>
            </item>
            <item id="contact_list">
              <rank>190</rank>
            </item>
            <item id="document_list">
              <rank>200</rank>
            </item>
            <item id="solution_list">
              <rank>210</rank>
            </item>
            <item id="contract_list">
              <rank>220</rank>
            </item>
            <item id="ticket_list">
              <rank>230</rank>
            </item>
            <item id="nwinterface_list">
              <rank>240</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="location_id">
              <rank>90</rank>
            </item>
            <item id="management_ip">
              <rank>100</rank>
            </item>
            <item id="default_gateway">
              <rank>110</rank>
            </item>
            <item id="type">
              <rank>120</rank>
            </item>
            <item id="ios_version">
              <rank>130</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
            <item id="type">
              <rank>70</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Server" _delta="define">
      <parent>InfrastructureCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>server</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/server.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="location_id"/>
            <attribute id="location_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="cpu" xsi:type="AttributeString">
          <sql>cpu</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="ram" xsi:type="AttributeString">
          <sql>ram</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="hdd" xsi:type="AttributeString">
          <sql>hdd</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="os_family" xsi:type="AttributeString">
          <sql>os_family</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="os_version" xsi:type="AttributeString">
          <sql>os_version</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="application_list" xsi:type="AttributeLinkedSet">
          <linked_class>SoftwareInstance</linked_class>
          <ext_key_to_me>device_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
        <field id="patch_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkPatchToCI</linked_class>
          <ext_key_to_me>ci_id</ext_key_to_me>
          <count_min>0</count_min>
          <count_max>0</count_max>
          <ext_key_to_remote>patch_id</ext_key_to_remote>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="location_id">
              <rank>100</rank>
            </item>
            <item id="location_details">
              <rank>110</rank>
            </item>
            <item id="management_ip">
              <rank>120</rank>
            </item>
            <item id="default_gateway">
              <rank>130</rank>
            </item>
            <item id="cpu">
              <rank>140</rank>
            </item>
            <item id="ram">
              <rank>150</rank>
            </item>
            <item id="hdd">
              <rank>160</rank>
            </item>
            <item id="os_family">
              <rank>170</rank>
            </item>
            <item id="os_version">
              <rank>180</rank>
            </item>
            <item id="contact_list">
              <rank>190</rank>
            </item>
            <item id="document_list">
              <rank>200</rank>
            </item>
            <item id="solution_list">
              <rank>210</rank>
            </item>
            <item id="contract_list">
              <rank>220</rank>
            </item>
            <item id="ticket_list">
              <rank>230</rank>
            </item>
            <item id="nwinterface_list">
              <rank>240</rank>
            </item>
            <item id="application_list">
              <rank>250</rank>
            </item>
            <item id="patch_list">
              <rank>260</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="location_id">
              <rank>90</rank>
            </item>
            <item id="management_ip">
              <rank>100</rank>
            </item>
            <item id="default_gateway">
              <rank>110</rank>
            </item>
            <item id="os_family">
              <rank>120</rank>
            </item>
            <item id="os_version">
              <rank>130</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
            <item id="location_id">
              <rank>60</rank>
            </item>
            <item id="os_family">
              <rank>70</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Printer" _delta="define">
      <parent>InfrastructureCI</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>printer</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/printer.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_name"/>
            <attribute id="location_id"/>
            <attribute id="location_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="type" xsi:type="AttributeEnum">
          <values>
            <value>mopier</value>
            <value>printer</value>
          </values>
          <sql>type</sql>
          <default_value>printer</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="technology" xsi:type="AttributeEnum">
          <values>
            <value>laser</value>
            <value>inkjet</value>
            <value>tracer</value>
          </values>
          <sql>technology</sql>
          <default_value>laser</default_value>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="location_id">
              <rank>100</rank>
            </item>
            <item id="location_details">
              <rank>110</rank>
            </item>
            <item id="management_ip">
              <rank>120</rank>
            </item>
            <item id="default_gateway">
              <rank>130</rank>
            </item>
            <item id="type">
              <rank>140</rank>
            </item>
            <item id="technology">
              <rank>150</rank>
            </item>
            <item id="contact_list">
              <rank>160</rank>
            </item>
            <item id="document_list">
              <rank>170</rank>
            </item>
            <item id="solution_list">
              <rank>180</rank>
            </item>
            <item id="contract_list">
              <rank>190</rank>
            </item>
            <item id="ticket_list">
              <rank>200</rank>
            </item>
            <item id="nwinterface_list">
              <rank>210</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="importance">
              <rank>40</rank>
            </item>
            <item id="brand">
              <rank>50</rank>
            </item>
            <item id="model">
              <rank>60</rank>
            </item>
            <item id="serial_number">
              <rank>70</rank>
            </item>
            <item id="asset_ref">
              <rank>80</rank>
            </item>
            <item id="description">
              <rank>90</rank>
            </item>
            <item id="location_id">
              <rank>100</rank>
            </item>
            <item id="location_details">
              <rank>110</rank>
            </item>
            <item id="management_ip">
              <rank>120</rank>
            </item>
            <item id="default_gateway">
              <rank>130</rank>
            </item>
            <item id="type">
              <rank>140</rank>
            </item>
            <item id="technology">
              <rank>150</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="importance">
              <rank>30</rank>
            </item>
            <item id="brand">
              <rank>40</rank>
            </item>
            <item id="model">
              <rank>50</rank>
            </item>
            <item id="serial_number">
              <rank>60</rank>
            </item>
            <item id="asset_ref">
              <rank>70</rank>
            </item>
            <item id="location_id">
              <rank>80</rank>
            </item>
            <item id="management_ip">
              <rank>90</rank>
            </item>
            <item id="default_gateway">
              <rank>100</rank>
            </item>
            <item id="type">
              <rank>110</rank>
            </item>
            <item id="technology">
              <rank>120</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="Group" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>group</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="name"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/group.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="name"/>
            <attribute id="org_id"/>
            <attribute id="owner_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="status" xsi:type="AttributeEnum">
          <values>
            <value>production</value>
            <value>implementation</value>
            <value>obsolete</value>
          </values>
          <sql>status</sql>
          <default_value>implementation</default_value>
          <is_null_allowed>false</is_null_allowed>
        </field>
        <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_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="owner_name" xsi:type="AttributeExternalField">
          <extkey_attcode>org_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </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="AttributeString">
          <sql>type</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="parent_id" xsi:type="AttributeHierarchicalKey">
          <dependencies>
            <attribute id="org_id"/>
          </dependencies>
          <sql>parent_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="parent_name" xsi:type="AttributeExternalField">
          <extkey_attcode>parent_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="ci_list" xsi:type="AttributeLinkedSetIndirect">
          <linked_class>lnkGroupToCI</linked_class>
          <ext_key_to_me>group_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="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
            <item id="description">
              <rank>50</rank>
            </item>
            <item id="parent_id">
              <rank>60</rank>
            </item>
            <item id="ci_list">
              <rank>70</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="org_id">
              <rank>30</rank>
            </item>
            <item id="type">
              <rank>40</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="type">
              <rank>30</rank>
            </item>
            <item id="parent_id">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkGroupToCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkgrouptoci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="group_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="group_id"/>
            <attribute id="ci_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="group_id" xsi:type="AttributeExternalKey">
          <sql>group_id</sql>
          <target_class>Group</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_MANUAL</on_target_delete>
          <jointype/>
        </field>
        <field id="group_name" xsi:type="AttributeExternalField">
          <extkey_attcode>group_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_MANUAL</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>
        <field id="reason" xsi:type="AttributeString">
          <sql>reason</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="group_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
            <item id="reason">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="group_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="reason">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="group_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
            <item id="reason">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkCIToDoc" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcitodoc</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="ci_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="ci_id"/>
            <attribute id="document_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <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>
        <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="ci_id">
              <rank>10</rank>
            </item>
            <item id="ci_status">
              <rank>20</rank>
            </item>
            <item id="document_id">
              <rank>30</rank>
            </item>
            <item id="document_type">
              <rank>40</rank>
            </item>
            <item id="document_status">
              <rank>50</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="ci_id">
              <rank>10</rank>
            </item>
            <item id="document_id">
              <rank>20</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="ci_id">
              <rank>10</rank>
            </item>
            <item id="ci_status">
              <rank>20</rank>
            </item>
            <item id="document_id">
              <rank>30</rank>
            </item>
            <item id="document_type">
              <rank>40</rank>
            </item>
            <item id="document_status">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkCIToContact" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkcitocontact</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="ci_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/contact.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="ci_id"/>
            <attribute id="contact_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <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>
        <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="ci_id">
              <rank>10</rank>
            </item>
            <item id="ci_status">
              <rank>20</rank>
            </item>
            <item id="contact_id">
              <rank>30</rank>
            </item>
            <item id="contact_email">
              <rank>40</rank>
            </item>
            <item id="role">
              <rank>50</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="ci_id">
              <rank>10</rank>
            </item>
            <item id="contact_id">
              <rank>20</rank>
            </item>
            <item id="role">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="ci_id">
              <rank>10</rank>
            </item>
            <item id="ci_status">
              <rank>20</rank>
            </item>
            <item id="contact_id">
              <rank>30</rank>
            </item>
            <item id="contact_email">
              <rank>40</rank>
            </item>
            <item id="role">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkSolutionToCI" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnksolutiontoci</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="solution_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="solution_id"/>
            <attribute id="ci_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="solution_id" xsi:type="AttributeExternalKey">
          <sql>solution_id</sql>
          <target_class>ApplicationSolution</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="solution_name" xsi:type="AttributeExternalField">
          <extkey_attcode>solution_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>
        <field id="utility" xsi:type="AttributeString">
          <sql>utility</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
            <item id="utility">
              <rank>40</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="utility">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="ci_id">
              <rank>20</rank>
            </item>
            <item id="ci_status">
              <rank>30</rank>
            </item>
            <item id="utility">
              <rank>40</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    <class id="lnkProcessToSolution" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <is_link>1</is_link>
        <category>bizmodel,configmgmt</category>
        <abstract>false</abstract>
        <key_type>autoincrement</key_type>
        <db_table>lnkprocesstosolution</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field/>
        <naming>
          <attributes>
            <attribute id="solution_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon/>
        <reconciliation>
          <attributes>
            <attribute id="solution_id"/>
            <attribute id="process_id"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="solution_id" xsi:type="AttributeExternalKey">
          <sql>solution_id</sql>
          <target_class>ApplicationSolution</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="solution_name" xsi:type="AttributeExternalField">
          <extkey_attcode>solution_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="process_id" xsi:type="AttributeExternalKey">
          <sql>process_id</sql>
          <target_class>BusinessProcess</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
          <jointype/>
        </field>
        <field id="process_name" xsi:type="AttributeExternalField">
          <extkey_attcode>process_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="reason" xsi:type="AttributeString">
          <sql>reason</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="process_id">
              <rank>20</rank>
            </item>
            <item id="reason">
              <rank>30</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="process_id">
              <rank>20</rank>
            </item>
            <item id="reason">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="solution_id">
              <rank>10</rank>
            </item>
            <item id="process_id">
              <rank>20</rank>
            </item>
            <item id="reason">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
  </classes>
  <menus>
    <menu id="DataAdministration" xsi:type="MenuGroup" _delta="define">
      <rank>70</rank>
      <enable_class>Organization</enable_class>
      <enable_action>UR_ACTION_MODIFY</enable_action>
      <enable_permission>UR_ALLOWED_YES</enable_permission>
      <enable_stimulus/>
    </menu>
    <menu id="Audit" xsi:type="WebPageMenuNode" _delta="define">
      <rank>33</rank>
      <parent>DataAdministration</parent>
      <url>$pages/audit.php</url>
    </menu>
    <menu id="Catalogs" xsi:type="TemplateMenuNode" _delta="define">
      <rank>50</rank>
      <parent>DataAdministration</parent>
      <template_file/>
    </menu>
    <menu id="Organization" xsi:type="OQLMenuNode" _delta="define">
      <rank>10</rank>
      <parent>Catalogs</parent>
      <oql>SELECT Organization</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="Application" xsi:type="OQLMenuNode" _delta="define">
      <rank>20</rank>
      <parent>Catalogs</parent>
      <oql>SELECT Application</oql>
      <do_search/>
    </menu>
    <menu id="DBServer" xsi:type="OQLMenuNode" _delta="define">
      <rank>40</rank>
      <parent>Catalogs</parent>
      <oql>SELECT DBServer</oql>
      <do_search/>
    </menu>
    <menu id="ConfigManagement" xsi:type="MenuGroup" _delta="define">
      <rank>20</rank>
    </menu>
    <menu id="ConfigManagementOverview" xsi:type="DashboardMenuNode" _delta="define">
      <rank>0</rank>
      <parent>ConfigManagement</parent>
      <definition>
        <title>UI:ConfigMgmtMenuOverview:Title</title>
        <layout>DashboardLayoutTwoCols</layout>
        <cells>
          <cell id="0">
            <rank>0</rank>
            <dashlets>
              <dashlet id="1" xsi:type="DashletGroupByPie">
                <rank>0</rank>
                <title>UI-ConfigMgmtMenuOverview-FunctionalCIbyStatus</title>
                <query>SELECT FunctionalCI</query>
                <group_by>status</group_by>
                <style>pie</style>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="1">
            <rank>0</rank>
            <dashlets>
              <dashlet id="2" xsi:type="DashletGroupByBars">
                <rank>0</rank>
                <title>UI-ConfigMgmtMenuOverview-FunctionalCIByType</title>
                <query>SELECT FunctionalCI</query>
                <group_by>finalclass</group_by>
                <style>bars</style>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="2">
            <rank>0</rank>
            <dashlets>
              <dashlet id="3" xsi:type="DashletGroupByTable">
                <rank>0</rank>
                <title>UI-ConfigMgmtMenuOverview-FunctionalCIByType</title>
                <query>SELECT FunctionalCI</query>
                <group_by>finalclass</group_by>
                <style>table</style>
              </dashlet>
            </dashlets>
          </cell>
        </cells>
	  </definition>
    </menu>
    <menu id="Contact" xsi:type="DashboardMenuNode" _delta="define">
      <rank>1</rank>
      <parent>ConfigManagement</parent>
      <definition>
        <layout>DashboardLayoutOneCol</layout>
        <title></title>
        <cells>
          <cell id="1">
            <rank>0</rank>
            <dashlets>
              <dashlet id="1" xsi:type="DashletHeaderDynamic">
                <rank>0</rank>
                <title>UI:ContactsMenu</title>
                <icon>itop-config-mgmt-1.0.0/images/team.png</icon>
                <subtitle>Menu:ConfigManagement:AllContacts</subtitle>
                <query>SELECT Contact</query>
                <group_by>status</group_by>
                <values>active,inactive</values>
              </dashlet>
              <dashlet id="2" xsi:type="DashletBadge">
                <rank>1</rank>
                <class>Team</class>
              </dashlet>
              <dashlet id="3" xsi:type="DashletBadge">
                <rank>2</rank>
                <class>Person</class>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="2">
            <rank>1</rank>
            <dashlets>
              <dashlet id="4" xsi:type="DashletGroupByPie">
                <rank>0</rank>
                <title>UI-ContactsMenu-ContactsByLocation</title>
                <query>SELECT Contact</query>
                <group_by>location_id</group_by>
                <style>pie</style>
              </dashlet>
            </dashlets>
          </cell>
        </cells>
	  </definition>
    </menu>
    <menu id="NewContact" xsi:type="NewObjectMenuNode" _delta="define">
      <rank>1</rank>
      <parent>Contact</parent>
      <class>Contact</class>
    </menu>
    <menu id="SearchContacts" xsi:type="SearchMenuNode" _delta="define">
      <rank>2</rank>
      <parent>Contact</parent>
      <class>Contact</class>
    </menu>
    <menu id="Document" xsi:type="OQLMenuNode" _delta="define">
      <rank>2</rank>
      <parent>ConfigManagement</parent>
      <oql>SELECT Document</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="Location" xsi:type="OQLMenuNode" _delta="define">
      <rank>3</rank>
      <parent>ConfigManagement</parent>
      <oql>SELECT Location</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="Group" xsi:type="OQLMenuNode" _delta="define">
      <rank>4</rank>
      <parent>ConfigManagement</parent>
      <oql>SELECT Group</oql>
      <do_search>1</do_search>
    </menu>
    <menu id="ConfigManagementCI" xsi:type="DashboardMenuNode" _delta="define">
      <rank>5</rank>
      <parent>ConfigManagement</parent>
      <definition>
        <layout>DashboardLayoutOneCol</layout>
        <title></title>
        <cells>
          <cell id="0">
            <rank>0</rank>
            <dashlets>
              <dashlet id="1" xsi:type="DashletHeaderDynamic">
                <rank>0</rank>
                <title>Menu_ConfigManagement_Devices</title>
                <icon>itop-config-mgmt-1.0.0/images/server.png</icon>
                <subtitle>Menu_ConfigManagement_AllDevices</subtitle>
                <query>SELECT FunctionalCI</query>
                <group_by>status</group_by>
                <values>implementation,production,obsolete</values>
              </dashlet>
              <dashlet id="2" xsi:type="DashletBadge">
                <rank>1</rank>
                <class>Server</class>
              </dashlet>
              <dashlet id="3" xsi:type="DashletBadge">
                <rank>2</rank>
                <class>NetworkDevice</class>
              </dashlet>
              <dashlet id="5" xsi:type="DashletBadge">
                <rank>3</rank>
                <class>PC</class>
              </dashlet>
              <dashlet id="6" xsi:type="DashletBadge">
                <rank>4</rank>
                <class>MobilePhone</class>
              </dashlet>
              <dashlet id="7" xsi:type="DashletBadge">
                <rank>5</rank>
                <class>Printer</class>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="1">
            <rank>1</rank>
            <dashlets>
              <dashlet id="8" xsi:type="DashletHeaderStatic">
                <rank>0</rank>
                <title>Menu:ConfigManagement:SWAndApps</title>
                <icon>itop-config-mgmt-1.0.0/images/application.png</icon>
              </dashlet>
              <dashlet id="9" xsi:type="DashletBadge">
                <rank>1</rank>
                <class>ApplicationInstance</class>
              </dashlet>
              <dashlet id="10" xsi:type="DashletBadge">
                <rank>2</rank>
                <class>DBServerInstance</class>
              </dashlet>
              <dashlet id="11" xsi:type="DashletBadge">
                <rank>3</rank>
                <class>DatabaseInstance</class>
              </dashlet>
              <dashlet id="12" xsi:type="DashletBadge">
                <rank>4</rank>
                <class>Patch</class>
              </dashlet>
              <dashlet id="13" xsi:type="DashletBadge">
                <rank>5</rank>
                <class>Licence</class>
              </dashlet>
            </dashlets>
          </cell>
          <cell id="2">
            <rank>2</rank>
            <dashlets>
              <dashlet id="14" xsi:type="DashletHeaderStatic">
                <rank>0</rank>
                <title>Menu:ConfigManagement:Misc</title>
                <icon>itop-config-mgmt-1.0.0/images/subnet.png</icon>
              </dashlet>
              <dashlet id="15" xsi:type="DashletBadge">
                <rank>1</rank>
                <class>NetworkInterface</class>
              </dashlet>
              <dashlet id="16" xsi:type="DashletBadge">
                <rank>2</rank>
                <class>Subnet</class>
              </dashlet>
              <dashlet id="17" xsi:type="DashletBadge">
                <rank>3</rank>
                <class>BusinessProcess</class>
              </dashlet>
              <dashlet id="18" xsi:type="DashletBadge">
                <rank>4</rank>
                <class>ApplicationSolution</class>
              </dashlet>
              <dashlet id="19" xsi:type="DashletBadge">
                <rank>5</rank>
                <class>Group</class>
              </dashlet>
            </dashlets>
          </cell>
        </cells>
	  </definition>
    </menu>
    <menu id="NewCI" xsi:type="NewObjectMenuNode" _delta="define">
      <rank>0</rank>
      <parent>ConfigManagementCI</parent>
      <class>FunctionalCI</class>
    </menu>
    <menu id="SearchCIs" xsi:type="SearchMenuNode" _delta="define">
      <rank>1</rank>
      <parent>ConfigManagementCI</parent>
      <class>FunctionalCI</class>
    </menu>
    <menu id="ConfigManagement:Shortcuts" xsi:type="TemplateMenuNode" _delta="define">
      <rank>6</rank>
      <parent>ConfigManagement</parent>
      <template_file/>
    </menu>
    <menu id="Server" xsi:type="OQLMenuNode" _delta="define">
      <rank>1</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT Server</oql>
      <do_search/>
    </menu>
    <menu id="NetworkDevice" xsi:type="OQLMenuNode" _delta="define">
      <rank>2</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT NetworkDevice</oql>
      <do_search/>
    </menu>
    <menu id="Printer" xsi:type="OQLMenuNode" _delta="define">
      <rank>3</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT Printer</oql>
      <do_search/>
    </menu>
    <menu id="PC" xsi:type="OQLMenuNode" _delta="define">
      <rank>4</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT PC</oql>
      <do_search/>
    </menu>
    <menu id="BusinessProcess" xsi:type="OQLMenuNode" _delta="define">
      <rank>5</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT BusinessProcess</oql>
      <do_search/>
    </menu>
    <menu id="ApplicationSolution" xsi:type="OQLMenuNode" _delta="define">
      <rank>6</rank>
      <parent>ConfigManagement:Shortcuts</parent>
      <oql>SELECT ApplicationSolution</oql>
      <do_search/>
    </menu>
  </menus>
</itop_design>
