Hello, I am trying to restructure the order of the data model of the "Server" class using an extension, but when loading the new extension it is overwritten with the original data model of the server class, is there any way to solve this?
<?xml version="1.0" encoding="UTF-8"?> <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7"> <classes> <class id="Server" _delta="if_exists"> <fields> <field id="architecture_server" xsi:type="AttributeString" _delta="define"> <sql>architecture_server</sql> <default_value/> <is_null_allowed>true</is_null_allowed> </field> <field id="bios_manufacturer" xsi:type="AttributeString" _delta="define"> <sql>bios_manufacturer</sql> <default_value/> <is_null_allowed>true</is_null_allowed> </field> <field id="cores_number" xsi:type="AttributeInteger" _delta="define"> <sql>cores_number</sql> <default_value>0</default_value> <is_null_allowed>false</is_null_allowed> </field> <field id="logical_cpus" xsi:type="AttributeInteger" _delta="define"> <sql>logical_cpus</sql> <default_value>0</default_value> <is_null_allowed>false</is_null_allowed> </field> <field id="storage" xsi:type="AttributeText" _delta="define"> <sql>storage</sql> <default_value/> <is_null_allowed>true</is_null_allowed> </field> <field id="ip_public" xsi:type="AttributeString" _delta="define"> <sql>ip_public</sql> <default_value/> <is_null_allowed>true</is_null_allowed> </field> <field id="unix_local_users" xsi:type="AttributeText" _delta="define"> <sql>unix_local_users</sql> <default_value/> <is_null_allowed>true</is_null_allowed> </field> </fields> <presentation _delta="redefine"> <details> <items> <item id="col:col1"> <rank>120</rank> <items> <item id="fieldset:Server:baseinfo"> <rank>10</rank> <items> <item id="name"> <rank>10</rank> </item> <item id="org_id"> <rank>20</rank> </item> <item id="status"> <rank>30</rank> </item> <item id="business_criticity"> <rank>40</rank> </item> <item id="location_id"> <rank>50</rank> </item> <item id="rack_id"> <rank>60</rank> </item> <item id="enclosure_id"> <rank>70</rank> </item> </items> </item> <item id="fieldset:Server:Date"> <rank>10</rank> <items> <item id="move2production"> <rank>10</rank> </item> <item id="purchase_date"> <rank>20</rank> </item> <item id="end_of_warranty"> <rank>30</rank> </item> </items> </item> <item id="fieldset:Server:power"> <rank>20</rank> <items> <item id="powerA_id"> <rank>10</rank> </item> <item id="powerB_id"> <rank>20</rank> </item> <item id="redundancy"> <rank>30</rank> </item> </items> </item> <item id="fieldset:Server:otherinfo"> <rank>30</rank> <items> <item id="description"> <rank>10</rank> </item> </items> </item> </items> </item> <item id="col:col2"> <rank>130</rank> <items> <item id="fieldset:Server:moreinfo"> <rank>20</rank> <items> <item id="brand_id"> <rank>10</rank> </item> <item id="model_id"> <rank>20</rank> </item> <item id="osfamily_id"> <rank>30</rank> </item> <item id="osversion_id"> <rank>40</rank> </item> <item id="managementip"> <rank>45</rank> </item> <item id="oslicence_id"> <rank>50</rank> </item> <item id="cpu"> <rank>60</rank> </item> <item id="ram"> <rank>70</rank> </item> <item id="nb_u"> <rank>80</rank> </item> <item id="serialnumber"> <rank>90</rank> </item> <item id="asset_number"> <rank>100</rank> </item> <item id="architecture_server" _delta="define"> <rank>110</rank> </item> <item id="bios_manufacturer" _delta="define"> <rank>120</rank> </item> <item id="cores_number" _delta="define"> <rank>130</rank> </item> <item id="logical_cpus" _delta="define"> <rank>140</rank> </item> <item id="storage" _delta="define"> <rank>150</rank> </item> <item id="ip_public" _delta="define"> <rank>160</rank> </item> <item id="unix_local_users" _delta="define"> <rank>170</rank> </item> </items> </item> </items> </item> </items> </details> </presentation> </class> </classes> </itop_design>
Have you set a dependency to the original class in the "dependencies" section of your extensions' module PHP file?
What is the dependency that you mention? I am guided by the length of the documentation.
<?php // // iTop module definition file // SetupWebPage::AddModule( __FILE__, // Path to the current file, all other file names are relative to the directory containing this file 'addfields_server-custom/1.0.0', array( // Identification // 'label' => 'addfields_server-custom', 'category' => 'business', // Setup // 'dependencies' => array( 'itop-config-mgmt/2.0.0' ), 'mandatory' => false, 'visible' => true, // Components // 'datamodel' => array( 'vendor/autoload.php', 'model.addfields_server-custom.php', // Contains the PHP code generated by the "compilation" of datamodel.addfields_server-custom.xml ), 'webservice' => array( ), 'data.struct' => array( // add your 'structure' definition XML files here, ), 'data.sample' => array( // add your sample data XML files here, ), // Documentation // 'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any 'doc.more_information' => '', // hyperlink to more information, if any // Default settings // 'settings' => array( // Module specific settings go here, if any ), ) ); ?>
Log in to post a comment.
Hello, I am trying to restructure the order of the data model of the "Server" class using an extension, but when loading the new extension it is overwritten with the original data model of the server class, is there any way to solve this?
Have you set a dependency to the original class in the "dependencies" section of your extensions' module PHP file?
What is the dependency that you mention? I am guided by the length of the documentation.