User Tools

Site Tools

:: Version 2.7.0 ::

2_7_0:customization:xml_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
2_7_0:customization:xml_reference [2020/06/22 16:05]
127.0.0.1 external edit
2_7_0:customization:xml_reference [2020/12/16 17:38] (current)
Line 73: Line 73:
                         </​attributes>​                         </​attributes>​
                     </​naming>​                     </​naming>​
 +                    <​fields_semantic doc-desc="​Define the attributes carrying some aspect of the class (eg. image, state, ...)" doc-cardinality="​0-1">​
 +                        <​image_attribute doc-desc="​Attribute code carrying the image that should represent the object (must be declared as AttributeImage). If not define, the class icon will be used when necessary"​ doc-cardinality="​0-1"​ />
 +                        <​state_attribute doc-desc="​Attribute code carrying the object state (must be declared as AttributeEnum,​ can be inherited from a parent class)"​ doc-cardinality="​0-1"​ />
 +                    </​fields_semantic>​
 +                    <​complement_for_select doc-desc="​Define the attributes used to complete the friendly name of an object to differentiate duplicates. By default, the complement is empty. You can specify a format by adding a dictionary entry '​Class:&​amp;​lt;​myClass&​amp;​gt;/​ComplementForSelect'​. This format is given as a printf-like formatting expression (Only $s is supported. e.g. '%1$s of %2$s'​). As such a format is located in the dictionary, it may be translated, and the 
 +additional information would depend on the language of the end-user. Supported only since iTop 3.0.0."​ doc-cardinality="​0-1">​
 +                        <​attributes doc-desc="​List of attributes used to compose the complement. Note that the order matters."​ doc-list='​attribute'​ doc-cardinality="​1">​
 +                            <​attribute doc-attributes="​id=&​quot;​*name*&​quot;"​ doc-cardinality="​1-n"/>​
 +                        </​attributes>​
 +                    </​complement_for_select>​
                     <order doc-desc="​Defines the default sort order for the class, if omitted the class is sorted on the friendly name" doc-cardinality="​0-1">​                     <order doc-desc="​Defines the default sort order for the class, if omitted the class is sorted on the friendly name" doc-cardinality="​0-1">​
                         <columns doc-cardinality="​1">​                         <columns doc-cardinality="​1">​
Line 78: Line 88:
                         </​columns>​                         </​columns>​
                     </​order>​                     </​order>​
-                    <​display_template doc-desc=""​ doc-cardinality="​0-1"/>​ 
                     <icon doc-desc="​Specify an icon for your class" doc-cardinality="​0-1"/>​                     <icon doc-desc="​Specify an icon for your class" doc-cardinality="​0-1"/>​
                     <​reconciliation doc-desc="​Define the default reconciliation scheme for data import."​ doc-cardinality="​1">​                     <​reconciliation doc-desc="​Define the default reconciliation scheme for data import."​ doc-cardinality="​1">​
Line 243: Line 252:
         </​dictionaries>​         </​dictionaries>​
         <​branding doc-desc="​Appearance of the GUI." doc-cardinality="​0-1">​         <​branding doc-desc="​Appearance of the GUI." doc-cardinality="​0-1">​
-            <​main_logo doc-desc="​Logo for the main GUI (top left corner). Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 260px (div#header-logo img margin-right), max height ​70px." doc-ref="​Files"​ doc-cardinality="​0-1"/>​+            <​main_logo doc-desc="​Logo for the main GUI (top left corner) ​when the menu is expanded. Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 220px, max height 64px." doc-ref="​Files"​ doc-cardinality="​0-1"/>​ 
 +            <​main_logo_compact doc-desc="​Logo for the main GUI (top left cornerwhen the menu is collapsed. Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 37px, max height ​37px." doc-ref="​Files"​ doc-cardinality="​0-1"/>​
             <​login_logo doc-desc="​Logo for the login page. Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 300px, max height 54px (div#​login-logo)"​ doc-ref="​Files"​ doc-cardinality="​0-1"/>​             <​login_logo doc-desc="​Logo for the login page. Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 300px, max height 54px (div#​login-logo)"​ doc-ref="​Files"​ doc-cardinality="​0-1"/>​
             <​portal_logo doc-desc="​Logo for the customer portal (top left corner). Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 192px (.col-sm-3 width 26%% and media query 768px), max height 50px (img tag)." doc-ref="​Files"​ doc-cardinality="​0-1"/>​             <​portal_logo doc-desc="​Logo for the customer portal (top left corner). Defined as a PNG file (path relative to the modules root directory = env-production),​ or fileref tag (see details in the section %s). Dimensions : max width 192px (.col-sm-3 width 26%% and media query 768px), max height 50px (img tag)." doc-ref="​Files"​ doc-cardinality="​0-1"/>​
