You'll need to extend the abstract class typology with your new custom typology and use an AttributeExternalKey to the monitor pointing to this new typology class.
You can find some examples (such as Brand or Model) in datamodel-production.xml (found in the "data" folder of iTop after installation)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I create a new, emty module with the generator from itop (see here), then I installed the new modul and create a new datamodel (In my Case I want create a new typolgie class "room" (german: Raum):
We'd need to see all your files; but some things to consider: it's best to keep the database table names in English (not required though); you also seem to refer to an attribute you call "Raum" while you only define the attribute "raumnummer" ? (also here it might be best to keep the names in English; and then use the dictionary files for translations)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here the content of the other files:
en.dict.company-typologie.php
<?php/** * Localized data * * @copyright Copyright (C) 2013 XXXXX * @license http://opensource.org/licenses/AGPL-3.0 */Dict::Add('EN US','English','English',array(// Dictionary entries go here));?>
model.company-typologie.php
<?php// PHP Data Model definition file// WARNING - WARNING - WARNING// DO NOT EDIT THIS FILE (unless you know what you are doing)//// If you use supply a datamodel.xxxx.xml file with your module// the this file WILL BE overwritten by the compilation of the// module (during the setup) if the datamodel.xxxx.xml file// contains the definition of new classes or menus.//// The recommended way to define new classes (for iTop 2.0) is via the XML definition.// This file remains in the module's template only for the cases where there is:// - either no new class or menu defined in the XML file// - or no XML file at all supplied by the module
module.company-typologie.php
<?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'company_typologie/1.0.0',array(// Identification//'label'=>'Typologie Ergänzungen (Company)','category'=>'business',// Setup//'dependencies'=>array(),'mandatory'=>false,'visible'=>true,// Components//'datamodel'=>array('model.company-typologie.php'),'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),));?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
currently I testing if itop can be used by us as an inventory tool. The first look is simple great!
I have already created a new CI with different custom fields. For my example I followed this great tutorial:
https://www.itophub.io/wiki/page?id=2_2_0%3Acustomization%3Aadd-class-sample.
Is there a way, or a good tutorial, how to create a field which reference to a new created typology class ?
As an example, I would like to be able to add custom entries (LCD, CRT, Plasma,...) to the "Technology" field on my CI "Monitor".
Thx for any help!
Marco
You'll need to extend the abstract class typology with your new custom typology and use an AttributeExternalKey to the monitor pointing to this new typology class.
You can find some examples (such as Brand or Model) in datamodel-production.xml (found in the "data" folder of iTop after installation)
Hi Jeffry,
I create a new, emty module with the generator from itop (see here), then I installed the new modul and create a new datamodel (In my Case I want create a new typolgie class "room" (german: Raum):
My Problem now is, when i check the itop data model consistency all looks good (see attachment), but the table company_raum wouldn't create in mysql.
Under the typologie menue i can see following error:
DBObjectSearch::__construct called for an invalid class: "Raum"
Can you tell me what I#m doing wrong?
We'd need to see all your files; but some things to consider: it's best to keep the database table names in English (not required though); you also seem to refer to an attribute you call "Raum" while you only define the attribute "raumnummer" ? (also here it might be best to keep the names in English; and then use the dictionary files for translations)
Hi,
i changed the names in english and changed the atribute raummnummer to raum:
Here the content of the other files:
en.dict.company-typologie.php
model.company-typologie.php
module.company-typologie.php
Jeffrey, do you have a idea, what i'm doing wrong?
Check your dependencies
Last edit: Ekaterina Latipova 2024-06-24