Menu

Dictionary Fails to pickup new attribute list

2011-03-16
2012-12-19
  • Bernhard Jongejan

    I added the following lines to model.itop-config-mgmt.php in class NetworkDevice :

    MetaModel::Init_AddAttribute(new AttributeString("monitoring", array("allowed_values"=>new ValueSetEnum('rancid'), "sql"=>"monitoring", "default_value"=>"rancid", "is_null_allowed"=>true, "depends_on"=>array())));

    This successfully adds a new attribute to the Network CI with rancid in its list.

    The following was added to the file en.dict.itop-config-mgmt.php:

    'Class:NetworkDevice/Attribute:monitoring' => 'Monitoring',
    'Class:NetworkDevice/Attribute:monitoring+' => '',
    'Class:NetworkDevice/Attribute:monitoring/Value:rancid' => 'Rancid',
    'Class:NetworkDevice/Attribute:monitoring/Value:rancid+' => '',

    'Monitoring' is picked up , but 'Rancid' is not and the item in the list Monitoring keeps showing up as 'rancid'

    I am just wondering what I have missed here. Any suggestions would be very welcome. Thanks

    Bernhard

     
  • Denis

    Denis - 2011-03-17

    The translations of the values through the dictionary is reserved to attributes of type 'Enum'.

    So if you want to have an attribute that looks like a drop-down list in iTop, declare it like:
    MetaModel::Init_AddAttribute(new AttributeEnum("monitoring", array("allowed_values"=>new ValueSetEnum('rancid'), "sql"=>"monitoring", "default_value"=>"rancid", "is_null_allowed"=>true, "depends_on"=>array())));

    Hope this helps,

    - Denis

     
  • Bernhard Jongejan

    it did thanks

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.