Menu

Something wrong

2021-06-24
2021-06-24
  • Erwan ROBERT

    Erwan ROBERT - 2021-06-24

    Hello,
    I'm missing a little something. My need is to add a tab on the software class that contains the expression of software needs by my organizational entities. So I created an extension for that. I started by adding the field to the class:

        <field id="needs_list" xsi:type="AttributeLinkedSet" _delta="define"> 
          <linked_class>Needs</linked_class>
          <ext_key_to_me>software_id</ext_key_to_me>
          <edit_mode>in_place</edit_mode>
          <tracking_level>all</tracking_level>
          <count_min>0</count_min>
          <count_max>0</count_max>
        </field>
    

    And I defined this class like this:

    <class id="Besoin" _delta="define">
      <parent>cmdbAbstractObject</parent>
      <properties>
        <category>bizmodel,searchable</category>
        <abstract>true</abstract>
        <key_type>autoincrement</key_type>
        <db_table>besoin</db_table>
        <db_key_field>id</db_key_field>
        <db_final_class_field>finalclass</db_final_class_field>
        <naming>
          <attributes>
            <attribute id="software_id"/>
          </attributes>
        </naming>
        <display_template/>
        <icon>images/besoin.png</icon>
        <reconciliation>
          <attributes>
            <attribute id="software_id"/>
            <attribute id="software_name"/>
          </attributes>
        </reconciliation>
      </properties>
      <fields>
        <field id="software_id" xsi:type="AttributeExternalKey">
          <sql>software_id</sql>
          <target_class>Software</target_class>
          <is_null_allowed>false</is_null_allowed>
          <on_target_delete>DEL_AUTO</on_target_delete>
        </field>
        <field id="software_name" xsi:type="AttributeExternalField">
          <extkey_attcode>software_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </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>
        </field>
        <field id="org_name" xsi:type="AttributeExternalField">
          <extkey_attcode>org_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
        <field id="nombre_besoin" xsi:type="AttributeInteger" _delta="define">
          <sql>nombre_besoin</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
        </field>
        <field id="status" xsi:type="AttributeEnum">
          <values>
            <value id="draft">draft</value>
            <value id="published">published</value>
            <value id="obsolete">obsolete</value>
          </values>
          <sql>status</sql>
          <default_value/>
          <is_null_allowed>true</is_null_allowed>
          <display_style>list</display_style>
        </field>
      </fields>
      <methods/>
      <presentation>
        <details>
          <items>
            <item id="software_id">
              <rank>10</rank>
            </item>          
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="nombre_besoin">
              <rank>20</rank>
            </item>           
            <item id="status">
              <rank>50</rank>
            </item>
          </items>
        </details>
        <search>
          <items>  
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="status">
              <rank>30</rank>
            </item>
          </items>
        </search>
        <list>
          <items>
            <item id="org_id">
              <rank>10</rank>
            </item>
            <item id="status">
              <rank>20</rank>
            </item>
            <item id="nombre_besoin">
              <rank>30</rank>
            </item>
          </items>
        </list>
      </presentation>
    </class>
    

    The tab appears correctly in the display (excluding the dictionary), but when I use the create button. Instead of displaying the window correctly, I get a piece of nothing. And I don't understand where my error is.

     

    Last edit: Erwan ROBERT 2021-06-24
  • Vincent @ Combodo

    This is bad, you cannot create an abstract class object
    <abstract>true</abstract>

     
  • Erwan ROBERT

    Erwan ROBERT - 2021-06-24

    Rhoooo, so obvious ... thank you it works great now!

     

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.