Line 258: Line 268:
     <​stylesheet doc-cardinality="​1-n" ​ doc-attributes="​id=&​quot;​main&​quot;"​ doc-desc="​Path to scss stylesheet to import. Path is relative to env-*/"​ doc-example="​../​css/​light-grey.scss"/>​     <​stylesheet doc-cardinality="​1-n" ​ doc-attributes="​id=&​quot;​main&​quot;"​ doc-desc="​Path to scss stylesheet to import. Path is relative to env-*/"​ doc-example="​../​css/​light-grey.scss"/>​
   </​stylesheets>​   </​stylesheets>​
 +  <​precompiled_stylesheet doc-cardinality="​0-1" ​ doc-desc="​Path to precompiled CSS stylesheet. Path is relative to datamodels/​2.x/"​ doc-example="​itop-structure/​precompiled-themes/​light-grey/​main.css"​ />
 </​theme>​ </​theme>​
 </​themes>​ </​themes>​
Line 318: Line 329:
 <note warning>''​Condition''​ is to be used with care as it is not checked on the current object but only on objects already existing in database</​note>​ <note warning>''​Condition''​ is to be used with care as it is not checked on the current object but only on objects already existing in database</​note>​
 <note warning>​Uniqueness rules are checked whenever inserting new object or updating existing one, but no lock (iTopMutex) are used for performance reasons. So there might be use cases with concurrent access where the rule won't be triggered.</​note>​ <note warning>​Uniqueness rules are checked whenever inserting new object or updating existing one, but no lock (iTopMutex) are used for performance reasons. So there might be use cases with concurrent access where the rule won't be triggered.</​note>​
 +
 ===== Fields ===== ===== Fields =====
 The fields (also called attributes) are the actual data members of the objects. A field generally corresponds to one (or more) columns(s) in one table in the database. The different types of fields are listed in the table below: The fields (also called attributes) are the actual data members of the objects. A field generally corresponds to one (or more) columns(s) in one table in the database. The different types of fields are listed in the table below:
Line 438: Line 450:
  <​tracking_level doc-desc="​Adjust the recording of changes (history tab). Possible values: none, all. Defaults to '​all'"​ doc-example="​all"​ doc-cardinality="​0-1"/>​  <​tracking_level doc-desc="​Adjust the recording of changes (history tab). Possible values: none, all. Defaults to '​all'"​ doc-example="​all"​ doc-cardinality="​0-1"/>​
  <​always_load_in_tables doc-desc="​Advanced:​ set to true for attributes that are always used by a plugin. Possible values: true, false. Defaults to '​false'"​ doc-example="​true"​ doc-cardinality="​0-1"/>​  <​always_load_in_tables doc-desc="​Advanced:​ set to true for attributes that are always used by a plugin. Possible values: true, false. Defaults to '​false'"​ doc-example="​true"​ doc-cardinality="​0-1"/>​
 + <​max_items doc-desc="​Maximum number of tags allowed on an object. Default 12. Max value 255." doc-example="​12"​ doc-cardinality="​1"/>​
  <​dependencies doc-list='​attribute'​ doc-desc="​Attributes on which the current attribute depends. This will be taken into account in the forms."​ doc-cardinality="​0-1">​  <​dependencies doc-list='​attribute'​ doc-desc="​Attributes on which the current attribute depends. This will be taken into account in the forms."​ doc-cardinality="​0-1">​
  <​attribute doc-desc="​An attribute code" doc-attributes="​id=&​quot;​*name*&​quot;"​ doc-cardinality="​1"/>​  <​attribute doc-desc="​An attribute code" doc-attributes="​id=&​quot;​*name*&​quot;"​ doc-cardinality="​1"/>​
Line 453: Line 466:
  <​is_null_allowed doc-desc="​Set to &​quot;​true&​quot;​ to let users leave this value undefined, false otherwise"​ doc-example="​true"​ doc-cardinality="​1"/>​  <​is_null_allowed doc-desc="​Set to &​quot;​true&​quot;​ to let users leave this value undefined, false otherwise"​ doc-example="​true"​ doc-cardinality="​1"/>​
  <​on_target_delete doc-desc="​Define how the deletion of the target object will impact the current object. Allowed values are '​DEL_MANUAL'​ and '​DEL_AUTO'"​ doc-example="​DEL_AUTO"​ doc-cardinality="​1"/>​  <​on_target_delete doc-desc="​Define how the deletion of the target object will impact the current object. Allowed values are '​DEL_MANUAL'​ and '​DEL_AUTO'"​ doc-example="​DEL_AUTO"​ doc-cardinality="​1"/>​
