Wiki source code of XWiki Properties (Data Types)
Last modified by Eleni Cojocariu on 2026/03/19 07:53
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Properties define the types of data that each [[Object>>xwiki:documentation.xs.dev.data-model.x-objects.WebHome]] instance of a [[Class>>xwiki:documentation.xs.dev.data-model.x-classes.WebHome]] can have. Properties have displayers (a kind of output and input preview) that control how a Property’s value is shown when viewing and how it’s edited. When [[defining Class Properties>>xwiki:documentation.xs.user.base.page.edit-page.edit-class-editor.define-class-property.WebHome]] it is required to select a data type from the dropdown as in the following image~: | ||
| 2 | |||
| 3 | {{image reference="data-types.png" size="large" alt="Class editor with the property type dropdown expanded, highlighting the available data types"/}} | ||
| 4 | |||
| 5 | |=Data Type|=Description|=Output Preview | ||
| 6 | |**List of Users**|Allows to store and display single-select or multi-select users. The field uses a user picker as shown:|{{image reference="list-users.png" size="medium" alt="The output preview when choosing List of users as data type is a user picker"/}} | ||
| 7 | |**Number**|Allows to store and display only Numbers of type ##integer##, ##long##, ##float##, ##double##.|{{image reference="number.png" size="medium" alt="The output preview when choosing Number as data type is a field"/}} | ||
| 8 | |**List of Groups**|Allows to store and display single-select or multi-select groups. The field uses a user picker as shown:|{{image reference="list-groups.png" size="medium" alt="The output preview when choosing List of users as data type is a user picker"/}} | ||
| 9 | |**Time Zone**|Allow to display and edit Time Zones.|{{image reference="time-zone.png" size="medium" alt="The output preview when choosing Time Zone as data type is a dropdown with time zones"/}} | ||
| 10 | |**[[Computed Field>>xwiki:Documentation.DevGuide.DataModel.Computed Pseudofield.WebHome]]**|Allows to create a pseudo field for which the display can be configured using a custom displayer and the value retrieved by using a script. It allows combining other fields together. For example, consider the computed field containing the following script: | ||
| 11 | {{code language="none"}}{{velocity}} | ||
| 12 | Name: $doc.display('name') Age: $doc.display('age') | ||
| 13 | {{/velocity}}{{/code}} This script automatically retrieves the values of the ##name## and ##age## fields from the same document and displays them together, like this:|{{image reference="computed-field.png" size="medium"/}} | ||
| 14 | |**[[Database List>>xwiki:Documentation.DevGuide.DataModel.DatabaseList.WebHome]]**|Allows to store and display single-select or multi-select fields that can be displayed as select, checkbox, radio or suggests fields. The possible values of database list fields are taken from the execution of a query on other XWiki data such as Pages or Objects. The query is typically expressed in the Hibernate Query Language (see [[XWiki Query Module>>url:https://extensions.xwiki.org/xwiki/bin/view/Extension/Query%20Module]]) and it can use [[the Velocity script notation>>url:https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/]] (as long as the XWiki class author has [[the required scripting permission>>url:https://extensions.xwiki.org/xwiki/bin/view/Extension/Security%20Module]]) for including dynamic parameters such as the current page space, the current time, etc.|{{image reference="database-list.png" size="medium"/}} | ||
| 15 | |**Date**|Allows to store and display date or datetime values. A date picker is used automatically for this field as shown:|{{image reference="date.png" size="medium"/}} | ||
| 16 | |**Database Tree**|Similar to Database List, but displays the data in a hierarchical tree structure. | ||
| 17 | |**Password**|Allows to store password fields, which can be encrypted or hashed.|{{image reference="password.png" size="medium"/}} | ||
| 18 | |**String**|Allows to store and display one line texts.|{{image reference="string.png" size="medium"/}} | ||
| 19 | |**Email**|Allows to store email fields that can be obfuscated at display time.|{{image reference="email.png" size="medium"/}} | ||
| 20 | |**Boolean**|Allows to store and display boolean values (##yes##/##no## or ##1##/##0##) which can be displayed as select or checkbox fields.|{{image reference="boolean.png" size="medium"/}} | ||
| 21 | |**Static List**|Allows to store and display single-select or multi-select fields that can be displayed as select, checkbox, radio or suggests fields. The possible values of static list fields are configured in the field definition.|{{image reference="static-list.png" size="medium"/}} | ||
| 22 | |**Access Right Levels**|Allows selecting one or more access rights from the list of [[all permission types>>xwiki:Documentation.AdminGuide.Access Rights.Permission types.WebHome]] to define access control settings.|{{image reference="access-right-levels.png" size="medium"/}} | ||
| 23 | |**Text Area**|Allows to store and display large text fields (##text## and ##wysiwyg##).|{{image reference="text-area.png" size="medium"/}} | ||
| 24 | |**Page**|Same as a Database List field, but made to store XWiki page names. |