Menu

Questions about extensions

H-nymo
2015-11-26
2015-11-26
  • H-nymo

    H-nymo - 2015-11-26

    Hi,

    My questions may seem easy but I'm really news in itop dev.
    I've created an extensions for adding a new dropdown field classification : "public, confidential,etc..." for many CIs like, servers, virtualserver, db ,etc...

    1) I've defined a default value as "public" because no null value is allowed. Unfortunately when I put my config active, the classifications for all actual's CIs are appeared as "confidential". In the datamodel I've first configured this dropdown field in class id="Functional CI" and details/search/list item for class id="server". Actually I've didn't create in other CIs.
    Where could be the problem??

     <class id="FunctionalCI">
          <fields>
            <field id="classification" xsi:type="AttributeEnum" _delta="define">
              <values>
                <value>public</value>
                <value>internal</value>
                <value>confidential</value>
                <value>strictly confidential</value>
              </values>
              <sql>classification</sql>
              <default_value>public</default_value>
              <is_null_allowed>false</is_null_allowed>
            </field>
          </fields>
    

    2)I need to implement this for many CIs like Servers, Virtualserver,etc.... It is possible to create many datamodel.****.xml in the same extension directory? or should I insert into only one datamodel??
    Ex.:

    .../itop/extensions/classification/
    datamodel.classification1.xml
    datamodel.classification2.xml
    etc...
    

    Thanks and best regards,
    H.

     

    Last edit: H-nymo 2015-11-26
  • dlp

    dlp - 2015-11-26

    Hi,

    1) Thishow I do it :

            <values>
                <value id="1">1</value>
                <value id="2">2</value>
            </values>
            <default_value>1</default_value>
    

    I don't remerber if the default value take the id or the value... Can you try to specify id in your value and put the default value as the id?

    2) I do not think it is possible to have many xml datamodel file in one extension... You can include php files, in the module config in the array "datamodel", but i don't know if it is working with xml definition.

     
  • H-nymo

    H-nymo - 2015-11-26

    Hi,

    Thank you for your answer.
    I've tried with the default value as the id number but it is not working.
    I'mk thinking that the default value is set in alphabetical order, and why "confidential" is with c it put it!!
    Regards
    H

     
  • dlp

    dlp - 2015-11-26

    Which iTop version are you using?
    Because I have encounter some problems with the default values sometimes with previous itop versions.

     
  • H-nymo

    H-nymo - 2015-11-26

    Here's the itop version:

    iTop version 2.0.3-1916 built on 2014-07-15 11:52:34
    Data model: 2.0.3
    We're plan to do an update next year...

     

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.