- <​target_class doc-desc="​The class of the objects ​to which the external key is pointing"​ doc-example="​*name*"​ doc-cardinality="​1"/>​+ <​target_class doc-desc="​The class of the object ​to which the external key is pointing. If the class does not exist, this field will silently be ignored." doc-example="​*name*"​ doc-cardinality="​1"/>​
  <​filter doc-desc="​OQL query to define a set of object to which the external key can point to. Use :​this-&​gt;​*name* to refer to a value in the current object"​ doc-example="​SELECT Location AS L WHERE L.org_id = :​this-&​gt;​org_id"​ doc-cardinality="​0-1"/>​  <​filter doc-desc="​OQL query to define a set of object to which the external key can point to. Use :​this-&​gt;​*name* to refer to a value in the current object"​ doc-example="​SELECT Location AS L WHERE L.org_id = :​this-&​gt;​org_id"​ doc-cardinality="​0-1"/>​
  <​dependencies doc-list='​attribute'​ doc-desc="​Attributes on which the current attribute depends. This will be taken into account in the forms."​ doc-cardinality="​0-1">​  <​dependencies doc-list='​attribute'​ doc-desc="​Attributes on which the current attribute depends. This will be taken into account in the forms."​ doc-cardinality="​0-1">​
Line 504: Line 517:
  </​dependencies>​  </​dependencies>​
  </​field>​  </​field>​
- <field doc-desc="​An integer value" doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeInteger&​quot;"​ doc-cardinality="​0-n">​+ <field doc-desc="​A positive ​integer value" doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeInteger&​quot;"​ doc-cardinality="​0-n">​
  <sql doc-desc="​The column used to store the value into the MySQL database"​ doc-example="​*name*"​ doc-cardinality="​1"/>​  <sql doc-desc="​The column used to store the value into the MySQL database"​ doc-example="​*name*"​ doc-cardinality="​1"/>​
  <​default_value doc-desc="​The default value" doc-example="​*name*"​ doc-cardinality="​1"/>​  <​default_value doc-desc="​The default value" doc-example="​*name*"​ doc-cardinality="​1"/>​
Line 525: Line 538:
  </​field>​  </​field>​
  <field doc-desc="​A set of objects pointing to the current object"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeLinkedSet&​quot;"​ doc-cardinality="​0-n">​  <field doc-desc="​A set of objects pointing to the current object"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeLinkedSet&​quot;"​ doc-cardinality="​0-n">​
- <​linked_class doc-desc="​A class of objects having an external key pointing to the current object"​ doc-example="​*name*"​ doc-cardinality="​1"/>​+ <​linked_class doc-desc="​A class of objects having an external key pointing to the current object.  If the class does not exist, the whole field will silently be ignored." doc-example="​*name*"​ doc-cardinality="​1"/>​
  <​filter doc-desc="​Not used by iTop for now! OQL query to define objects to which the current object can be linked. It's the counterpart of the //filter// on the corresponding ExternalKey."​ doc-example="​SELECT Person AS P WHERE P.category = :​this-&​gt;​category"​ doc-cardinality="​0-1"/>​  <​filter doc-desc="​Not used by iTop for now! OQL query to define objects to which the current object can be linked. It's the counterpart of the //filter// on the corresponding ExternalKey."​ doc-example="​SELECT Person AS P WHERE P.category = :​this-&​gt;​category"​ doc-cardinality="​0-1"/>​
  <​ext_key_to_me doc-desc="​An external key attribute, defined on the linked class" doc-example="​*name*"​ doc-cardinality="​1"/>​  <​ext_key_to_me doc-desc="​An external key attribute, defined on the linked class" doc-example="​*name*"​ doc-cardinality="​1"/>​
Line 537: Line 550:
  </​field>​  </​field>​
  <field doc-desc="​A set of objects related to the current object by the mean of a &​quot;​link class&​quot;"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeLinkedSetIndirect&​quot;"​ doc-cardinality="​0-n">​  <field doc-desc="​A set of objects related to the current object by the mean of a &​quot;​link class&​quot;"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​AttributeLinkedSetIndirect&​quot;"​ doc-cardinality="​0-n">​
- <​linked_class doc-desc="​A class of objects having an external key pointing to the current object"​ doc-example="​*name*"​ doc-cardinality="​1"/>​+ <​linked_class doc-desc="​A class of objects having an external key pointing to the current object.  If the class does not exist, the whole field will silently be ignored." doc-example="​*name*"​ doc-cardinality="​1"/>​
  <​ext_key_to_me doc-desc="​An external key attribute, defined on the linked class" doc-example="​*name*"​ doc-cardinality="​1"/>​  <​ext_key_to_me doc-desc="​An external key attribute, defined on the linked class" doc-example="​*name*"​ doc-cardinality="​1"/>​
  <​ext_key_to_remote doc-desc="​An external key attribute, defined on the linked class, and pointing to the remote object"​ doc-example="​*name*"​ doc-cardinality="​1"/>​  <​ext_key_to_remote doc-desc="​An external key attribute, defined on the linked class, and pointing to the remote object"​ doc-example="​*name*"​ doc-cardinality="​1"/>​
Line 720: Line 733:
 Typically, when displaying a list of Ticket, the ''​status''​ and ''​tto''​ are always loaded even if not displayed, because they are used to compute the //highlight scale// (none, orange, red).  Typically, when displaying a list of Ticket, the ''​status''​ and ''​tto''​ are always loaded even if not displayed, because they are used to compute the //highlight scale// (none, orange, red). 
  
 +
 +=== Tag: target_class & linked_class ===
 +
 +If an ExternalKey,​ a LinkedSet or a LinkedSetIndirect field reference a class which does not exist in the datamodel, then iTop XML compilation process will ignore those fields silently. This behavior allow to simplify the writing of generic extension, which can auto-adapt to the variability of datamodel.
  
 ===== Presentation ===== ===== Presentation =====
Line 744: Line 761:
   * **default_search**:​ used as default search criteria when searching for objects of this class or its sub-classes if that list is not redefined below.   * **default_search**:​ used as default search criteria when searching for objects of this class or its sub-classes if that list is not redefined below.
   * **list**: ​ used as default columns when displaying lists of object   * **list**: ​ used as default columns when displaying lists of object
-  * **search**: used as ''​most popular''​ search criteria for this class+  * **search** ​(''​standard_search''​ in PHP) : used as ''​most popular''​ search criteria for this class
  
 <​xmltotreetable>​ <​xmltotreetable>​
Line 784: Line 801:
     <​enable_permission doc-desc="​Invert the rule by setting this value to UR_ALLOWED_NO. Defaults to UR_ALLOWED_YES. Ignored if enable_class is not given."​ doc-example="​UR_ALLOWED_YES"​ doc-cardinality="​0-1"/>​     <​enable_permission doc-desc="​Invert the rule by setting this value to UR_ALLOWED_NO. Defaults to UR_ALLOWED_YES. Ignored if enable_class is not given."​ doc-example="​UR_ALLOWED_YES"​ doc-cardinality="​0-1"/>​
     <​enable_stimulus doc-desc="​Bind to the rights to apply a given stimulus. Ignored if enable_class is not given."​ doc-example="​ev_assign"​ doc-cardinality="​0-1"/>​     <​enable_stimulus doc-desc="​Bind to the rights to apply a given stimulus. Ignored if enable_class is not given."​ doc-example="​ev_assign"​ doc-cardinality="​0-1"/>​
 +    <style doc-cardinality="​0-1">​
 +      <​decoration_classes doc-desc="​CSS classes to use to display the menu group icon. You can use any fontawesome.com/​icons or your own CSS classes. If missing, the first letter of the menu group title will be used." doc-example="​fas fa-home"​ doc-cardinality="​0-1"​ />
 +    </​style>​
   </​menu>​   </​menu>​
   <menu doc-desc="​Dashboard. The contents can be produced by the mean of the &​quot;​export&​quot;​ function. The contents of the dashboard can be found in a file (definition_file) or directly here (definition)"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​DashboardMenuNode&​quot;"​ doc-cardinality="​0-1">​   <menu doc-desc="​Dashboard. The contents can be produced by the mean of the &​quot;​export&​quot;​ function. The contents of the dashboard can be found in a file (definition_file) or directly here (definition)"​ doc-attributes="​id=&​quot;​*name*&​quot;​ xsi:​type=&​quot;​DashboardMenuNode&​quot;"​ doc-cardinality="​0-1">​
Line 1137: Line 1157:
   * Add of theme in branding   * Add of theme in branding
   * New field type: ''​AttributeEnumSet''​ which is kind of TagSet with allowed values defined in XML instead of database   * New field type: ''​AttributeEnumSet''​ which is kind of TagSet with allowed values defined in XML instead of database
 +
 +==== Version 1.8 ====
 +This version came live with iTop 2.8 beta, released in FIXME
 +
 +  * Add //​fields_semantic//​ in class properties to define which attributes carry the state and image of the class
 +  * Move //​attribute_code//​ from class lifecycle to class properties //​fields_semantic/​state_attribute//​
 +  * Remove //​display_template//​ from class properties as it wasn't use anymore
 +
2_7_0/customization/xml_reference.txt · Last modified: 2020/12/16 17:38 (external edit)

";